From f8e953fdd6eb5d9ce3f6713f9cd06665ca20bb2a Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Fri, 11 Jan 2019 08:56:00 +0000 Subject: [PATCH] [FIX] base: set related crud_model_name on the correct field Create an automated action that creates a new record (of target crud_model_id). Try using a link_field_id: nothing appears to be selectable, even if some fields satisfy the intended conditions. The issue is that the crud_model_name field was related to crud_model_id.name, instead of the correct crud_model_id.model (note the apt naming). Note that in the onchange the value of crud_model_name was correctly set to crud_model_id.model, adding to the confusion. opw 1910671 closes odoo/odoo#30145 --- odoo/addons/base/ir/ir_actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/ir/ir_actions.py b/odoo/addons/base/ir/ir_actions.py index ee6eb782048..bec32692acc 100644 --- a/odoo/addons/base/ir/ir_actions.py +++ b/odoo/addons/base/ir/ir_actions.py @@ -383,7 +383,7 @@ class IrActionsServer(models.Model): # Create crud_model_id = fields.Many2one('ir.model', string='Create/Write Target Model', oldname='srcmodel_id', 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.name', readonly=True) + crud_model_name = fields.Char(related='crud_model_id.model', readonly=True) link_field_id = fields.Many2one('ir.model.fields', string='Link using field', help="Provide the field used to link the newly created record " "on the record on used by the server action.")