diff options
| author | Jeremy Kersten <jke@odoo.com> | 2014-10-24 11:59:23 +0200 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2014-10-24 15:19:34 +0200 |
| commit | cd8bd872e85bd07da58b886dbe0ad4c8a4e6714d (patch) | |
| tree | 9a1e6eff59bb22226570071d9b71ad009da96ce3 | |
| parent | 23f9736372bd3d4657d493c634beab2232847249 (diff) | |
[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')
| -rw-r--r-- | openerp/addons/base/res/res_country.py | 3 |
1 files changed, 2 insertions, 1 deletions
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): |
