Files
odoo_source/addons/mrp_account/__manifest__.py
T
Nicolas Martinelli fe6b351e04 [FIX] mrp_account: access to BOM
- Install MRP and Accounting
- Create a user with only 'Billing' as access right
- Create a customer invoice
- Add a line, type some text (e.g. 'desk'), then click on 'Search
  more...'

An `AccessError` is raised.

It arises because of this:

https://github.com/odoo/odoo/blob/e2d7cf7898704c82f25556b0b0edb87c05ec5903/addons/mrp/models/product.py#L112

The user has no access to `mrp.bom`, leading to the error.

Since the user has access to stock moves and pickings (thanks to the
rules `access_stock_picking_invoicing_payments` and
`access_stock_move_invoicing_payments`, it makes sense to give him
access to `mrp.bom` and `mrp.bom.line`. Moreover, adding a `sudo` on the
mentioned line could cause issues since `_bom_find` performs a search
which is company dependent.

opw-2089556

closes odoo/odoo#39365

X-original-commit: 59ea1993bc5ddb66675bfc2bff70a626cd14b645
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-25 07:33:12 +00:00

32 lines
1017 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Accounting - MRP',
'version': '1.0',
'category': 'Manufacturing/Manufacturing',
'summary': 'Analytic accounting in Manufacturing',
'description': """
Analytic Accounting in MRP
==========================
* Cost structure report
Also, allows to compute the cost of the product based on its BoM, using the costs of its components and work center operations.
It adds a button on the product itself but also an action in the list view of the products.
If the automated inventory valuation is active, the necessary accounting entries will be created.
""",
'website': 'https://www.odoo.com/page/manufacturing',
'depends': ['mrp', 'stock_account'],
"init_xml" : [],
"demo_xml" : [],
"data": [
'security/ir.model.access.csv',
"views/product_views.xml",
"views/mrp_production_views.xml",
],
'installable': True,
'auto_install': True,
}