[FIX] account_usability: fix cash in computation of sale_dates

This commit is contained in:
Alexis de Lattre
2022-02-22 00:59:48 +01:00
parent 77a372b3ca
commit 1ef97629b7
2 changed files with 5 additions and 4 deletions

View File

@@ -37,6 +37,7 @@
'wizard/account_group_generate_view.xml',
'wizard/account_payment_register_views.xml',
'security/ir.model.access.csv',
'report/invoice_report.xml',
],
'qweb': ['static/src/xml/account_payment.xml'],
'installable': True,

View File

@@ -152,13 +152,13 @@ class AccountMove(models.Model):
""" French law requires to set sale order dates into invoice
returned string: "sale1 (date1), sale2 (date2) ..."
"""
for inv in self:
sales = inv.invoice_line_ids.mapped(
for move in self:
sales = move.invoice_line_ids.mapped(
'sale_line_ids').mapped('order_id')
dates = ["%s (%s)" % (
x.name, format_date(inv.env, self.date_order))
x.name, format_date(move.env, x.date_order))
for x in sales]
inv.sale_dates = ", ".join(dates)
move.sale_dates = ", ".join(dates)
# allow to manually create moves not only in general journals,
# but also in cash journal and check journals (= bank journals not linked to a bank account)