I don't want to add uom on product attribute line but on product attribute (because uom is the same for each attribute line). To do that I had already code py file:
# -*- coding: utf-8 -*-
from openerp import models, fields
class ProductAttribute(models.Model):
_name = 'product.attribute'
_inherit = 'product.attribute'
uom_id = fields.Many2one('product.uom', 'Unit of Measure')
and the follow xml code:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Unit of Measure on Attributes Configuration -->
<record id="attribute_uom_tree_view" model="ir.ui.view">
<field name="name">product.attribute.tree.type</field>
<field name="model">product.attribute</field>
<field name="inherit_id" ref="product.attribute_tree_view"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="uom_id"/>
</field>
</field>
</record>
</data>
</openerp>
Now (in my understand of odoo) I need to find the page which display the table and add the column on tree view.
[edit 21 nov]
Finally I have found the solution. Add model relation:
class ProductAttributeLine(models.Model):
_inherit = 'product.attribute.line' uom_id = fields.Many2one(related='attribute_id.uom_id', string='Unit of Measure', store=False, readonly=True)
<record id="product_variant_list_view" model="ir.ui.view"> <field name="name">product.template.variant.form</field> <field name="model">product.template</field> <field name="type">form</field> <field name="inherit_id" ref="product.product_template_only_form_view" /> <field name="arch" type="xml"> <field name="value_ids" position="after"> <field name="uom_id" /> </field> </field> </record>