Auto-reset period when changing date on invoice

This commit is contained in:
Alexis de Lattre
2016-09-12 12:58:02 +02:00
parent 5707feeb42
commit 4f7abe3354

View File

@@ -54,6 +54,14 @@ class AccountInvoice(models.Model):
invoice.date_invoice))
return super(AccountInvoice, self).action_move_create()
@api.multi
def onchange_payment_term_date_invoice(self, payment_term_id, date_invoice):
res = super(AccountInvoice, self).onchange_payment_term_date_invoice(
payment_term_id, date_invoice)
if res and isinstance(res, dict) and 'value' in res:
res['value']['period_id'] = False
return res
class AccountFiscalYear(models.Model):
_inherit = 'account.fiscalyear'