[FIX] sale: allow adding/modifying values in sale confirmation

closes odoo/odoo#55861

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
root
2020-08-13 10:02:04 +00:00
parent 419d4bbee0
commit 390c01a430
+7 -4
View File
@@ -831,6 +831,12 @@ Reason(s) of this behavior could be:
return True
def _prepare_confirmation_values(self):
return {
'state': 'sale',
'date_order': fields.Datetime.now()
}
def action_confirm(self):
if self._get_forbidden_state_confirm() & set(self.mapped('state')):
raise UserError(_(
@@ -839,10 +845,7 @@ Reason(s) of this behavior could be:
for order in self.filtered(lambda order: order.partner_id not in order.message_partner_ids):
order.message_subscribe([order.partner_id.id])
self.write({
'state': 'sale',
'date_order': fields.Datetime.now()
})
self.write(self._prepare_confirmation_values())
self._action_confirm()
if self.env.user.has_group('sale.group_auto_done_setting'):
self.action_done()