[FIX] product: disable company creation via list view

List of companies is a quite delicate configuration, which must be done by Admin
via`Settings > Companies` menu. Inline creation should be always disabled for
`company_id` field. Few such cases were presented probably because of
ambiguous setting name `no_create_edit`: it disabled "Create & Edit" button, but not
"Create" button.

STEPS:

-Go to Sales -> Products and go to the List view.
-Select one Product and try to change their Company
-You'll be able create a new company.

opw-2861853

closes odoo/odoo#92453

X-original-commit: 73e6d2250b2bf15d757f0333f8f014bd8a9895cb
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
This commit is contained in:
Ivan Yelizariev
2022-05-31 10:04:07 +02:00
parent fd521e8d39
commit 09417b6ae0
3 changed files with 3 additions and 3 deletions
@@ -81,7 +81,7 @@
<field name="date_start" optional="show"/>
<field name="date_end" optional="show"/>
<field name="applied_on" invisible="1"/>
<field name="company_id" groups="base.group_multi_company" optional="show" options="{'no_create_edit':1, 'no_open': 1}"/>
<field name="company_id" groups="base.group_multi_company" optional="show" options="{'no_create':1, 'no_open': 1}"/>
</tree>
</field>
</record>
@@ -17,7 +17,7 @@
<field name="default_code" optional="show"/>
<field name="product_tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" optional="show"/>
<field name="barcode" optional="hide" attrs="{'readonly': [('product_variant_count', '>', 1)]}"/>
<field name="company_id" options="{'no_create_edit': True}"
<field name="company_id" options="{'no_create': True}"
groups="base.group_multi_company" optional="hide"/>
<field name="list_price" string="Sales Price" widget='monetary' options="{'currency_field': 'currency_id'}" optional="show" decoration-muted="not sale_ok"/>
<field name="standard_price" widget='monetary' options="{'currency_field': 'cost_currency_id'}" optional="show" readonly="1"/>
+1 -1
View File
@@ -645,7 +645,7 @@
<field name="display_name" string="Name" class="font-weight-bold"/>
<field name="partner_id" optional="show" string="Customer"/>
<field name="privacy_visibility" optional="hide"/>
<field name="company_id" optional="show" groups="base.group_multi_company" options="{'no_create': True, 'no_create_edit': True}"/>
<field name="company_id" optional="show" groups="base.group_multi_company" options="{'no_create': True, 'no_create': True}"/>
<field name="analytic_account_id" optional="hide" groups="analytic.group_analytic_accounting"/>
<field name="date_start" string="Start Date" widget="daterange" options="{'related_end_date': 'date'}"/>
<field name="date" string="End Date" widget="daterange" options="{'related_start_date': 'date_start'}"/>