From 6cfe7efa9c394dbbce956a7a6c528528935653df Mon Sep 17 00:00:00 2001 From: MuK IT GmbH Date: Mon, 14 Jan 2019 20:18:30 +0000 Subject: [PATCH] publish muk_utils - 12.0 --- muk_utils/__manifest__.py | 2 +- muk_utils/models/scss_editor.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/muk_utils/__manifest__.py b/muk_utils/__manifest__.py index be637f8..8525a2e 100644 --- a/muk_utils/__manifest__.py +++ b/muk_utils/__manifest__.py @@ -19,7 +19,7 @@ { "name": "MuK Utils", "summary": """Utility Features""", - "version": '12.0.1.4.7', + "version": '12.0.1.4.8', "category": 'Extra Tools', "license": "AGPL-3", "author": "MuK IT", diff --git a/muk_utils/models/scss_editor.py b/muk_utils/models/scss_editor.py index 39e438d..961ea1e 100644 --- a/muk_utils/models/scss_editor.py +++ b/muk_utils/models/scss_editor.py @@ -44,6 +44,9 @@ class ScssEditor(models.AbstractModel): bin_size=False, bin_size_datas=False ).search([("url", '=', url)]) + def _get_custom_view(self, url): + return self.env["ir.ui.view"].search([("name", '=', url)]) + def _get_variable(self, content, variable): regex = r'{0}\:?\s(.*?);'.format(variable) value = re.search(regex, content) @@ -128,4 +131,9 @@ class ScssEditor(models.AbstractModel): content = self._replace_variables( self.get_content(url, xmlid), variables ) - self.replace_content(url, xmlid, content) \ No newline at end of file + self.replace_content(url, xmlid, content) + + def reset_values(self, url, xmlid): + custom_url = self._get_custom_url(url, xmlid) + self._get_custom_attachment(custom_url).unlink() + self._get_custom_view(custom_url).unlink() \ No newline at end of file