From ec7f88c334e10c81de4c05e62a06f4b6b2c19ae3 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 9 Apr 2018 11:14:10 +0200 Subject: [PATCH] [FIX] account_asset: Access error with shared product with deferred revenue Steps to reproduce the bug: -Let's consider a multicompany environment with company A and B -Let's consider a shared product P for A and B -P has a deferred revenue type D set on it -D is defined in A -Let's consider a user U in company B -U creates a SO with P and try to generate the invoice Bug: A access error was raised because U is not allowed to see D and D is needed to genrate the invoice. opw:1825944 --- addons/account_asset/account_asset_invoice.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account_asset/account_asset_invoice.py b/addons/account_asset/account_asset_invoice.py index fe7ab4c7d44..66bc6779cc6 100644 --- a/addons/account_asset/account_asset_invoice.py +++ b/addons/account_asset/account_asset_invoice.py @@ -116,6 +116,7 @@ class ProductTemplate(models.Model): def onchange_deferred_revenue(self): if self.deferred_revenue_category_id: self.property_account_income_id = self.deferred_revenue_category_id.account_asset_id + self.company_id = self.deferred_revenue_category_id.company_id @api.onchange('asset_category_id') def onchange_asset(self):