diff --git a/addons/sale/models/sale_order.py b/addons/sale/models/sale_order.py index a49c06dcecf..4349aaddcf1 100644 --- a/addons/sale/models/sale_order.py +++ b/addons/sale/models/sale_order.py @@ -396,13 +396,6 @@ class SaleOrder(models.Model): tax_totals = account_move._get_tax_totals(order.partner_id, tax_lines_data, order.amount_total, order.amount_untaxed, order.currency_id) order.tax_totals_json = json.dumps(tax_totals) - # YTI TODO: Convert into compute method, however this introduces - # a behavior change that breaks the test test_reservation_method_w_sale - # Note: This should be the case - @api.onchange('expected_date') - def _onchange_expected_date(self): - self.commitment_date = self.expected_date - @api.depends('transaction_ids') def _compute_authorized_transaction_ids(self): for trans in self: @@ -544,7 +537,7 @@ class SaleOrder(models.Model): } } - @api.onchange('commitment_date') + @api.onchange('commitment_date', 'expected_date') def _onchange_commitment_date(self): """ Warn if the commitment dates is sooner than the expected date """ if (self.commitment_date and self.expected_date and self.commitment_date < self.expected_date):