[FIX] purchase_requisition: change active_id to tender_id in widget context
authorCedric Snauwaert <csn@openerp.com>
Wed, 15 Oct 2014 12:47:09 +0000 (14:47 +0200)
committerCedric Snauwaert <csn@openerp.com>
Wed, 15 Oct 2014 12:47:13 +0000 (14:47 +0200)
this is due to commit 6ed774de614a2977a8d186a14ef2cd45a76e7a2e and a37bad205b13cec4f19f8e84e28801278e3e36ca which removes the active_id from context if the target==curent which is the case of this widget, we therefore can not use active_id here.

fix #2385

addons/purchase_requisition/purchase_requisition.py
addons/purchase_requisition/static/src/js/web_addons.js

index 2c6c620..5af69a6 100644 (file)
@@ -115,6 +115,7 @@ class purchase_requisition(osv.osv):
         res['context'] = {
             'search_default_groupby_product': True,
             'search_default_hide_cancelled': True,
+            'tender_id': ids[0],
         }
         res['domain'] = [('id', 'in', [line.id for line in po_lines])]
         return res
index 693df43..7b58feb 100644 (file)
@@ -19,7 +19,7 @@ openerp.purchase_requisition = function(instance) {
         },
         generate_purchase_order: function () {
             var self = this;
-            new instance.web.Model(self.dataset.model).call("generate_po",[self.dataset.context.active_id,self.dataset.context]).then(function(result) {
+            new instance.web.Model(self.dataset.model).call("generate_po",[self.dataset.context.tender_id,self.dataset.context]).then(function(result) {
                 self.ViewManager.ActionManager.history_back();
             });
         },