Hardik Ansodariya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-578473-han into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-578473-han/+merge/122514

Hello,

Fixed the issue of wrong invoice view from mrp_repair.

With reference of Maintenance case: 578473

Kindly review it.

Thanks,
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-578473-han/+merge/122514
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-578473-han.
=== modified file 'mrp_repair/mrp_repair_view.xml'
--- mrp_repair/mrp_repair_view.xml	2011-12-13 07:28:24 +0000
+++ mrp_repair/mrp_repair_view.xml	2012-09-03 13:27:20 +0000
@@ -158,7 +158,7 @@
                         </field>
                     </page>
                     <page string="Extra Info" groups="base.group_extended">
-                        <field name="invoice_id"/>
+                        <field name="invoice_id" context="{'form_view_ref': 'account.invoice_form'}"/>
                         <field name="picking_id"/>
                         <field name="location_id"/>
                         <field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}"/>

=== modified file 'mrp_repair/wizard/make_invoice.py'
--- mrp_repair/wizard/make_invoice.py	2012-01-31 13:36:57 +0000
+++ mrp_repair/wizard/make_invoice.py	2012-09-03 13:27:20 +0000
@@ -53,6 +53,12 @@
         for repair_id in context['active_ids']:
             wf_service.trg_validate(uid, 'mrp.repair', repair_id, 'action_invoice_create', cr)
 
+        mod_obj = self.pool.get('ir.model.data')
+        form_res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_form')
+        form_id = form_res and form_res[1] or False
+        tree_res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_tree')
+        tree_id = tree_res and tree_res[1] or False
+
         return {
             'domain': [('id','in', newinv.values())],
             'name': 'Invoices',
@@ -60,10 +66,10 @@
             'view_mode': 'tree,form',
             'res_model': 'account.invoice',
             'view_id': False,
+            'views': [(tree_id, 'tree'),(form_id, 'form')],
             'context': "{'type':'out_invoice'}",
             'type': 'ir.actions.act_window'
         }
-
 make_invoice()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

_______________________________________________
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

Reply via email to