From f01ff0477b82bee45ed30a9424301f8f58959c66 Mon Sep 17 00:00:00 2001 From: MuK IT GmbH Date: Thu, 20 Dec 2018 11:20:10 +0000 Subject: [PATCH] publish muk_utils - 12.0 --- muk_utils/__manifest__.py | 2 +- muk_utils/models/res_config_settings.py | 19 +++++++++++++++++-- muk_utils/views/res_config_settings_view.xml | 9 ++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/muk_utils/__manifest__.py b/muk_utils/__manifest__.py index e0321a5..324db6a 100644 --- a/muk_utils/__manifest__.py +++ b/muk_utils/__manifest__.py @@ -20,7 +20,7 @@ { "name": "MuK Utils", "summary": """Utility Features""", - "version": '12.0.1.1.10', + "version": '12.0.1.1.11', "category": 'Extra Tools', "license": "AGPL-3", "author": "MuK IT", diff --git a/muk_utils/models/res_config_settings.py b/muk_utils/models/res_config_settings.py index 2775f18..4d5d37a 100644 --- a/muk_utils/models/res_config_settings.py +++ b/muk_utils/models/res_config_settings.py @@ -41,6 +41,11 @@ class ResConfigSettings(models.TransientModel): required=True, help="Attachment storage location.") + + attachment_location_changed = fields.Boolean( + compute='_compute_attachment_location_changed', + string='Storage Location Changed') + #---------------------------------------------------------- # Functions #---------------------------------------------------------- @@ -59,6 +64,16 @@ class ResConfigSettings(models.TransientModel): res.update(attachment_location=params.get_param('ir_attachment.location', 'file')) return res - @api.multi def attachment_force_storage(self): - self.env['ir.attachment'].force_storage() \ No newline at end of file + self.env['ir.attachment'].force_storage() + + #---------------------------------------------------------- + # Read + #---------------------------------------------------------- + + @api.depends('attachment_location') + def _compute_attachment_location_changed(self): + params = self.env['ir.config_parameter'].sudo() + attachment_location = params.get_param('ir_attachment.location', 'file') + for record in self: + record.attachment_location_changed = attachment_location != self.attachment_location \ No newline at end of file diff --git a/muk_utils/views/res_config_settings_view.xml b/muk_utils/views/res_config_settings_view.xml index cf524a8..fae467e 100644 --- a/muk_utils/views/res_config_settings_view.xml +++ b/muk_utils/views/res_config_settings_view.xml @@ -26,7 +26,7 @@

Storage

-
+
@@ -35,9 +35,12 @@ Attachment storage location.
- +
+
+ + Save this page before triggering the migration. +