Add company to context
This commit is contained in:
parent
e1588e5667
commit
767eaa4613
|
@ -1,12 +1,15 @@
|
|||
from trytond.pool import PoolMeta
|
||||
from trytond.model import fields
|
||||
from trytond.pyson import Eval
|
||||
|
||||
|
||||
class PurchaseLine(metaclass=PoolMeta):
|
||||
'Purchase Line'
|
||||
__name__ = 'purchase.line'
|
||||
party = fields.Function(fields.Many2One('party.party',
|
||||
'Party'), 'get_party', searcher = 'search_party')
|
||||
'Party', context={
|
||||
'company': Eval('company'),
|
||||
}, depends=['company']), 'get_party', searcher='search_party')
|
||||
|
||||
def get_party(self, name):
|
||||
return self.purchase.party.id
|
||||
|
|
Loading…
Reference in New Issue