Use accounting date to format invoice number
issue7716 review51541002
This commit is contained in:
1 parent
bbc4a49bda
commit
7754c5c3c1
2 files changed
+4
-2
No files matched your search
@@ -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
@@ -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
|
||||
|
||||
Reference in new issue
Block a user