[IMP] res_country: add one2many for states and phone prefix

This commit is contained in:
Jeremy Kersten
2015-06-10 21:46:04 +02:00
parent 3315aeef1f
commit 48a0263397
3 changed files with 761 additions and 508 deletions
+2
View File
@@ -43,7 +43,9 @@ 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"),
'phone_prefix': fields.integer('Phone Prefix'),
'country_group_ids': fields.many2many('res.country.group', 'res_country_res_country_group_rel', 'res_country_id', 'res_country_group_id', string='Country Groups'),
'state_ids': fields.one2many('res.country.state', 'country_id', string='States'),
}
_sql_constraints = [
('name_uniq', 'unique (name)',
File diff suppressed because it is too large Load Diff
+7 -4
View File
@@ -27,13 +27,16 @@
<group>
<field name="name"/>
<field name="currency_id"/>
</group>
<group>
<field name="code"/>
</group>
<group>
<field name="address_format" groups="base.group_no_one" placeholder="Address format..."/>
<field name="phone_prefix"/>
</group>
</group>
<label for="address_format"/>
<field name="address_format" groups="base.group_no_one" placeholder="Address format..."/>
<label for="state_ids"/>
<field name="state_ids"/>
</form>
</field>
</record>