mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] product_contract: Compute date_start and date_end correctly. Make fields computed
This commit is contained in:
committed by
Carlos Roca
parent
f7223188d9
commit
0ae4fab56d
@@ -444,6 +444,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
||||
<li>Ernesto Tejeda</li>
|
||||
<li>Pedro M. Baeza</li>
|
||||
<li>Carlos Roca</li>
|
||||
<li>Sergio Teruel</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>David Jaen <<a class="reference external" href="mailto:david.jaen.revert@gmail.com">david.jaen.revert@gmail.com</a>></li>
|
||||
|
||||
@@ -21,6 +21,7 @@ export class ProductContractConfiguratorController extends formView.Controller {
|
||||
is_auto_renew,
|
||||
auto_renew_interval,
|
||||
auto_renew_rule_type,
|
||||
recurring_interval,
|
||||
} = record.data;
|
||||
return this.action.doAction({
|
||||
type: "ir.actions.act_window_close",
|
||||
@@ -34,6 +35,7 @@ export class ProductContractConfiguratorController extends formView.Controller {
|
||||
is_auto_renew,
|
||||
auto_renew_interval,
|
||||
auto_renew_rule_type,
|
||||
recurring_interval,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -44,6 +44,7 @@ patch(SaleOrderLineProductField.prototype, {
|
||||
default_company_id: this.props.record.model.root.data.company_id[0],
|
||||
default_product_uom_qty: this.props.record.data.product_uom_qty,
|
||||
default_contract_id: this.props.record.data.contract_id[0],
|
||||
default_recurring_interval: this.props.record.data.recurring_interval,
|
||||
default_date_start: this.props.record.data.date_start,
|
||||
default_date_end: this.props.record.data.date_end,
|
||||
default_is_auto_renew: this.props.record.data.is_auto_renew,
|
||||
@@ -54,7 +55,9 @@ patch(SaleOrderLineProductField.prototype, {
|
||||
additionalContext: actionContext,
|
||||
onClose: async (closeInfo) => {
|
||||
if (closeInfo && !closeInfo.special) {
|
||||
this.props.record.update(closeInfo.productContractConfiguration);
|
||||
this.props.record._update(closeInfo.productContractConfiguration, {
|
||||
withoutOnchange: true,
|
||||
});
|
||||
} else if (isNew) {
|
||||
this.props.record.update({
|
||||
[this.props.name]: undefined,
|
||||
|
||||
Reference in New Issue
Block a user