From cd8bd872e85bd07da58b886dbe0ad4c8a4e6714d Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 24 Oct 2014 11:59:23 +0200 Subject: [PATCH] [IMP] res_country: add relation from country to group_country. The purpose of this patch is to allow in domain (model.country_id.country_group_ids, '=', 'Europe') --- openerp/addons/base/res/res_country.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openerp/addons/base/res/res_country.py b/openerp/addons/base/res/res_country.py index f086f1440e8..31d3d8976ea 100644 --- a/openerp/addons/base/res/res_country.py +++ b/openerp/addons/base/res/res_country.py @@ -57,6 +57,7 @@ addresses belonging to this country.\n\nYou can use the python-style string pate \n%(country_code)s: the code of the country"""), 'currency_id': fields.many2one('res.currency', 'Currency'), 'image': fields.binary("Image"), + 'country_group_ids': fields.many2many('res.country.group', 'res_country_res_country_group_rel', 'res_country_id', 'res_country_group_id', string='Country Groups'), } _sql_constraints = [ ('name_uniq', 'unique (name)', @@ -89,7 +90,7 @@ class CountryGroup(osv.osv): _name = 'res.country.group' _columns = { 'name': fields.char('Name', required=True), - 'country_ids': fields.many2many('res.country', string='Countries'), + 'country_ids': fields.many2many('res.country', 'res_country_res_country_group_rel', 'res_country_group_id', 'res_country_id', string='Countries'), } class CountryState(osv.osv):