[FIX] base_address_city: add missing placeholder
for city and city_id fields To be consistent with the other fields Closes #23662
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.saas~18\n"
|
||||
"Project-Id-Version: Odoo Server 11.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-09-20 09:52+0000\n"
|
||||
"PO-Revision-Date: 2017-09-20 09:52+0000\n"
|
||||
"POT-Creation-Date: 2018-03-15 07:58+0000\n"
|
||||
"PO-Revision-Date: 2018-03-15 07:58+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -29,17 +29,14 @@ msgid "Cities"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_address_city
|
||||
#: code:addons/base_address_city/models/res_partner.py:36
|
||||
#: model:ir.model,name:base_address_city.model_res_city
|
||||
#: model:ir.model.fields,field_description:base_address_city.field_res_city_country_id
|
||||
#: model:ir.ui.view,arch_db:base_address_city.view_city_filter
|
||||
#: model:ir.ui.view,arch_db:base_address_city.view_city_tree
|
||||
msgid "City"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_address_city
|
||||
#: model:ir.model.fields,field_description:base_address_city.field_res_partner_city_id
|
||||
#: model:ir.model.fields,field_description:base_address_city.field_res_users_city_id
|
||||
msgid "Company"
|
||||
#: model:ir.ui.view,arch_db:base_address_city.view_city_filter
|
||||
#: model:ir.ui.view,arch_db:base_address_city.view_city_tree
|
||||
#, python-format
|
||||
msgid "City"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_address_city
|
||||
@@ -49,6 +46,7 @@ msgstr ""
|
||||
|
||||
#. module: base_address_city
|
||||
#: model:ir.model,name:base_address_city.model_res_country
|
||||
#: model:ir.model.fields,field_description:base_address_city.field_res_city_country_id
|
||||
msgid "Country"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
from lxml import etree
|
||||
|
||||
from odoo import api, models, fields
|
||||
from odoo.tools.translate import _
|
||||
|
||||
|
||||
class Partner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
@@ -28,10 +30,10 @@ class Partner(models.Model):
|
||||
replacement_xml = """
|
||||
<div>
|
||||
<field name="country_enforce_cities" invisible="1"/>
|
||||
<field name='city' attrs="{'invisible': [('country_enforce_cities', '=', True), ('city_id', '!=', False)], 'readonly': [('type', '=', 'contact'), ('parent_id', '!=', False)]}"/>
|
||||
<field name='city_id' attrs="{'invisible': [('country_enforce_cities', '=', False)], 'readonly': [('type', '=', 'contact'), ('parent_id', '!=', False)]}" context="{'default_country_id': country_id}" domain="[('country_id', '=', country_id)]"/>
|
||||
<field name='city' placeholder="%s" attrs="{'invisible': [('country_enforce_cities', '=', True), ('city_id', '!=', False)], 'readonly': [('type', '=', 'contact'), ('parent_id', '!=', False)]}"/>
|
||||
<field name='city_id' placeholder="%s" attrs="{'invisible': [('country_enforce_cities', '=', False)], 'readonly': [('type', '=', 'contact'), ('parent_id', '!=', False)]}" context="{'default_country_id': country_id}" domain="[('country_id', '=', country_id)]"/>
|
||||
</div>
|
||||
"""
|
||||
""" % (_('City'), _('City'))
|
||||
city_id_node = etree.fromstring(replacement_xml)
|
||||
city_node.getparent().replace(city_node, city_id_node)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user