summaryrefslogtreecommitdiff
path: root/addons/mrp/tests/common.py
diff options
context:
space:
mode:
authorArnold Moyaux <arm@odoo.com>2019-02-11 14:47:18 +0000
committerArnold Moyaux <arm@odoo.com>2019-04-12 12:50:34 +0000
commita4c0994cf44f06dd2d9db2af18e8fb4653a3ef09 (patch)
treeb04a2959d02e2da3a513aeb6d9ce92c220d42c43 /addons/mrp/tests/common.py
parent6f25cf1aa71366c0cabf93a9be79a929223f3287 (diff)
[REF] mrp: byproduct as a workorder line
Technical refactoring in order to set by-products the same way than raw materials. Before this commit byproduct were always set at the last workorder or automaticaly set at the end of produce wizard with the same quantity than in the BoM. In order to modify it, the user has to produce the finished product then unlock and edit the finished move line linked to the byproduct. In this commit, the user could specify at which workorder the byproduct is created and he could directly specify another quantity done in the produce wizard inside a specific tab for by-products. Technicaly, abstract workorder will add a new many2one key on workorder line in order to set 2 different one2many (one for finished goods and the other for raw materials). The key is set depending the many2one key for production on the linked stock move. On the by-products itself, it is now managed as a workorder line, thus the code to generate them and transform them in a finished stock move line is the same than for the raw components.
Diffstat (limited to 'addons/mrp/tests/common.py')
-rw-r--r--addons/mrp/tests/common.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/addons/mrp/tests/common.py b/addons/mrp/tests/common.py
index c63cec46e04..55e817e68f6 100644
--- a/addons/mrp/tests/common.py
+++ b/addons/mrp/tests/common.py
@@ -54,6 +54,7 @@ class TestMrpCommon(common2.TestStockCommon):
user_group_stock_user = cls.env.ref('stock.group_stock_user')
user_group_mrp_user = cls.env.ref('mrp.group_mrp_user')
user_group_mrp_manager = cls.env.ref('mrp.group_mrp_manager')
+ user_group_mrp_byproducts = cls.env.ref('mrp.group_mrp_byproducts')
# Update demo products
(cls.product_2 | cls.product_3 | cls.product_4 | cls.product_5 | cls.product_6 | cls.product_7 | cls.product_8).write({
@@ -67,13 +68,21 @@ class TestMrpCommon(common2.TestStockCommon):
'login': 'hilda',
'email': 'h.h@example.com',
'notification_type': 'inbox',
- 'groups_id': [(6, 0, [user_group_mrp_user.id, user_group_stock_user.id])]})
+ 'groups_id': [(6, 0, [
+ user_group_mrp_user.id,
+ user_group_stock_user.id,
+ user_group_mrp_byproducts.id
+ ])]})
cls.user_mrp_manager = Users.create({
'name': 'Gary Youngwomen',
'login': 'gary',
'email': 'g.g@example.com',
'notification_type': 'inbox',
- 'groups_id': [(6, 0, [user_group_mrp_manager.id, user_group_stock_user.id])]})
+ 'groups_id': [(6, 0, [
+ user_group_mrp_manager.id,
+ user_group_stock_user.id,
+ user_group_mrp_byproducts.id
+ ])]})
cls.workcenter_1 = cls.env['mrp.workcenter'].create({
'name': 'Nuclear Workcenter',