Skip to content

Commit

Permalink
[FIX] contract: Fix looping on manually single invoice wizard
Browse files Browse the repository at this point in the history
if the method creating invoice generates more than one invoice, we have
`[account.move(ID1, ID2)` for example and the `message_post()` fails w/ a `singleton error.

Adding a loop level allows to properly post messages no matter of the number of invoices generated by the wizard
  • Loading branch information
damdam-s authored and etobella committed Nov 3, 2023
1 parent 4b43b09 commit de73045
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions contract/wizards/contract_manually_single_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ def create_invoice(self):
domain=[("id", "=", self.contract_id.id)],
)
)
for record in result:
self.contract_id.message_post(
body=_(
"Contract manually generated: "
'<a href="#" data-oe-model="%s" data-oe-id="%s">'
"%s"
"</a>"
for list in result:
for record in list:
self.contract_id.message_post(
body=_(
"Contract manually generated: "
'<a href="#" data-oe-model="%s" data-oe-id="%s">'
"%s"
"</a>"
)
% (record._name, record.id, record.display_name)
)
% (record._name, record.id, record.display_name)
)
return True

0 comments on commit de73045

Please sign in to comment.