diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 6625cc5493a..97c4685ea52 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1302,7 +1302,10 @@ class account_invoice_line(models.Model): doc = etree.XML(res['arch']) for node in doc.xpath("//field[@name='product_id']"): if self._context['type'] in ('in_invoice', 'in_refund'): - node.set('domain', "[('purchase_ok', '=', True)]") + # Hack to fix the stable version 8.0 -> saas-12 + # purchase_ok will be moved from purchase to product in master #13271 + if 'purchase_ok' in self.env['product.template']._fields: + node.set('domain', "[('purchase_ok', '=', True)]") else: node.set('domain', "[('sale_ok', '=', True)]") res['arch'] = etree.tostring(doc)