[FIX] point_of_sale: On product form : push on button 'Set a Custom Ean' on tab infor...
authorChristophe Matthieu <chm@odoo.com>
Thu, 31 Jul 2014 15:21:26 +0000 (17:21 +0200)
committerChristophe Matthieu <chm@odoo.com>
Thu, 31 Jul 2014 15:21:26 +0000 (17:21 +0200)
addons/point_of_sale/point_of_sale.py
addons/point_of_sale/point_of_sale_view.xml
addons/point_of_sale/res_partner.py
addons/point_of_sale/res_partner_view.xml
addons/point_of_sale/res_users.py
addons/point_of_sale/res_users_view.xml

index c8cf81d..7ba4bb9 100644 (file)
@@ -1379,16 +1379,4 @@ class product_template(osv.osv):
         'available_in_pos': True,
     }
 
-    def edit_ean(self, cr, uid, ids, context):
-        return {
-            'name': _("Assign a Custom EAN"),
-            'type': 'ir.actions.act_window',
-            'view_type': 'form',
-            'view_mode': 'form',
-            'res_model': 'pos.ean_wizard',
-            'target' : 'new',
-            'view_id': False,
-            'context':context,
-        }
-
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 559fff5..7f43484 100644 (file)
         <menuitem action="product_pos_category_action" id="menu_product_pos_category" parent="menu_point_of_sale_product" sequence="0" />
         <!-- END -->
 
+        <record id="action_edit_ean" model="ir.actions.act_window">
+            <field name="name">Edit Ean</field>
+            <field name="res_model">pos.ean_wizard</field>
+            <field name="target">new</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+        </record>
 
         <record id="product_template_form_view" model="ir.ui.view">
             <field name="name">product.template.form.inherit</field>
                     </group>
                 </group>
                 <field name="ean13" position="after">
-                    <button colspan="2" name="edit_ean" type="object" string="Set a Custom EAN" class="oe_link oe_edit_only"/>
+                    <button colspan="2" name="%(action_edit_ean)d" type="action" string="Set a Custom EAN" class="oe_link oe_edit_only"/>
                 </field>
             </field>
         </record>
index d7969b0..87ca525 100644 (file)
@@ -18,18 +18,6 @@ class res_users(osv.osv):
             for user in self.browse(cr, uid, ids, context=context)
         )
 
-    def edit_ean(self, cr, uid, ids, context):
-        return {
-            'name': "Edit Ean",
-            'type': 'ir.actions.act_window',
-            'view_type': 'form',
-            'view_mode': 'form',
-            'res_model': 'pos.ean_wizard',
-            'target' : 'new',
-            'view_id': False,
-            'context':context,
-        }
-
     _constraints = [
         (_check_ean, "Error: Invalid ean code", ['ean13'],),
     ]
index 4bd433a..f1aecca 100644 (file)
@@ -11,7 +11,7 @@
                     <page string="Point of Sale"> 
                         <group>
                             <field name="ean13" />
-                            <button name="edit_ean" type="object" string="Edit" />
+                            <button name="%(action_edit_ean)d" type="action" string="Set a Custom EAN" />
                         </group>
                     </page>
                 </notebook>
index ed2c6fa..9198e33 100644 (file)
@@ -19,18 +19,6 @@ class res_users(osv.osv):
             for user in self.browse(cr, uid, ids, context=context)
         )
 
-    def edit_ean(self, cr, uid, ids, context):
-        return {
-            'name': "Edit EAN",
-            'type': 'ir.actions.act_window',
-            'view_type': 'form',
-            'view_mode': 'form',
-            'res_model': 'pos.ean_wizard',
-            'target' : 'new',
-            'view_id': False,
-            'context':context,
-        }
-
     _constraints = [
         (_check_ean, "Error: Invalid ean code", ['ean13'],),
     ]
index 11d3732..03f3c98 100644 (file)
@@ -23,7 +23,7 @@
                     <group>
                         <field name="pos_config" />
                         <field name="ean13" />
-                        <button name="edit_ean" type="object" string="Edit EAN" class="oe_edit_only" />
+                        <button name="%(action_edit_ean)d" type="action" string="Set a Custom EAN" class="oe_edit_only" />
                     </group>
                 </page>
             </notebook>