[IMP] base, base_address_extended: usability in country form view

Following tde comments, this commit enhances the 'Advanced Address Formatting' group in country view
This commit is contained in:
qdp-odoo
2017-01-13 16:56:01 +01:00
parent 155e74a377
commit 0899e8ada3
3 changed files with 8 additions and 5 deletions
@@ -6,8 +6,9 @@
<field name="model">res.country</field>
<field name="inherit_id" ref="base.view_country_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='address_format']" position="after">
<xpath expr="//div[@name='div_address_format']" position="after">
<field name="street_format" groups="base.group_no_one" placeholder="Street format..."/>
<div colspan="2" class="text-muted">Change how the system computes the full street field based on the different street subfields</div>
</xpath>
</field>
</record>
+2 -2
View File
@@ -37,7 +37,7 @@ class Country(models.Model):
code = fields.Char(
string='Country Code', size=2,
help='The ISO country code in two chars. \nYou can use this field for quick search.')
address_format = fields.Text(
address_format = fields.Text(string="Layout in Reports",
help="Display format to use for addresses belonging to this country.\n\n"
"You can use python-style string pattern with all the fields of the address "
"(for example, use '%(street)s' to display the field 'street') plus"
@@ -47,7 +47,7 @@ class Country(models.Model):
"\n%(country_code)s: the code of the country",
default='%(street)s\n%(street2)s\n%(city)s %(state_code)s %(zip)s\n%(country_name)s')
address_view_id = fields.Many2one(
comodel_name='ir.ui.view', string="Address View",
comodel_name='ir.ui.view', string="Input View",
domain=[('model', '=', 'res.partner'), ('type', '=', 'form')],
help="Use this field if you want to replace the usual way to encode a complete address. "
"Note that the address_format field is used to modify the way to display addresses "
+4 -2
View File
@@ -32,9 +32,11 @@
<group>
<field name="phone_code"/>
</group>
<group string="Advanced Address Formatting" groups="base.group_no_one" >
<field name="address_format" placeholder="Address format..."/>
<group string="Advanced Address Formatting" groups="base.group_no_one" col="4" colspan="4">
<field name="address_view_id"/>
<div colspan="2" class="text-muted">Choose a subview of partners that includes only address fields, to change the way users can input addresses.</div>
<field name="address_format" placeholder="Address format..."/>
<div colspan="2" name="div_address_format" class="text-muted">Change the way addresses are displayed in reports</div>
</group>
</group>
<label for="state_ids"/>