Merge lp:~openerp-dev/openobject-addons/trunk-bug-788139-ron into lp:openobject-addons

Proposed by Rohan Nayani(Open ERP)
Status: Merged
Merged at revision: 5063
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-788139-ron
Merge into: lp:openobject-addons
Diff against target: 160 lines (+82/-4)
7 files modified
mrp/security/mrp_security.xml (+14/-0)
product/security/product_security.xml (+10/-3)
stock/security/stock_security.xml (+14/-0)
stock_location/__openerp__.py (+1/-1)
stock_location/security/stock_location_security.xml (+21/-0)
stock_planning/__openerp__.py (+1/-0)
stock_planning/security/stock_planning_security.xml (+21/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-788139-ron
Reviewer Review Type Date Requested Status
Rohan Nayani(Open ERP) (community) Needs Resubmitting
Rucha (Open ERP) (community) Needs Fixing
qdp (OpenERP) Pending
Review via email: mp+63853@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

For products, it seems better to keep that current behavior. Don't put restriction to access products of parent company, (The reason specified well here: http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/revision/4334.1.113)
same thing for production lot, pricelist too

Thanks

review: Needs Fixing
Revision history for this message
Rohan Nayani(Open ERP) (ron-tinyerp) wrote :

Hello,

        Improved rule(Access parent and child both company) product_template, product_pricelist,
product_pricelist_item, product_pricelist_version,stock_production_lot, stock_production_lot_revision.

thanks
RON

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mrp/security/mrp_security.xml'
2--- mrp/security/mrp_security.xml 2011-08-02 13:08:11 +0000
3+++ mrp/security/mrp_security.xml 2011-09-15 11:38:25 +0000
4@@ -37,5 +37,19 @@
5 <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
6 </record>
7
8+ <record model="ir.rule" id="mrp_routing_rule">
9+ <field name="name">mrp_routing multi-company</field>
10+ <field name="model_id" search="[('model','=','mrp.routing')]" model="ir.model"/>
11+ <field name="global" eval="True"/>
12+ <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
13+ </record>
14+
15+ <record model="ir.rule" id="mrp_routing_workcenter_rule">
16+ <field name="name">mrp_routing_workcenter multi-company</field>
17+ <field name="model_id" search="[('model','=','mrp.routing.workcenter')]" model="ir.model"/>
18+ <field name="global" eval="True"/>
19+ <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
20+ </record>
21+
22 </data>
23 </openerp>
24
25=== modified file 'product/security/product_security.xml'
26--- product/security/product_security.xml 2011-05-31 21:23:20 +0000
27+++ product/security/product_security.xml 2011-09-15 11:38:25 +0000
28@@ -28,21 +28,28 @@
29 <field name="name">product pricelist company rule</field>
30 <field name="model_id" ref="model_product_pricelist"/>
31 <field name="global" eval="True"/>
32- <field name="domain_force">['|','|',('company_id','=',False),('company_id','child_of',[user.company_id.id]),('company_id.child_ids','child_of',[user.company_id.id])]</field>
33+ <field name="domain_force"> ['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
34 </record>
35
36 <record model="ir.rule" id="product_pricelist_item_comp_rule">
37 <field name="name">product pricelist item company rule</field>
38 <field name="model_id" ref="model_product_pricelist_item"/>
39 <field name="global" eval="True"/>
40- <field name="domain_force">['|','|',('company_id','=',False),('company_id','child_of',[user.company_id.id]),('company_id.child_ids','child_of',[user.company_id.id])]</field>
41+ <field name="domain_force"> ['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
42 </record>
43
44 <record model="ir.rule" id="product_pricelist_version_comp_rule">
45 <field name="name">product pricelist version company rule</field>
46 <field name="model_id" ref="model_product_pricelist_version"/>
47 <field name="global" eval="True"/>
48- <field name="domain_force">['|','|',('company_id','=',False),('company_id','child_of',[user.company_id.id]),('company_id.child_ids','child_of',[user.company_id.id])]</field>
49+ <field name="domain_force"> ['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
50+ </record>
51+
52+ <record model="ir.rule" id="product_supplierinfo_comp_rule">
53+ <field name="name">product supplierinfo company rule</field>
54+ <field name="model_id" ref="model_product_supplierinfo"/>
55+ <field name="global" eval="True"/>
56+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
57 </record>
58
59 </data>
60
61=== modified file 'stock/security/stock_security.xml'
62--- stock/security/stock_security.xml 2011-08-02 13:08:11 +0000
63+++ stock/security/stock_security.xml 2011-09-15 11:38:25 +0000
64@@ -54,5 +54,19 @@
65 <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
66 </record>
67
68+ <record model="ir.rule" id="stock_production_lot_comp_rule">
69+ <field name="name">Production lot multi-company</field>
70+ <field name="model_id" ref="model_stock_production_lot"/>
71+ <field name="global" eval="True"/>
72+ <field name="domain_force"> ['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
73+ </record>
74+
75+ <record model="ir.rule" id="stock_production_lot_revision_comp_rule">
76+ <field name="name">Production lot revision multi-company</field>
77+ <field name="model_id" ref="model_stock_production_lot_revision"/>
78+ <field name="global" eval="True"/>
79+ <field name="domain_force"> ['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
80+ </record>
81+
82 </data>
83 </openerp>
84
85=== modified file 'stock_location/__openerp__.py'
86--- stock_location/__openerp__.py 2011-03-25 10:24:13 +0000
87+++ stock_location/__openerp__.py 2011-09-15 11:38:25 +0000
88@@ -89,7 +89,7 @@
89 'images': ['images/pulled_flow.jpeg','images/pushed_flow.jpeg'],
90 'depends': ['procurement','stock','sale'],
91 'init_xml': [],
92- 'update_xml': ['stock_location_view.xml', 'security/ir.model.access.csv', 'procurement_pull_workflow.xml'],
93+ 'update_xml': ['stock_location_view.xml', "security/stock_location_security.xml", 'security/ir.model.access.csv', 'procurement_pull_workflow.xml'],
94 'demo_xml': [
95 'stock_location_demo_cpu1.xml',
96 'stock_location_demo_cpu3.yml',
97
98=== added file 'stock_location/security/stock_location_security.xml'
99--- stock_location/security/stock_location_security.xml 1970-01-01 00:00:00 +0000
100+++ stock_location/security/stock_location_security.xml 2011-09-15 11:38:25 +0000
101@@ -0,0 +1,21 @@
102+<?xml version="1.0" encoding="utf-8"?>
103+<openerp>
104+<data noupdate="0">
105+
106+<!-- multi -->
107+ <record model="ir.rule" id="product_pulled_flow_comp_rule">
108+ <field name="name">product_pulled_flow multi-company</field>
109+ <field name="model_id" ref="model_product_pulled_flow"/>
110+ <field name="global" eval="True"/>
111+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
112+ </record>
113+
114+ <record model="ir.rule" id="stock_location_path_comp_rule">
115+ <field name="name">stock_location_path multi-company</field>
116+ <field name="model_id" ref="model_stock_location_path"/>
117+ <field name="global" eval="True"/>
118+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
119+ </record>
120+
121+</data>
122+</openerp>
123
124=== modified file 'stock_planning/__openerp__.py'
125--- stock_planning/__openerp__.py 2011-03-25 10:24:13 +0000
126+++ stock_planning/__openerp__.py 2011-09-15 11:38:25 +0000
127@@ -144,6 +144,7 @@
128 """,
129 "demo_xml":[],
130 "update_xml": [
131+ "security/stock_planning_security.xml",
132 "security/ir.model.access.csv",
133 "stock_planning_view.xml",
134 "wizard/stock_planning_create_periods_view.xml",
135
136=== added file 'stock_planning/security/stock_planning_security.xml'
137--- stock_planning/security/stock_planning_security.xml 1970-01-01 00:00:00 +0000
138+++ stock_planning/security/stock_planning_security.xml 2011-09-15 11:38:25 +0000
139@@ -0,0 +1,21 @@
140+<?xml version="1.0" encoding="utf-8"?>
141+<openerp>
142+<data noupdate="0">
143+
144+<!-- multi -->
145+ <record model="ir.rule" id="stock_planning_comp_rule">
146+ <field name="name">stock_planning multi-company</field>
147+ <field name="model_id" ref="model_stock_planning"/>
148+ <field name="global" eval="True"/>
149+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
150+ </record>
151+
152+ <record model="ir.rule" id="stock_sale_forecast_comp_rule">
153+ <field name="name">stock_sale_forecast multi-company</field>
154+ <field name="model_id" ref="model_stock_sale_forecast"/>
155+ <field name="global" eval="True"/>
156+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
157+ </record>
158+
159+</data>
160+</openerp>

Subscribers

People subscribed via source and target branches

to all changes: