[FIX] point_of_sale: On product form : push on button 'Set a Custom Ean' on tab information raise an exception => Use a record action and clean python files
This commit is contained in:
parent
87a20d1cc3
commit
7efe3bb2d8
|
@ -1379,16 +1379,4 @@ class product_template(osv.osv):
|
||||||
'available_in_pos': True,
|
'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:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -523,6 +523,13 @@
|
||||||
<menuitem action="product_pos_category_action" id="menu_product_pos_category" parent="menu_point_of_sale_product" sequence="0" />
|
<menuitem action="product_pos_category_action" id="menu_product_pos_category" parent="menu_point_of_sale_product" sequence="0" />
|
||||||
<!-- END -->
|
<!-- 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">
|
<record id="product_template_form_view" model="ir.ui.view">
|
||||||
<field name="name">product.template.form.inherit</field>
|
<field name="name">product.template.form.inherit</field>
|
||||||
|
@ -539,7 +546,7 @@
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<field name="ean13" position="after">
|
<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>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
@ -18,18 +18,6 @@ class res_users(osv.osv):
|
||||||
for user in self.browse(cr, uid, ids, context=context)
|
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 = [
|
_constraints = [
|
||||||
(_check_ean, "Error: Invalid ean code", ['ean13'],),
|
(_check_ean, "Error: Invalid ean code", ['ean13'],),
|
||||||
]
|
]
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<page string="Point of Sale">
|
<page string="Point of Sale">
|
||||||
<group>
|
<group>
|
||||||
<field name="ean13" />
|
<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>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
|
|
|
@ -19,18 +19,6 @@ class res_users(osv.osv):
|
||||||
for user in self.browse(cr, uid, ids, context=context)
|
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 = [
|
_constraints = [
|
||||||
(_check_ean, "Error: Invalid ean code", ['ean13'],),
|
(_check_ean, "Error: Invalid ean code", ['ean13'],),
|
||||||
]
|
]
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<group>
|
<group>
|
||||||
<field name="pos_config" />
|
<field name="pos_config" />
|
||||||
<field name="ean13" />
|
<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>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
|
|
Loading…
Reference in New Issue