Browse Source

[S0011C] add menu to manage label + field active

pull/15/head
tfrancoi 8 years ago
committed by Thibault Francois
parent
commit
55bef1a484
  1. 1
      beesdoo_product/models/beesdoo_product.py
  2. 23
      beesdoo_product/views/beesdoo_product.xml

1
beesdoo_product/models/beesdoo_product.py

@ -90,6 +90,7 @@ class BeesdooProductLabel(models.Model):
name = fields.Char() name = fields.Char()
type = fields.Selection([('eco', 'Écologique'), ('local', 'Local'), ('fair', 'Équitable'), ('delivery', 'Distribution')]) type = fields.Selection([('eco', 'Écologique'), ('local', 'Local'), ('fair', 'Équitable'), ('delivery', 'Distribution')])
color_code = fields.Char() color_code = fields.Char()
active = fields.Boolean(default=True)
class BeesdooProductCategory(models.Model): class BeesdooProductCategory(models.Model):
_inherit = "product.category" _inherit = "product.category"

23
beesdoo_product/views/beesdoo_product.xml

@ -65,11 +65,25 @@
<field name="name" /> <field name="name" />
<field name="type" /> <field name="type" />
<field name="color_code" /> <field name="color_code" />
<field name="active" />
</group> </group>
</form> </form>
</field> </field>
</record> </record>
<record model="ir.ui.view" id="beesdoo_product_label_tree">
<field name="name">bees.product.label.tree</field>
<field name="model">beesdoo.product.label</field>
<field name="arch" type="xml">
<tree editable="Top">
<field name="name" />
<field name="type" />
<field name="color_code" />
<field name="active" />
</tree>
</field>
</record>
<record model="ir.ui.view" id="beesdoo_product_category_list"> <record model="ir.ui.view" id="beesdoo_product_category_list">
<field name="name">beesdoo.product.category.list</field> <field name="name">beesdoo.product.category.list</field>
<field name="model">product.category</field> <field name="model">product.category</field>
@ -102,4 +116,13 @@
</field> </field>
</field> </field>
</record> </record>
<record model="ir.actions.act_window" id="action_labels">
<field name="name">Product Labels</field>
<field name="res_model">beesdoo.product.label</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="label_configuration_menu" name="Labels" parent="product.prod_config_main"
action="action_labels" sequence="20"/>
</odoo> </odoo>
Loading…
Cancel
Save