add bank account number to xml-export
This commit is contained in:
parent
813f5a4bcf
commit
9f2be4e593
2 changed files with 51 additions and 16 deletions
20
mixin.py
20
mixin.py
|
@ -9,6 +9,7 @@ import html
|
|||
from trytond.exceptions import UserError
|
||||
from trytond.i18n import gettext
|
||||
from trytond.tools import cached_property
|
||||
from trytond.pool import Pool
|
||||
|
||||
|
||||
class EdocumentMixin(object):
|
||||
|
@ -16,6 +17,25 @@ class EdocumentMixin(object):
|
|||
"""
|
||||
__slots__ = ()
|
||||
|
||||
def company_bank_accounts(self):
|
||||
""" get leist of bank account numbers, defined in config
|
||||
|
||||
Returns:
|
||||
list: records of model bank.account.number
|
||||
"""
|
||||
Configuration = Pool().get('account.configuration')
|
||||
|
||||
result = []
|
||||
cfg1 = Configuration.get_singleton()
|
||||
if cfg1 and cfg1.edocument_bank:
|
||||
result.extend(list(cfg1.edocument_bank))
|
||||
else:
|
||||
result.extend([
|
||||
y
|
||||
for x in self.company.party.bank_accounts
|
||||
for y in x.numbers])
|
||||
return result
|
||||
|
||||
@cached_property
|
||||
def seller_trade_address(self):
|
||||
""" get address of seller, throw exception if incomplete
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue