mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] product_contract: Set description under product name instead of description
Using the feature extraLines of Many2one field Component we can add the info under the product and avoid noice on the product description.
You can show this info on the description by using the system parameters:
- product_contract.show_recurrency
- product_contract.show_invoicing_type
- product_contract.show_date
This commit is contained in:
@@ -4,6 +4,21 @@ import {SaleOrderLineProductField} from "@sale/js/sale_product_field";
|
||||
import {patch} from "@web/core/utils/patch";
|
||||
|
||||
patch(SaleOrderLineProductField.prototype, {
|
||||
get extraLines() {
|
||||
var res = super.extraLines;
|
||||
if (
|
||||
this.props.record.data.is_contract &&
|
||||
this.props.record.data.product_contract_description
|
||||
) {
|
||||
for (var val of this.props.record.data.product_contract_description.split(
|
||||
"||"
|
||||
)) {
|
||||
res.push(val);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
},
|
||||
|
||||
async _onProductUpdate() {
|
||||
super._onProductUpdate(...arguments);
|
||||
if (this.props.record.data.is_contract) {
|
||||
|
||||
Reference in New Issue
Block a user