Merge lp:~openerp-dev/openobject-addons/6.1-opw-574709-msh into lp:openobject-addons/6.1

Proposed by Mohammed Shekha(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-574709-msh
Merge into: lp:openobject-addons/6.1
Diff against target: 35 lines (+5/-3)
2 files modified
pad/ir_attachment.py (+2/-2)
pad/static/src/js/pad.js (+3/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-574709-msh
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+107734@code.launchpad.net

Description of the change

Hello,

Fixed the issue of pad as it not working in 6.1, currently it calls pad_get method of current model instead of ir.attachment, also when pad added it does not return anything so do_action will not do anything, hence return type: ir.action.act_url.

Demo :- Install Pad module and open any view and select the record or open any existing record, and click on Add Pad link, it will give traceback that the model doesn't have pad_get method.

The branch will fix this issue.

Thanks.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Not Relevant on Trunk (means that architecture on trunk has changed and so this bug has no meaning anymore). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6816. By Mohammed Shekha(Open ERP)

[FIX]Fixed the issue of pad as it not working in 6.1, currently calls pad_get method of current model instead of ir.attachment, also when pad added it does not return anything so do_action will not do anything, hence return type: ir.action.act_url.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pad/ir_attachment.py'
2--- pad/ir_attachment.py 2011-12-19 16:54:40 +0000
3+++ pad/ir_attachment.py 2012-05-29 08:39:20 +0000
4@@ -19,7 +19,7 @@
5 }
6 return pad_url_template % template_vars
7
8- def pad_get(self, cr, uid, model, id):
9+ def pad_get(self, cr, uid, model, id, context=None):
10 attachment = self.search(cr, uid, [('res_model', '=', model), ('res_id', '=', id), ('type', '=', 'url'), ('name', '=', 'Pad')])
11 if attachment:
12 return self.read(cr, uid, attachment)[0]['url']
13@@ -32,6 +32,6 @@
14 'name' : 'Pad',
15 'url' : url,
16 })
17- return url
18+ return {'type':'ir.actions.act_url','url': url}
19
20 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
21
22=== modified file 'pad/static/src/js/pad.js'
23--- pad/static/src/js/pad.js 2011-11-10 10:21:53 +0000
24+++ pad/static/src/js/pad.js 2012-05-29 08:39:20 +0000
25@@ -18,7 +18,9 @@
26 var self = this;
27 var $padbtn = this.$element.find('button.pad');
28 $padbtn.attr('disabled', 'true').find('img, span').toggle();
29- this.view.dataset.call_button('pad_get', [[this.view.datarecord.id], this.view.dataset.get_context()], function(r) {
30+ dataset = new instance.web.DataSetSearch(
31+ this, 'ir.attachment', this.view.dataset.get_context(),this.view.dataset.domain);
32+ dataset.call_button('pad_get', [this.view.dataset.model, this.view.datarecord.id, this.view.dataset.get_context()], function(r) {
33 $padbtn.hide();
34 self.do_update();
35 self.do_action(r.result);