Skip to content

Commit

Permalink
[IMP] res_country: add relation from country to group_country. The pu…
Browse files Browse the repository at this point in the history
…rpose of this patch is to allow in domain (model.country_id.country_group_ids, '=', 'Europe')
  • Loading branch information
JKE-be committed Oct 24, 2014
1 parent 23f9736 commit cd8bd87
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openerp/addons/base/res/res_country.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Country(osv.osv):
\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)',
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit cd8bd87

Please sign in to comment.