Skip to content

Commit

Permalink
[13.0] [FIX] sale_ux: Avoid right error when create and advance payme…
Browse files Browse the repository at this point in the history
…nt for sales user.
  • Loading branch information
nicomacr authored and jjscarafia committed May 4, 2021
1 parent 8932294 commit 7c6b1c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sale_ux/wizards/sale_advance_payment_inv.py
Expand Up @@ -64,8 +64,9 @@ def _create_invoice(self, order, so_line, amount):
).get_param('sale.propagate_internal_notes') == 'True'
propagate_note = self.env['ir.config_parameter'].sudo(
).get_param('sale.propagate_note') == 'True'
# we use sudo to prevent error with sales user when create the invoice
if propagate_internal_notes:
invoice.internal_notes = order.internal_notes
invoice.sudo().internal_notes = order.internal_notes
if not propagate_note:
invoice.comment = False
invoice.sudo().comment = False
return invoice

0 comments on commit 7c6b1c0

Please sign in to comment.