[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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user