diff options
| author | Julien Castiaux <juc@odoo.com> | 2019-11-27 13:36:31 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2020-03-24 06:43:44 +0000 |
| commit | a5df7552842564b649ce2930ec302018ed18f534 (patch) | |
| tree | d935b70dfb324b3feb9cd0f08f738e48659f07ea | |
| parent | 3ea6180f182d6ea06b963fe437be05b380f1ee46 (diff) | |
[FIX] base: apply changes on inherited view
Commit 60106cf2 (task 2082503) introduced some changes on server
actions and automated actions, some changes were applied on server
actions but via the base_automation inherited view.
This commit move those change so they are directly applied on the server
action form view.
closes odoo/odoo#40964
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
| -rw-r--r-- | addons/base_automation/views/base_automation_view.xml | 19 | ||||
| -rw-r--r-- | odoo/addons/base/models/ir_actions.py | 6 | ||||
| -rw-r--r-- | odoo/addons/base/views/ir_actions_views.xml | 16 |
3 files changed, 15 insertions, 26 deletions
diff --git a/addons/base_automation/views/base_automation_view.xml b/addons/base_automation/views/base_automation_view.xml index 0ace9a48dc9..557883e26e8 100644 --- a/addons/base_automation/views/base_automation_view.xml +++ b/addons/base_automation/views/base_automation_view.xml @@ -14,13 +14,6 @@ </xpath> <xpath expr="//button[@name='run']" position="replace"> </xpath> - <xpath expr="//field[@name='model_id']" position='attributes'> - <attribute name="options">{'no_create': True}</attribute> - </xpath> - <xpath expr="//field[@name='crud_model_id']" position='attributes'> - <attribute name="string">Target Model</attribute> - <attribute name="options">{'no_create': True}</attribute> - </xpath> <xpath expr="//field[@name='partner_ids']" position='attributes'> <attribute name="options">{'no_create': True}</attribute> </xpath> @@ -30,18 +23,6 @@ <xpath expr="//field[@name='template_id']" position='attributes'> <attribute name="context">{'default_model_id': model_id}</attribute> </xpath> - <xpath expr="//field[@name='col1']" position='attributes'> - <attribute name="options">{'no_create':True'}</attribute> - </xpath> - <xpath expr="//field[@name='resource_ref']" position='attributes'> - <attribute name="options">{'hide_model': True, 'no_create' : True}</attribute> - </xpath> - <xpath expr="//field[@name='value']" position='attributes'> - <attribute name="attrs">{'readonly': ['|', ('evaluation_type', '=', 'reference'), ('col1', '=', False)]}</attribute> - </xpath> - <xpath expr="//field[@name='link_field_id']" position='attributes'> - <attribute name="string">Link Field</attribute> - </xpath> <xpath expr="//page[@name='security']" position='attributes'> <attribute name='invisible'>1</attribute> </xpath> diff --git a/odoo/addons/base/models/ir_actions.py b/odoo/addons/base/models/ir_actions.py index 7a36e2423e9..a3c7c4857ca 100644 --- a/odoo/addons/base/models/ir_actions.py +++ b/odoo/addons/base/models/ir_actions.py @@ -389,10 +389,10 @@ class IrActionsServer(models.Model): child_ids = fields.Many2many('ir.actions.server', 'rel_server_actions', 'server_id', 'action_id', string='Child Actions', help='Child server actions that will be executed. Note that the last return returned action value will be used as global return value.') # Create - crud_model_id = fields.Many2one('ir.model', string='Create/Write Target Model', + crud_model_id = fields.Many2one('ir.model', string='Target Model', help="Model for record creation / update. Set this field only to specify a different model than the base model.") - crud_model_name = fields.Char(related='crud_model_id.model', string='Target Model', readonly=True) - link_field_id = fields.Many2one('ir.model.fields', string='Link using field', + crud_model_name = fields.Char(related='crud_model_id.model', string='Target Model Name', readonly=True) + link_field_id = fields.Many2one('ir.model.fields', string='Link Field', help="Provide the field used to link the newly created record " "on the record used by the server action.") fields_lines = fields.One2many('ir.server.object.lines', 'server_id', string='Value Mapping', copy=True) diff --git a/odoo/addons/base/views/ir_actions_views.xml b/odoo/addons/base/views/ir_actions_views.xml index 491e5a534a0..4de186e287f 100644 --- a/odoo/addons/base/views/ir_actions_views.xml +++ b/odoo/addons/base/views/ir_actions_views.xml @@ -266,13 +266,14 @@ </div> <group name="action_wrapper"> <group name="action_content"> - <field name="model_id"/> + <field name="model_id" options="{'no_create': True}"/> <field name="model_name" invisible="1"/> </group> <group> <field name="state"/> <field name="type" invisible="1"/> <field name="crud_model_id" + options="{'no_create': True}" attrs="{'invisible': [('state', '!=', 'object_create')], 'required': [('state', '=', 'object_create')]}"/> <field name="crud_model_name" invisible="1"/> <field name="link_field_id" @@ -295,10 +296,17 @@ </p> <field name="fields_lines"> <tree string="Field Mappings" editable="bottom"> - <field name="col1" domain="['|', ('model_id', '=', parent.crud_model_id), ('model_id', '=', parent.model_id)]"/> + <field name="col1" + options="{'no_create': True}" + domain="['|', ('model_id', '=', parent.crud_model_id), ('model_id', '=', parent.model_id)]"/> <field name="evaluation_type"/> - <field name="resource_ref" attrs="{'readonly': [('evaluation_type', '!=', 'reference')]}" options="{'hide_model': True}"/> - <field name="value" attrs="{'readonly': [('evaluation_type', '=', 'reference')]}" force_save="1"/> + <field name="resource_ref" + options="{'hide_model': True, 'no_create': True}" + attrs="{'readonly': [('evaluation_type', '!=', 'reference')]}"/> + <field name="value" + attrs="{'readonly': [('evaluation_type', '=', 'reference')]}" + options="{'no_create': True}" + force_save="1"/> </tree> </field> </page> |
