diff options
| author | Goffin Simon <sig@odoo.com> | 2018-04-09 11:14:10 +0200 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2018-04-09 14:47:31 +0200 |
| commit | ec7f88c334e10c81de4c05e62a06f4b6b2c19ae3 (patch) | |
| tree | ccf6074aa3e7815a27fa3e4cc918063811b271cb | |
| parent | 026781ec3e133d1c7ac7468a25bb286e64e8a9b9 (diff) | |
[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
| -rw-r--r-- | addons/account_asset/account_asset_invoice.py | 1 |
1 files changed, 1 insertions, 0 deletions
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): |
