lims_account_invoice: avoid changing the product when the invoice line belongs to a service

This commit is contained in:
Adrián Bernardi 2021-11-25 12:50:32 -03:00
parent 54a62034a4
commit 63d27363f7
1 changed files with 4 additions and 0 deletions

View File

@ -274,6 +274,10 @@ class InvoiceLine(metaclass=PoolMeta):
('id', 'in', Eval('party_domain')), ('id', '!=', -1))]
if 'party_domain' not in cls.party.depends:
cls.party.depends.append('party_domain')
cls.product.states['readonly'] = Or(
Eval('invoice_state') != 'draft',
Bool(Eval('lims_service_sample')))
cls.product.depends.append('lims_service_sample')
@classmethod
def delete(cls, lines):