From 2ffc6e8450ba0f4e1dc17a4f3f6b167314dbc0d3 Mon Sep 17 00:00:00 2001 From: bobslee Date: Tue, 21 Jun 2022 08:20:08 +0200 Subject: [PATCH] [IMP] formio: Several improvements - Builder: formio.js version (field) domain/filter exclude Dummy. - Builder: hide the Assigned user (`user_id`) field. Let's see if this still needed, otherwise change to `Many2many2`. - Remove menu to `formio.res.model` Issue: #190: (https://github.com/novacode-nl/odoo-formio/issues/190) Closes #190 --- formio/CHANGELOG.md | 8 ++++++++ formio/__manifest__.py | 2 +- formio/models/formio_builder.py | 3 ++- formio/models/res_config_settings.py | 2 +- formio/views/formio_builder_views.xml | 7 ------- formio/views/formio_menu.xml | 12 ++++++------ 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/formio/CHANGELOG.md b/formio/CHANGELOG.md index 4e7db117..00fae38a 100644 --- a/formio/CHANGELOG.md +++ b/formio/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### 9.23 + +- Builder: formio.js version (field) domain/filter exclude Dummy. +- Builder: hide the Assigned user (`user_id`) field.\ + Let's see if this still needed, otherwise change to `Many2many2`. +- Remove menu to `formio.res.model`\ + Issue: [\#190](https://github.com/novacode-nl/odoo-formio/issues/190) + ### 9.22 - Remove `formio.version` and related assets data diff --git a/formio/__manifest__.py b/formio/__manifest__.py index faacb166..9d02766e 100644 --- a/formio/__manifest__.py +++ b/formio/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Forms', 'summary': 'Form Builder & integration of professional and versatile Forms to collect any information you need for your business.', - 'version': '9.22', + 'version': '9.23', 'license': 'LGPL-3', 'author': 'Nova Code', 'website': 'https://www.novacode.nl', diff --git a/formio/models/formio_builder.py b/formio/models/formio_builder.py index 1022e5ca..c83d8751 100644 --- a/formio/models/formio_builder.py +++ b/formio/models/formio_builder.py @@ -45,6 +45,7 @@ class Builder(models.Model): description = fields.Text("Description") formio_version_id = fields.Many2one( 'formio.version', string='formio.js version', required=True, + domain="[('is_dummy', '=', False)]", default=lambda self: self._default_formio_version_id(), tracking=True, help="""Loads the specific formio.js Javascript libraries version (sourcecode: https://github.com/formio/formio.js)""") formio_version_name = fields.Char(related='formio_version_id.name', string='formio.js version name', tracking=False) # silly, but avoids duplicate tracking message @@ -85,7 +86,7 @@ class Builder(models.Model): parent_version = fields.Integer(related='parent_id.version', string='Parent Version', readonly=True) version = fields.Integer("Version", required=True, readonly=True, default=1) version_comment = fields.Text("Version Comment") - user_id = fields.Many2one('res.users', string='Assigned user', tracking=True) + user_id = fields.Many2one('res.users', string='Assigned user', tracking=True) # TODO old field, remove? forms = fields.One2many('formio.form', 'builder_id', string='Forms') portal = fields.Boolean("Portal", tracking=True, help="Form is accessible by assigned portal user") portal_submit_done_url = fields.Char( diff --git a/formio/models/res_config_settings.py b/formio/models/res_config_settings.py index 21dcfa09..14491a5f 100644 --- a/formio/models/res_config_settings.py +++ b/formio/models/res_config_settings.py @@ -7,7 +7,7 @@ class ResConfigSettings(models.TransientModel): _inherit = 'res.config.settings' - formio_default_version_id = fields.Many2one('formio.version', string='formio.js version') + formio_default_version_id = fields.Many2one('formio.version', string='formio.js version', domain="[('is_dummy', '=', False)]") formio_default_asset_css_ids = fields.Many2many('formio.default.asset.css', string='formio.js CSS assets', context={'active_test': False}) formio_default_builder_js_options_id = fields.Many2one('formio.builder.js.options', string='formio.js builder options ID') formio_default_builder_js_options = fields.Text(related='formio_default_builder_js_options_id.value', string='formio.js builder options') diff --git a/formio/views/formio_builder_views.xml b/formio/views/formio_builder_views.xml index ae0c8e3b..93f5eb01 100644 --- a/formio/views/formio_builder_views.xml +++ b/formio/views/formio_builder_views.xml @@ -22,7 +22,6 @@ See LICENSE file for full licensing details. --> - @@ -102,7 +101,6 @@ See LICENSE file for full licensing details. --> - @@ -296,12 +294,8 @@ See LICENSE file for full licensing details. --> - - - domain="[('wizard', '=', False)]"/> - diff --git a/formio/views/formio_menu.xml b/formio/views/formio_menu.xml index 8c0f3ebd..089d1b00 100644 --- a/formio/views/formio_menu.xml +++ b/formio/views/formio_menu.xml @@ -69,11 +69,11 @@ See LICENSE file for full licensing details. --> parent="formio.menu_formio_configuration" sequence="100" action="formio.action_formio_builder_js_options"/> - + + + + + +