mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[UPD] web_m2x_options_manager: Add option to prevent Create/Edit wizard to pop up
This commit is contained in:
@@ -77,6 +77,13 @@ class M2xCreateEditOption(models.Model):
|
||||
string="Create & Edit Option",
|
||||
)
|
||||
|
||||
option_create_edit_wizard = fields.Boolean(
|
||||
default=True,
|
||||
help="Defines behaviour for 'Create & Edit' Wizard\n"
|
||||
"Set to False to prevent 'Create & Edit' Wizard to pop up",
|
||||
string="Create & Edit Wizard",
|
||||
)
|
||||
|
||||
_sql_constraints = [
|
||||
(
|
||||
"model_field_uniqueness",
|
||||
@@ -142,6 +149,9 @@ class M2xCreateEditOption(models.Model):
|
||||
if mode == "force" or k not in options:
|
||||
options[k] = val == "true"
|
||||
node.set("options", str(options))
|
||||
if not self.option_create_edit_wizard:
|
||||
node.set("can_create", "false")
|
||||
node.set("can_write", "false")
|
||||
|
||||
@api.model
|
||||
def get(self, model_name, field_name):
|
||||
|
||||
Reference in New Issue
Block a user