Add company to conext only in account.invoice setup
This commit is contained in:
parent
6de026ec13
commit
03301cf5d7
|
@ -97,6 +97,14 @@ class Invoice(ContactMixin, metaclass=PoolMeta):
|
||||||
__name__ = 'account.invoice'
|
__name__ = 'account.invoice'
|
||||||
_contact_config_name = 'account.invoice.configuration'
|
_contact_config_name = 'account.invoice.configuration'
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def __setup__(cls):
|
||||||
|
super().__setup__()
|
||||||
|
cls.allowed_invoice_contacts.context = {'company': Eval('company')}
|
||||||
|
cls.allowed_invoice_contacts.depends.add('company')
|
||||||
|
cls.invoice_contact.context = {'company': Eval('company')}
|
||||||
|
cls.invoice_contact.depends.add('company')
|
||||||
|
|
||||||
def _credit(self, **values):
|
def _credit(self, **values):
|
||||||
credit = super(Invoice, self)._credit(**values)
|
credit = super(Invoice, self)._credit(**values)
|
||||||
credit.invoice_contact = self.invoice_contact
|
credit.invoice_contact = self.invoice_contact
|
||||||
|
|
Loading…
Reference in New Issue