請求書の日付を変更する際に期日を計算しようとしていますが、機能していません。
raise osv.except_osv(_('OnChangeDateInvoice'), _('Start'))
if date_invoice != time.strftime('%Y-%m-%d'):
if not payment_term_id:
return {'value':{'date_due': date_invoice}}
pterm_list = self.pool.get('account.payment.term').compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
if payment_term != partner_payment_term:
if partner_payment_term:
to_update = self.onchange_payment_term_date_invoice(
cr, uid, ids, partner_payment_term, date_invoice)
result['value'].update(to_update['value'])
if pterm_list:
pterm_list = [line[0] for line in pterm_list]
pterm_list.sort()
result = {'value':{'date_due': pterm_list[-1]}}
else:
result['value']['date_due'] = False
raise osv.except_osv(_('OnChangeDateInvoice'), _('End'))
return result