Merge lp:~lmi/ocb-addons/7.0-opw-596916-rgo into lp:ocb-addons

Proposed by Laurent Mignon (Acsone)
Status: Rejected
Rejected by: Holger Brunn (Therp)
Proposed branch: lp:~lmi/ocb-addons/7.0-opw-596916-rgo
Merge into: lp:ocb-addons
Diff against target: 49 lines (+10/-0)
3 files modified
stock/security/stock_security.xml (+7/-0)
stock/stock.py (+1/-0)
stock/stock_view.xml (+2/-0)
To merge this branch: bzr merge lp:~lmi/ocb-addons/7.0-opw-596916-rgo
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) Disapprove
Stefan Rijnhart (Opener) code review Approve
Pedro Manuel Baeza code review Approve
Review via email: mp+218476@code.launchpad.net

Description of the change

Automatically derived from https://code.launchpad.net/~openerp-dev/openobject-addons/7.0-opw-596916-rgo for https://code.launchpad.net/~openerp/openobject-addons/7.0. Below is a copy of the original description.

Hi,

For 'stock.production.lot' object, the field 'company_id' isn't shown in it's views and there isn't any code that sets this field and there are not any record rules which provide support for multi-company environment.

This branch fixes these issues, kindly review the branch.

Thanks.

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Thanks for the MP.

Regards.

review: Approve (code review)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks for the backport! Launchpad will tell you that the branch is stacked invalidly. This should be harmless, and is fixed in the latest commits to lp-community-utils.

review: Approve (code review)
Revision history for this message
Laurent Mignon (Acsone) (lmi) wrote :

Stefan,

Thanks for the information. I have indeed discovered the fix after the backport.

Regards,

lmi

Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Development for 7.0 has moved to github on https://github.com/OCA/ocb - please move your merge proposal there if it is still valid.

(I close and reject this in order to have a cleaner overview for 6.1 MPs which indeed have to be done on launchpad)

review: Disapprove

Unmerged revisions

10168. By Ravi Gohil (OpenERP)

[FIX] stock: no multicompany rule defined for stock.prodution.lot and the company_id field isn't shown in views hence user is not able to set the field. (Maintenance: 596916)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/security/stock_security.xml'
2--- stock/security/stock_security.xml 2014-04-04 18:52:40 +0000
3+++ stock/security/stock_security.xml 2014-05-06 17:27:45 +0000
4@@ -45,6 +45,13 @@
5 <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
6 </record>
7
8+ <record model="ir.rule" id="stock_production_lot">
9+ <field name="name">stock_production_lot multi-company</field>
10+ <field name="model_id" search="[('model','=','stock.production.lot')]" model="ir.model"/>
11+ <field name="global" eval="True"/>
12+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
13+ </record>
14+
15 <record model="ir.rule" id="stock_warehouse_comp_rule">
16 <field name="name">Warehouse multi-company</field>
17 <field name="model_id" ref="model_stock_warehouse"/>
18
19=== modified file 'stock/stock.py'
20--- stock/stock.py 2014-04-30 10:28:47 +0000
21+++ stock/stock.py 2014-05-06 17:27:45 +0000
22@@ -1510,6 +1510,7 @@
23 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
24 'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'stock.lot.serial'),
25 'product_id': lambda x, y, z, c: c.get('product_id', False),
26+ 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.production.lot', context=c),
27 }
28 _sql_constraints = [
29 ('name_ref_uniq', 'unique (name, ref)', 'The combination of Serial Number and internal reference must be unique !'),
30
31=== modified file 'stock/stock_view.xml'
32--- stock/stock_view.xml 2014-04-29 08:31:08 +0000
33+++ stock/stock_view.xml 2014-05-06 17:27:45 +0000
34@@ -314,6 +314,7 @@
35 <field name="indice"/>
36 <field name="date"/>
37 <field name="author_id"/>
38+ <field name="company_id" groups="base.group_multi_company" widget="selection"/>
39 </group>
40 <separator string="Description"/>
41 <field name="description"/>
42@@ -360,6 +361,7 @@
43 <group>
44 <field name="date"/>
45 <field name="stock_available"/>
46+ <field name="company_id" groups="base.group_multi_company" widget="selection"/>
47 </group>
48 </group>
49 <notebook>