mirror of
https://github.com/NaN-tic/trytond-account_payment_type.git
synced 2023-12-13 20:50:25 +01:00
Replace on_change_with_bank_account to on_change_payment_type to get bank_account invoice
From #049621 #162641
This commit is contained in:
parent
d7ed1332ae
commit
34ed68d65f
1 changed files with 6 additions and 5 deletions
11
work.py
11
work.py
|
@ -1,20 +1,21 @@
|
|||
# This file is part of account_payment_type module for Tryton.
|
||||
# The COPYRIGHT file at the top level of this repository contains
|
||||
# the full copyright notices and license terms.
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
__all__ = ['Work']
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
|
||||
|
||||
class Work(metaclass=PoolMeta):
|
||||
__name__ = 'project.work'
|
||||
|
||||
def _get_invoice(self):
|
||||
Invoice = Pool().get('account.invoice')
|
||||
|
||||
invoice = super(Work, self)._get_invoice()
|
||||
|
||||
customer_payment_type = invoice.party.customer_payment_type
|
||||
if customer_payment_type:
|
||||
invoice.payment_type = customer_payment_type
|
||||
if hasattr(invoice, 'on_change_with_bank_account'):
|
||||
invoice.on_change_with_bank_account()
|
||||
if hasattr(Invoice, 'bank_account') and invoice.payment_type:
|
||||
invoice.on_change_payment_type()
|
||||
|
||||
return invoice
|
||||
|
|
Loading…
Reference in a new issue