@ -4,9 +4,9 @@
{
"name": "Partner Contact Weight",
"summary": "Provide contact weight",
"version": "9.0.1.0.0",
"category": "Uncategorized",
"website": "https://ursainfosystems.com",
"version": "9.0.1.0.1",
"category": "Health",
"website": "http://ursainfosystems.com",
"author": "Ursa Information Systems, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
@ -10,7 +10,9 @@ class ResPartner(models.Model):
_inherit = 'res.partner'
weight = fields.Float("Weight")
weight_uom = fields.Many2one("product.uom", "Weight UoM",
domain="[('category_id', '=', "
"self.env.ref('product.\
product_uom_categ_kgm').id)]")
weight_uom = fields.Many2one(
"product.uom", "Weight UoM",
domain=lambda self: [('category_id', '=',
self.env.ref('product.product_uom_categ_kgm').id)
]
)
@ -6,17 +6,15 @@
<field name="model">res.partner</field>
<field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/>
<field name="arch" type="xml">
<data>
<xpath expr="//page[@name='personal_information_page']/group[@name='personal_information_group']">
<label for="weight"/>
<div>
<field name='weight' class="oe_inline"/>
<field name='weight_uom'
class="oe_inline"
placeholder="UoM"/>
</div>
</xpath>
</data>
</field>
</record>