mirror of
https://github.com/NaN-tic/trytond-contract_payment_type.git
synced 2023-12-14 06:13:04 +01:00
Add company to context
This commit is contained in:
parent
eb77889d59
commit
2fd9a3c695
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
# the full copyright notices and license terms.
|
||||
from trytond.model import fields
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
from trytond.modules.account_bank.account import BankMixin
|
||||
|
||||
__all__ = ['PaymentType', 'Contract', 'ContractConsumption']
|
||||
|
@ -24,6 +25,12 @@ class Contract(BankMixin, metaclass=PoolMeta):
|
|||
('kind', 'in', ['both', 'receivable']),
|
||||
])
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super().__setup__()
|
||||
cls.account_bank_from.context = {'company': Eval('company')}
|
||||
cls.account_bank_from.depends.append('company')
|
||||
|
||||
@classmethod
|
||||
def default_payment_type(cls):
|
||||
PaymentType = Pool().get('account.payment.type')
|
||||
|
|
Loading…
Reference in a new issue