Use accounting date to format invoice number

issue7716
review51541002
This commit is contained in:
Cédric Krier committed 2018-09-26 23:06:18 +02:00
1 parent bbc4a49bda
commit 7754c5c3c1
2 files changed
+4 -2

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Use accounting date to format invoice number
* Add invoice payment method
* Show number and reference in invoice rec_name
* Remove support for Python 2.7
+3 -2
View File
@@ -1005,8 +1005,9 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
else:
pattern = pattern.copy()
accounting_date = self.accounting_date or self.invoice_date
period_id = Period.find(
self.company.id, date=self.accounting_date or self.invoice_date,
self.company.id, date=accounting_date,
test_state=self.type != 'in')
period = Period(period_id)
@@ -1031,7 +1032,7 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
'invoice': self.rec_name,
'fiscalyear': fiscalyear.rec_name,
})
with Transaction().set_context(date=self.invoice_date):
with Transaction().set_context(date=accounting_date):
return Sequence.get_id(sequence.id)
@classmethod