Use context to check model and field access
issue4081 review8481002
This commit is contained in:
1 parent
f8358b5c22
commit
6603d7bce4
1 file changed
+3
-4
@@ -42,10 +42,9 @@ class Sale:
|
||||
Invoice = Pool().get('account.invoice')
|
||||
invoice = super(Sale, self)._get_invoice_sale(invoice_type)
|
||||
if self.invoice_grouping_method:
|
||||
with Transaction().set_user(0, set_context=True):
|
||||
domain = self._get_grouped_invoice_domain(invoice)
|
||||
order = self._get_grouped_invoice_order()
|
||||
grouped_invoices = Invoice.search(domain, order=order, limit=1)
|
||||
domain = self._get_grouped_invoice_domain(invoice)
|
||||
order = self._get_grouped_invoice_order()
|
||||
grouped_invoices = Invoice.search(domain, order=order, limit=1)
|
||||
if grouped_invoices:
|
||||
invoice, = grouped_invoices
|
||||
return invoice
|
||||
Reference in new issue
Block a user