trytonpsk-account_col/asset.py

17 lines
485 B
Python
Raw Normal View History

2020-04-07 15:34:03 +02:00
from trytond.pool import Pool
from trytond.pool import PoolMeta
class Asset(metaclass=PoolMeta):
__name__ = 'account.asset'
def get_move(self, line):
move = super(Asset, self).get_move(line)
Company = Pool().get('company.company')
company = Company.search([])
if move:
for line in move.lines:
2021-02-19 20:45:11 +01:00
if line.account.kind == 'expense':
2020-04-07 15:34:03 +02:00
line.party = company[0].party
return move