summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorForam Katharotiya (OpenERP) <fka@tinyerp.com>2014-04-04 14:30:03 +0200
committerLionel Sausin <ls@numerigraphe.com>2014-04-04 14:30:03 +0200
commitbae4c6ce408c3cd9cb7491b94e20a0082eb60f40 (patch)
treee20f2664311b6b5e993ea9f4ceae9035c65a2575 /addons
parent90ddb9f8975d9d99fadd864538f6e9f285d63b79 (diff)
[IMP] bring back the tests for MRP - backported from little after v7.0 in the trunk
lp bug: https://launchpad.net/bugs/1182515 fixed bzr revid: ls@numerigraphe.com-20140404123003-cdt5zz1vmupbgd1j
Diffstat (limited to 'addons')
-rw-r--r--addons/mrp/__openerp__.py9
-rw-r--r--addons/mrp/security/ir.model.access.csv1
-rw-r--r--addons/mrp/security/mrp_security.xml1
-rw-r--r--addons/mrp/test/cancel_order.yml5
-rw-r--r--addons/mrp/test/mrp_users.yml20
-rw-r--r--addons/mrp/test/order_demo.yml5
-rw-r--r--addons/mrp/test/order_process.yml5
7 files changed, 41 insertions, 5 deletions
diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py
index d33fa4d2622..3157eee57bc 100644
--- a/addons/mrp/__openerp__.py
+++ b/addons/mrp/__openerp__.py
@@ -74,13 +74,12 @@ Dashboard / Reports for MRP will include:
'res_config_view.xml',
],
'demo': ['mrp_demo.xml'],
- #TODO: This yml tests are needed to be completely reviewed again because the product wood panel is removed in product demo as it does not suit for new demo context of computer and consultant company
- # so the ymls are too complex to change at this stage
'test': [
'test/bom_with_service_type_product.yml',
-# 'test/order_demo.yml',
-# 'test/order_process.yml',
-# 'test/cancel_order.yml',
+ 'test/mrp_users.yml',
+ 'test/order_demo.yml',
+ 'test/order_process.yml',
+ 'test/cancel_order.yml',
],
'installable': True,
'application': True,
diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv
index 7a94b1a660c..2d0a478c33d 100644
--- a/addons/mrp/security/ir.model.access.csv
+++ b/addons/mrp/security/ir.model.access.csv
@@ -1,4 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+access_account_analytic_line_user,account.analytic.line,account.model_account_analytic_line,group_mrp_user,1,1,1,0
access_mrp_workcenter,mrp.workcenter,model_mrp_workcenter,mrp.group_mrp_user,1,0,0,0
access_mrp_routing,mrp.routing,model_mrp_routing,mrp.group_mrp_user,1,0,0,0
access_mrp_routing_workcenter,mrp.routing.workcenter,model_mrp_routing_workcenter,mrp.group_mrp_user,1,0,0,0
diff --git a/addons/mrp/security/mrp_security.xml b/addons/mrp/security/mrp_security.xml
index 35aae42b53d..9e5dc919720 100644
--- a/addons/mrp/security/mrp_security.xml
+++ b/addons/mrp/security/mrp_security.xml
@@ -4,6 +4,7 @@
<record id="group_mrp_user" model="res.groups">
<field name="name">User</field>
+ <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
<field name="category_id" ref="base.module_category_manufacturing"/>
</record>
<record id="group_mrp_manager" model="res.groups">
diff --git a/addons/mrp/test/cancel_order.yml b/addons/mrp/test/cancel_order.yml
index 9e197156b15..2f721b6c653 100644
--- a/addons/mrp/test/cancel_order.yml
+++ b/addons/mrp/test/cancel_order.yml
@@ -1,4 +1,9 @@
-
+ MRP user can cancelled Production Order, so let's check data with giving the access rights of user.
+-
+ !context
+ uid: 'res_users_mrp_user'
+-
I first confirm order for PC Assemble SC349.
-
!workflow {model: mrp.production, action: button_confirm, ref: mrp_production_test1}
diff --git a/addons/mrp/test/mrp_users.yml b/addons/mrp/test/mrp_users.yml
new file mode 100644
index 00000000000..d18cc51e8e6
--- /dev/null
+++ b/addons/mrp/test/mrp_users.yml
@@ -0,0 +1,20 @@
+-
+ Create a user as 'MRP Manager'
+-
+ !record {model: res.users, id: res_users_mrp_manager}:
+ company_id: base.main_company
+ name: MRP Manager
+ login: mam
+ password: mam
+ groups_id:
+ - mrp.group_mrp_manager
+-
+ Create a user as 'MRP User'
+-
+ !record {model: res.users, id: res_users_mrp_user}:
+ company_id: base.main_company
+ name: MRP User
+ login: mau
+ password: mau
+ groups_id:
+ - mrp.group_mrp_user
diff --git a/addons/mrp/test/order_demo.yml b/addons/mrp/test/order_demo.yml
index ee21fee96df..0e4914390fb 100644
--- a/addons/mrp/test/order_demo.yml
+++ b/addons/mrp/test/order_demo.yml
@@ -1,4 +1,9 @@
-
+ MRP user can create Production Order, so let's check data with giving the access rights of user.
+-
+ !context
+ uid: 'res_users_mrp_user'
+-
I create Production Order of PC Assemble SC349 to produce 5.0 Unit.
-
!record {model: mrp.production, id: mrp_production_test1}:
diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml
index e672517c5a0..32eee92bac0 100644
--- a/addons/mrp/test/order_process.yml
+++ b/addons/mrp/test/order_process.yml
@@ -1,4 +1,9 @@
-
+ MRP user can doing all process related to Production Order, so let's check data with giving the access rights of user.
+-
+ !context
+ uid: 'res_users_mrp_user'
+-
I compute the production order.
-
!python {model: mrp.production}: |