[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')

This commit is contained in:
Jeremy Kersten 2014-10-24 11:59:23 +02:00
parent 23f9736372
commit cd8bd872e8
1 changed files with 2 additions and 1 deletions

View File

@ -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):