Merge lp:~hsoft/server-env-tools/mass_editing_7.0 into lp:~serpentcs/server-env-tools/mass_editing_7.0

Proposed by Virgil Dupras
Status: Merged
Merged at revision: 38
Proposed branch: lp:~hsoft/server-env-tools/mass_editing_7.0
Merge into: lp:~serpentcs/server-env-tools/mass_editing_7.0
Diff against target: 51 lines (+8/-8)
2 files modified
mass_editing/mass_editing.py (+6/-6)
mass_editing/mass_editing_view.xml (+2/-2)
To merge this branch: bzr merge lp:~hsoft/server-env-tools/mass_editing_7.0
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) (community) code review Approve
Nhomar - Vauxoo (community) Approve
Serpent Consulting Services Pending
Review via email: mp+162969@code.launchpad.net

Description of the change

I began tackling Stephan's list of issues, starting with the first one (using a m2m field instead of a serialized ID list).

To post a comment you must log in.
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Good one!

Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

I am merging to trunk!.

Due to i merged serpent branch, i tested and it is working excenlent.

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

Looks like this has been merged in rev. 38 of lp:server-env-tools/7.0. Don't know why Launchpad did not pick it up.

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

Ah, I see. The series branch was not the target of this MP. Serpent or Virgil, can you please set this MP to merged?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mass_editing/mass_editing.py'
2--- mass_editing/mass_editing.py 2013-05-07 13:36:37 +0000
3+++ mass_editing/mass_editing.py 2013-05-08 12:44:28 +0000
4@@ -50,7 +50,7 @@
5 of the related document model"),
6 'ref_ir_value':fields.many2one('ir.values', 'Sidebar Button', readonly=True,
7 help="Sidebar button to open the sidebar action"),
8- 'model_list': fields.char('Model List', size=256)
9+ 'model_ids': fields.many2many('ir.model', string='Model List')
10 }
11
12 _sql_constraints = [
13@@ -60,15 +60,15 @@
14 def onchange_model(self, cr, uid, ids, model_id, context=None):
15 if context is None: context = {}
16 if not model_id:
17- return {'value': {'model_list': ''}}
18- model_list = [model_id]
19+ return {'value': {'model_ids': [(6, 0, [])]}}
20+ model_ids = [model_id]
21 model_obj = self.pool.get('ir.model')
22 active_model_obj = self.pool.get(model_obj.browse(cr, uid, model_id).model)
23 if active_model_obj._inherits:
24 for key, val in active_model_obj._inherits.items():
25- model_ids = model_obj.search(cr, uid, [('model', '=', key)], context=context)
26- model_list += model_ids
27- return {'value': {'model_list': str(model_list)}}
28+ found_model_ids = model_obj.search(cr, uid, [('model', '=', key)], context=context)
29+ model_ids += found_model_ids
30+ return {'value': {'model_ids': [(6, 0, model_ids)]}}
31
32 def create_action(self, cr, uid, ids, context=None):
33 vals = {}
34
35=== modified file 'mass_editing/mass_editing_view.xml'
36--- mass_editing/mass_editing_view.xml 2013-02-14 20:31:22 +0000
37+++ mass_editing/mass_editing_view.xml 2013-05-08 12:44:28 +0000
38@@ -10,11 +10,11 @@
39 <form string="Object">
40 <field name="name"/>
41 <field name="model_id" on_change="onchange_model(model_id)"/>
42- <field name="model_list" invisible="1"/>
43+ <field name="model_ids" invisible="1"/>
44 <notebook colspan="4">
45 <page string="Fields">
46 <field name="field_ids" colspan="4" nolabel="1"
47- domain="[('ttype', 'not in', ['one2many', 'reference', 'function']), ('model_id', 'in', model_list)]"/>
48+ domain="[('ttype', 'not in', ['one2many', 'reference', 'function']), ('model_id', 'in', model_ids[0][2])]"/>
49 </page>
50 <page string="Advanced">
51 <group colspan="2" col="2">

Subscribers

People subscribed via source and target branches