Browse Source

[FIX] product_m2mcategories: product.categ_id is mandatory, else it won't invoice properly. And mandatory fields are advised to stay on the first tab...

Might not look as good, but will work better this way unfortunately...
pull/186/head
Raphaël Valyi 15 years ago
committed by sebastien beau
parent
commit
c0c5a2bee5
  1. 4
      product_m2mcategories/product.py
  2. 14
      product_m2mcategories/product_view.xml

4
product_m2mcategories/product.py

@ -19,7 +19,7 @@ from osv import osv,fields
class product_product(osv.osv):
_inherit = "product.template"
_columns = {
'categ_id': fields.many2one('product.category','Pricing/Primary Category',change_default=True),
'categ_id': fields.many2one('product.category','Pricing/Primary Category', required=True, change_default=True),
'categ_ids': fields.many2many('product.category','product_categ_rel','product_id','categ_id','Product Categories')
}
product_product()
product_product()

14
product_m2mcategories/product_view.xml

@ -1,16 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="product_normal_form_view_rem_categid" model="ir.ui.view">
<field name="name">product.normal.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="type">form</field>
<field eval="7" name="priority"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/group/field[@name='categ_id']" position="replace"/>
</field>
</record>
<record id="product_normal_form_view_add_categids" model="ir.ui.view">
<field name="name">product.normal.form</field>
<field name="model">product.product</field>
@ -19,9 +9,7 @@
<field eval="7" name="priority"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page[@string='Information']" position="after">
<page string="Categorisation">
<field name="categ_id" colspan="2"/>
<newline/>
<page string="Extra Categories">
<separator string="Classification Categories" colspan="2"/>
<newline/>
<field name="categ_ids" nolabel="1" colspan="2"/>

Loading…
Cancel
Save