From ad9dc8fe80dd66d49919055f42439f3a9b325eb9 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Tue, 29 Nov 2016 15:20:35 -0600 Subject: [PATCH] domain (#345) --- partner_contact_weight/__openerp__.py | 6 +++--- partner_contact_weight/models/res_partner.py | 10 ++++++---- .../views/res_partner_view.xml | 20 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/partner_contact_weight/__openerp__.py b/partner_contact_weight/__openerp__.py index 2d44a74a2..d028261b0 100644 --- a/partner_contact_weight/__openerp__.py +++ b/partner_contact_weight/__openerp__.py @@ -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, diff --git a/partner_contact_weight/models/res_partner.py b/partner_contact_weight/models/res_partner.py index cace548f1..5c1f2e30b 100644 --- a/partner_contact_weight/models/res_partner.py +++ b/partner_contact_weight/models/res_partner.py @@ -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) + ] + ) diff --git a/partner_contact_weight/views/res_partner_view.xml b/partner_contact_weight/views/res_partner_view.xml index 42a3fbbad..b2027348a 100644 --- a/partner_contact_weight/views/res_partner_view.xml +++ b/partner_contact_weight/views/res_partner_view.xml @@ -6,17 +6,15 @@ res.partner - - - - + +