'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:
<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>
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'],),
]
<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>
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'],),
]
<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>