[FIX] sale: Use orm-cached _xmlid_to_res_id instead of ref
X-original-commit: 1a9133dcdd6a25e29b00eae3e4478801b3d9efca Part-of: odoo/odoo#90968
This commit is contained in:
committed by
Arnaud Joset
parent
f0fe283c76
commit
27e17cad1a
@@ -768,7 +768,9 @@ class SaleOrder(models.Model):
|
||||
'It is not allowed to confirm an order in the following states: %s'
|
||||
) % (', '.join(self._get_forbidden_state_confirm())))
|
||||
|
||||
for order in self.filtered(lambda order: order.partner_id not in order.message_partner_ids):
|
||||
for order in self:
|
||||
if order.partner_id in order.message_partner_ids:
|
||||
continue
|
||||
order.message_subscribe([order.partner_id.id])
|
||||
self.write(self._prepare_confirmation_values())
|
||||
|
||||
@@ -1101,10 +1103,10 @@ class SaleOrder(models.Model):
|
||||
if final:
|
||||
moves.sudo().filtered(lambda m: m.amount_total < 0).action_switch_invoice_into_refund_credit_note()
|
||||
for move in moves:
|
||||
move.message_post_with_view('mail.message_origin_link',
|
||||
values={'self': move, 'origin': move.line_ids.mapped('sale_line_ids.order_id')},
|
||||
subtype_id=self.env.ref('mail.mt_note').id
|
||||
)
|
||||
move.message_post_with_view(
|
||||
'mail.message_origin_link',
|
||||
values={'self': move, 'origin': move.line_ids.sale_line_ids.order_id},
|
||||
subtype_id=self.env['ir.model.data']._xmlid_to_res_id('mail.mt_note'))
|
||||
return moves
|
||||
|
||||
# MAIL #
|
||||
|
||||
Reference in New Issue
Block a user