Use the right date to find period in set_number

This commit is contained in:
Cédric Krier
2013-01-01 18:32:05 +01:00
parent 8437f17478
commit cce8d5083a
+2 -1
View File
@@ -904,8 +904,9 @@ class Invoice(Workflow, ModelSQL, ModelView):
if self.type in ('in_invoice', 'in_credit_note'):
test_state = False
accounting_date = self.accounting_date or self.invoice_date
period_id = Period.find(self.company.id,
date=self.invoice_date, test_state=test_state)
date=accounting_date, test_state=test_state)
period = Period(period_id)
sequence_id = getattr(period, self.type + '_sequence').id
if not sequence_id: