summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralt-odoo <alt@odoo.com>2019-10-21 13:06:19 +0000
committerfw-bot <otis@odoo.com>2019-10-22 16:32:56 +0000
commit623b8a78e3039bd8974cf349d558215d49f99a2f (patch)
treee5ea7fa794dad0a565b16cf2222ea3973fff4f3a
parent708759d82a138990ef989912b070740eb776465f (diff)
[FIX] mrp_account: wrong company on analytic line when validating MO
When marking as done a MO, we use SUPERUSER to create analytic line as an MRP user does not always have access to analytic items. There is however a default value for company analytic line defined to the user's context company, so we need to use the current company of the real user instead. closes odoo/odoo#39209 X-original-commit: 14aade9341bf9d61cd21de948755fc339ae512ea Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
-rw-r--r--addons/mrp_account/models/mrp_production.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/mrp_account/models/mrp_production.py b/addons/mrp_account/models/mrp_production.py
index 5e97dbff4dd..6eaf19949a8 100644
--- a/addons/mrp_account/models/mrp_production.py
+++ b/addons/mrp_account/models/mrp_production.py
@@ -48,6 +48,7 @@ class MrpProduction(models.Model):
'account_id': account,
'ref': wc.code,
'unit_amount': hours,
+ 'company_id': self.company_id.id,
}
def _costs_generate(self):