Jigar Amin (OpenERP) has proposed merging
lp:~openerp-dev/openobject-server/trunk-bug-972042-jam into
lp:openobject-server.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-972042-jam/+merge/104485
Hello
MP contains fix of the Bug#lp:972042 - report action object does not update
correctly
If you update the model on report action it will change the report action of
the On that Model.
Kindly review this,
Thank You
--
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-972042-jam/+merge/104485
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-server/trunk-bug-972042-jam.
=== modified file 'openerp/addons/base/ir/ir_actions.py'
--- openerp/addons/base/ir/ir_actions.py 2012-08-13 07:30:13 +0000
+++ openerp/addons/base/ir/ir_actions.py 2012-08-29 09:32:23 +0000
@@ -149,6 +149,27 @@
'attachment': lambda *a: False,
}
+ def write(self, cr, uid, ids, vals, context=None):
+ """
+ If Model on report is chnaged then following code will shift the
+ model-specific action bindings on ir_values for the eixsing model
+ on report to new model of the report.
+ """
+ if 'model' in vals:
+ ir_values_pool = self.pool.get('ir.values')
+ for report in self.read(cr, uid, ids, context=context):
+ value = 'ir.actions.report.xml,%s'%(str(report['id']))
+ ir_value_ids = ir_values_pool.search(cr, uid, [('name', '=', report['name']),
+ ('value', '=', value), ('model', '=', report['model'])])
+ if ir_value_ids:
+ for ir_value in ir_values_pool.read(cr, uid, ir_value_ids, context=context):
+ new_vals = {}
+ new_vals.update({
+ 'name': report['name'], 'key2': ir_value['key2'],
+ 'value': value, 'model': vals['model']})
+ ir_values_pool.write(cr, uid, ir_value['id'], new_vals, context=context)
+ return super(report_xml, self).write(cr, uid, ids, vals, context=context)
+
report_xml()
class act_window(osv.osv):
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp