Eval company or -1 in context m2o fields #163427
This commit is contained in:
parent
676eb18756
commit
e632786ebd
|
@ -29,7 +29,7 @@ class ContactMixin(Model, CompanyValueMixin):
|
||||||
None, None, "Allowed Contact",
|
None, None, "Allowed Contact",
|
||||||
help='Allowed relation types for the related contact.',
|
help='Allowed relation types for the related contact.',
|
||||||
context={
|
context={
|
||||||
'company': Eval('company'),
|
'company': Eval('company', -1),
|
||||||
},
|
},
|
||||||
depends=['company']),
|
depends=['company']),
|
||||||
'on_change_with_allowed_invoice_contacts')
|
'on_change_with_allowed_invoice_contacts')
|
||||||
|
@ -38,7 +38,7 @@ class ContactMixin(Model, CompanyValueMixin):
|
||||||
('id', 'in', Eval('allowed_invoice_contacts', [])),
|
('id', 'in', Eval('allowed_invoice_contacts', [])),
|
||||||
],
|
],
|
||||||
context={
|
context={
|
||||||
'company': Eval('company'),
|
'company': Eval('company', -1),
|
||||||
},
|
},
|
||||||
depends=['party', 'allowed_invoice_contacts', 'company'])
|
depends=['party', 'allowed_invoice_contacts', 'company'])
|
||||||
|
|
||||||
|
@ -100,9 +100,9 @@ class Invoice(ContactMixin, metaclass=PoolMeta):
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
super().__setup__()
|
super().__setup__()
|
||||||
cls.allowed_invoice_contacts.context = {'company': Eval('company')}
|
cls.allowed_invoice_contacts.context = {'company': Eval('company', -1)}
|
||||||
cls.allowed_invoice_contacts.depends.add('company')
|
cls.allowed_invoice_contacts.depends.add('company')
|
||||||
cls.invoice_contact.context = {'company': Eval('company')}
|
cls.invoice_contact.context = {'company': Eval('company', -1)}
|
||||||
cls.invoice_contact.depends.add('company')
|
cls.invoice_contact.depends.add('company')
|
||||||
|
|
||||||
def _credit(self, **values):
|
def _credit(self, **values):
|
||||||
|
|
Loading…
Reference in New Issue