Merge lp:~syleam/openobject-addons/6.1-bug-1041171-mrp_repair_invoice into lp:openobject-addons/6.1

Proposed by Christophe CHAUVET
Status: Needs review
Proposed branch: lp:~syleam/openobject-addons/6.1-bug-1041171-mrp_repair_invoice
Merge into: lp:openobject-addons/6.1
Diff against target: 26 lines (+9/-3)
1 file modified
mrp_repair/wizard/make_invoice.py (+9/-3)
To merge this branch: bzr merge lp:~syleam/openobject-addons/6.1-bug-1041171-mrp_repair_invoice
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+121179@code.launchpad.net

Description of the change

Fix wrong view when invoice generated from the repair order

To post a comment you must log in.

Unmerged revisions

6961. By Christophe CHAUVET

[FIX] Wrong view opened when invoice generated from repair order

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mrp_repair/wizard/make_invoice.py'
2--- mrp_repair/wizard/make_invoice.py 2012-01-31 13:36:57 +0000
3+++ mrp_repair/wizard/make_invoice.py 2012-08-24 13:16:57 +0000
4@@ -53,13 +53,19 @@
5 for repair_id in context['active_ids']:
6 wf_service.trg_validate(uid, 'mrp.repair', repair_id, 'action_invoice_create', cr)
7
8+ model_obj = self.pool.get('ir.model.data')
9+ account_invoice_form_id = model_obj.get_object_reference(cr, uid, 'account', 'invoice_form')[1]
10+ account_invoice_tree_id = model_obj.get_object_reference(cr, uid, 'account', 'invoice_tree')[1]
11+
12 return {
13- 'domain': [('id','in', newinv.values())],
14- 'name': 'Invoices',
15+ 'domain': [('id', 'in', newinv.values())],
16+ 'name': 'Repair Invoices',
17 'view_type': 'form',
18- 'view_mode': 'tree,form',
19+ 'view_mode': 'form,tree',
20 'res_model': 'account.invoice',
21 'view_id': False,
22+ 'views': [(account_invoice_tree_id, 'tree'), (account_invoice_form_id, 'form')],
23+ 'target': 'current',
24 'context': "{'type':'out_invoice'}",
25 'type': 'ir.actions.act_window'
26 }