[IMP] various: Do not allow create/open on country_id
Purpose of the task, is to prevent users from inadvertently creation/opening countries from country_id fields. Countries should be managed from their dedicated menu item. so in this commit, we have set both no_open and no_create to True so user should not update and create a country from the many2X fields. closes odoo/odoo#63773 Taskid: 2241677 Related: odoo/enterprise#15464 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<field name="name"/>
|
||||
<field name="applicability"/>
|
||||
<field name="tax_negate" attrs="{'invisible': [('applicability', '!=', 'taxes')]}"/>
|
||||
<field name="country_id" attrs="{'invisible': [('applicability', '!=', 'taxes')]}"/>
|
||||
<field name="country_id" options="{'no_open': True, 'no_create': True}" attrs="{'invisible': [('applicability', '!=', 'taxes')]}"/>
|
||||
<field name="tax_report_line_ids" attrs="{'invisible': [('applicability', '!=', 'taxes')]}"/>
|
||||
</group>
|
||||
</sheet>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<field name="states_count" invisible="1"/>
|
||||
<field name="vat_required" attrs="{'invisible': [('auto_apply', '!=', True)]}"/>
|
||||
<field name="country_group_id" attrs="{'invisible': [('auto_apply', '!=', True)]}"/>
|
||||
<field name="country_id" attrs="{'invisible': [('auto_apply', '!=', True)]}"/>
|
||||
<field name="country_id" attrs="{'invisible': [('auto_apply', '!=', True)]}" options="{'no_open': True, 'no_create': True}"/>
|
||||
<field name="state_ids" widget="many2many_tags" domain="[('country_id', '=', country_id)]"
|
||||
attrs="{'invisible': ['|', '|', ('auto_apply', '!=', True), ('country_id', '=', False), ('states_count', '=', 0)]}"/>
|
||||
<label for="zip_from" string="Zip Range"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<tree string="City" editable="top">
|
||||
<field name="name"/>
|
||||
<field name="zipcode"/>
|
||||
<field name="country_id"/>
|
||||
<field name="country_id" options="{'no_open': True, 'no_create': True}"/>
|
||||
<field name="state_id" context="{'default_country_id': country_id}"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -336,7 +336,7 @@
|
||||
<field name="company_id" groups="base.group_multi_company" optional="show"/>
|
||||
<field name="city" optional="show"/>
|
||||
<field name="state_id" optional="hide"/>
|
||||
<field name="country_id" optional="show"/>
|
||||
<field name="country_id" optional="show" options="{'no_open': True, 'no_create': True}"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="user_id" optional="show" widget="many2one_avatar_user" domain="[('share', '=', False)]"/>
|
||||
<field name="team_id" optional="show"/>
|
||||
@@ -652,7 +652,7 @@
|
||||
<field name="company_id" groups="base.group_multi_company" optional="show"/>
|
||||
<field name="city" optional="hide"/>
|
||||
<field name="state_id" optional="hide"/>
|
||||
<field name="country_id" optional="hide"/>
|
||||
<field name="country_id" optional="hide" options="{'no_open': True, 'no_create': True}"/>
|
||||
<field name="user_id" widget="many2one_avatar_user" optional="show" domain="[('share', '=', False)]"/>
|
||||
<field name="team_id" optional="show"/>
|
||||
<field name="priority" optional="hide"/>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="contact_name"/>
|
||||
<field name="country_id" invisible="context.get('invisible_country', True)"/>
|
||||
<field name="country_id" invisible="context.get('invisible_country', True)" options="{'no_open': True, 'no_create': True}"/>
|
||||
<field name="email_from"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="user_id"/>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="contact_name"/>
|
||||
<field name="country_id" invisible="context.get('invisible_country', True)"/>
|
||||
<field name="country_id" invisible="context.get('invisible_country', True)" options="{'no_open': True, 'no_create': True}"/>
|
||||
<field name="email_from"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="user_id"/>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<field name="active" widget="boolean_toggle"/>
|
||||
</group>
|
||||
<group string="Website Traffic Conditions">
|
||||
<field name="country_ids" widget="many2many_tags"/>
|
||||
<field name="country_ids" widget="many2many_tags" options="{'no_open': True, 'no_create': True}"/>
|
||||
<field name="website_id" options="{'no_open': True, 'no_create_edit': True}" groups="website.group_multi_website"/>
|
||||
<field name="state_ids" widget="many2many_tags" attrs="{'invisible': [('country_ids', '=', [])]}" domain="[('country_id', 'in', country_ids)]"/>
|
||||
<field name="regex_url" widget="website_urls" placeholder="e.g. /page"/>
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
</group>
|
||||
<group>
|
||||
<group name="country_details">
|
||||
<field name="country_ids" widget="many2many_tags"/>
|
||||
<field name="country_ids" widget="many2many_tags" options="{'no_open': True, 'no_create': True}"/>
|
||||
<field name="state_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group></group>
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
<div class="oe_inline" attrs="{'invisible': [('action', '!=', 'auto_popup')]}">
|
||||
<field name="auto_popup_timer" class="oe_inline"/> seconds
|
||||
</div>
|
||||
<field name="country_ids" widget="many2many_tags"/>
|
||||
<field name="country_ids" widget="many2many_tags" options="{'no_open': True, 'no_create': True}"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<group>
|
||||
<field name="link_id"/>
|
||||
<field name="ip"/>
|
||||
<field name="country_id"/>
|
||||
<field name="country_id" options="{'no_open': True, 'no_create': True}"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
</div>
|
||||
<field name="title_id"/>
|
||||
<field name="company_name"/>
|
||||
<field name="country_id"/>
|
||||
<field name="country_id" options="{'no_open': True, 'no_create': True}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="create_date" readonly="1"/>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<field name="qr_code" attrs="{'invisible': [('provider', '!=', 'transfer')]}"/>
|
||||
</group>
|
||||
<group string="Availability" name="availability">
|
||||
<field name="country_ids" widget="many2many_tags" placeholder="Select countries. Leave empty to use everywhere."/>
|
||||
<field name="country_ids" widget="many2many_tags" placeholder="Select countries. Leave empty to use everywhere." options="{'no_open': True, 'no_create': True}"/>
|
||||
</group>
|
||||
<group string="Payment Followup" name="payment_followup">
|
||||
<field name="journal_id" context="{'default_type': 'bank'}"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<field name="city" placeholder="City" class="o_address_city"/>
|
||||
<field name="state_id" class="o_address_state" placeholder="State" options='{"no_open": True}'/>
|
||||
<field name="zip" placeholder="ZIP" class="o_address_zip"/>
|
||||
<field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True}'/>
|
||||
<field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/>
|
||||
</div>
|
||||
<field name="vat"/>
|
||||
<field name="company_registry"/>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<h1><field name="name"/></h1>
|
||||
</div>
|
||||
<group name="country_group">
|
||||
<field name="country_ids" widget="many2many_tags"/>
|
||||
<field name="country_ids" widget="many2many_tags" options="{'no_open': True, 'no_create': True}"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
@@ -106,7 +106,7 @@
|
||||
<tree string="State" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="country_id" options="{'no_create': True}"/>
|
||||
<field name="country_id" options="{'no_create': True, 'no_open': True}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user