- added a is_only_child field on product.product, telling whether the product is the only child of the product.template - improved the product form view, to set readonly all fields coming fgrom the template when the product is not the only child. This way, the user is more aware that changing a value in the template changes the value for all child products. He will have to do those changes on the template form. A link to the template has been added in the product form view. bzr revid: tde@openerp.com-20140122095826-8k0wl7af57iiyify
73 lines
3.8 KiB
XML
73 lines
3.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<openerp>
|
|
<data>
|
|
<record id="product_normal_form_view" model="ir.ui.view">
|
|
<field name="name">product.normal.form.inherit</field>
|
|
<field name="model">product.product</field>
|
|
<field name="priority">5</field>
|
|
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
|
<field name="arch" type="xml">
|
|
<notebook position="inside">
|
|
<page string="Accounting" groups="account.group_account_invoice">
|
|
<group name="properties">
|
|
<group>
|
|
<field name="property_account_income" domain="[('type','=','other')]" groups="account.group_account_user"
|
|
attrs="{'readonly': [('is_only_child', '=', False)]}"/>
|
|
<field name="taxes_id" colspan="2" widget="many2many_tags"
|
|
attrs="{'readonly':[ '|', ('sale_ok','=',0), ('is_only_child', '=', False)]}"/>
|
|
</group>
|
|
<group>
|
|
<field name="property_account_expense" domain="[('type','=','other')]" groups="account.group_account_user"
|
|
attrs="{'readonly': [('is_only_child', '=', False)]}"/>
|
|
<field name="supplier_taxes_id" colspan="2" widget="many2many_tags"
|
|
attrs="{'readonly': [('is_only_child', '=', False)]}"/>
|
|
</group>
|
|
</group>
|
|
</page>
|
|
</notebook>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="product_template_form_view" model="ir.ui.view">
|
|
<field name="name">product.template.product.form.inherit</field>
|
|
<field name="model">product.template</field>
|
|
<field name="inherit_id" ref="product.product_template_form_view"/>
|
|
<field name="arch" type="xml">
|
|
<notebook position="inside">
|
|
<page string="Accounting">
|
|
<group name="properties">
|
|
<group>
|
|
<field name="property_account_income" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
|
<field name="taxes_id" colspan="2" widget="many2many_tags"/>
|
|
</group>
|
|
<group>
|
|
<field name="property_account_expense" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
|
<field name="supplier_taxes_id" colspan="2" widget="many2many_tags"/>
|
|
</group>
|
|
</group>
|
|
</page>
|
|
</notebook>
|
|
</field>
|
|
</record>
|
|
|
|
|
|
|
|
<record id="view_category_property_form" model="ir.ui.view">
|
|
<field name="name">product.category.property.form.inherit</field>
|
|
<field name="model">product.category</field>
|
|
<field name="inherit_id" ref="product.product_category_form_view"/>
|
|
<field name="arch" type="xml">
|
|
<data>
|
|
<xpath expr="//group[@name='parent']" position="inside">
|
|
<group name="account_property" string="Account Properties" colspan="2">
|
|
<field name="property_account_income_categ" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
|
<field name="property_account_expense_categ" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
|
</group>
|
|
</xpath>
|
|
</data>
|
|
</field>
|
|
</record>
|
|
|
|
</data>
|
|
</openerp>
|