diff --git a/base_details/__manifest__.py b/base_details/__manifest__.py index 4f2898413c..398ac9009c 100644 --- a/base_details/__manifest__.py +++ b/base_details/__manifest__.py @@ -8,7 +8,7 @@ "summary": """Allows to add reference in any models""", "category": "Hidden", "images": ["static/description/icon.png"], - "version": "11.0.1.0.1", + "version": "11.0.1.0.2", "application": False, "author": "IT-Projects LLC, Ivan Yelizariev", diff --git a/base_details/doc/changelog.rst b/base_details/doc/changelog.rst index b766482427..9aede694f8 100644 --- a/base_details/doc/changelog.rst +++ b/base_details/doc/changelog.rst @@ -1,3 +1,9 @@ +`1.0.2` +------ + +- **FIX** Vanishing of the record field on form saving +- **NEW** Default value for the record field is set automatically + `1.0.1` ------ diff --git a/base_details/models/base_details.py b/base_details/models/base_details.py index 2f2d4cc73a..ba034fc33b 100644 --- a/base_details/models/base_details.py +++ b/base_details/models/base_details.py @@ -29,7 +29,7 @@ def details(self): details_record = None return details_record - details_model = fields.Selection(selection="_model_selection", string='Model', store=True) + details_model = fields.Selection(selection="_model_selection", string='Model') details_model_record = fields.Reference(selection="_details_model_record_selection", string='Record') details_model_exists = fields.Boolean(compute="_compute_existence", string='Details Model Exists', store=True) details_res_id = fields.Integer(compute="_compute_res_id", string='Record', store=True) @@ -42,8 +42,10 @@ def onchange_details_model(self): self.details_model_record = self.env[self.details_model].search([], limit=1) else: self.details_model_exists = False + self.details_model_record = False @api.multi + @api.depends('details_model') def _compute_existence(self): for rec in self: if rec.details_model and rec.details_model in [x.model for x in rec.env['ir.model'].search([])]: