diff --git a/web_action_conditionable/README.rst b/web_action_conditionable/README.rst index 09a9b961e2b1..237856b52e70 100644 --- a/web_action_conditionable/README.rst +++ b/web_action_conditionable/README.rst @@ -87,11 +87,12 @@ Contributors - `Trobz `__: - Nguyễn Minh Chiến + - Tran Thanh Trai Other credits ------------- -The migration of this module from 15.0 to 16.0 was financially supported +The migration of this module from 16.0 to 17.0 was financially supported by Camptocamp Maintainers diff --git a/web_action_conditionable/__manifest__.py b/web_action_conditionable/__manifest__.py index 1eee3d4dabaa..c625b5860de6 100644 --- a/web_action_conditionable/__manifest__.py +++ b/web_action_conditionable/__manifest__.py @@ -1,7 +1,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "web_action_conditionable", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "depends": ["base", "web"], "data": [], "author": "Cristian Salamea,Odoo Community Association (OCA)", diff --git a/web_action_conditionable/readme/CONTRIBUTORS.md b/web_action_conditionable/readme/CONTRIBUTORS.md index 3ad5b9523bdb..5361a82e92a6 100644 --- a/web_action_conditionable/readme/CONTRIBUTORS.md +++ b/web_action_conditionable/readme/CONTRIBUTORS.md @@ -10,3 +10,4 @@ - [Trobz](https://trobz.com): - Nguyễn Minh Chiến \<\> + - Tran Thanh Trai \<\> diff --git a/web_action_conditionable/readme/CREDITS.md b/web_action_conditionable/readme/CREDITS.md index 291e14c81e2a..7c48f8e03fc2 100644 --- a/web_action_conditionable/readme/CREDITS.md +++ b/web_action_conditionable/readme/CREDITS.md @@ -1,2 +1,2 @@ -The migration of this module from 15.0 to 16.0 was financially supported +The migration of this module from 16.0 to 17.0 was financially supported by Camptocamp diff --git a/web_action_conditionable/static/description/index.html b/web_action_conditionable/static/description/index.html index 18faee91a1c9..e28fee89f470 100644 --- a/web_action_conditionable/static/description/index.html +++ b/web_action_conditionable/static/description/index.html @@ -424,13 +424,14 @@

Contributors

  • Jasper Jumelet <jasper.jumelet@codeforward.nl>
  • Trobz:
  • Other credits

    -

    The migration of this module from 15.0 to 16.0 was financially supported +

    The migration of this module from 16.0 to 17.0 was financially supported by Camptocamp

    diff --git a/web_action_conditionable/static/src/components/field_one2many.esm.js b/web_action_conditionable/static/src/components/field_one2many.esm.js index 4d5da3ae852d..e37ca27acc5b 100644 --- a/web_action_conditionable/static/src/components/field_one2many.esm.js +++ b/web_action_conditionable/static/src/components/field_one2many.esm.js @@ -1,22 +1,24 @@ /** @odoo-module **/ import {X2ManyField} from "@web/views/fields/x2many/x2many_field"; -import {XMLParser} from "@web/core/utils/xml"; import {evaluateExpr} from "@web/core/py_js/py"; import {patch} from "@web/core/utils/patch"; -patch(X2ManyField.prototype, "web_action_conditionable_FieldOne2Many", { +patch(X2ManyField.prototype, { get rendererProps() { this.updateActiveActions(); - return this._super(...arguments); + return super.rendererProps; }, updateActiveActions() { - if (this.viewMode === "list" && this.activeActions.type === "one2many") { + if ( + this.props.viewMode === "list" && + this.activeActions.type === "one2many" && + !this.props.readonly + ) { const self = this; - const parser = new XMLParser(); - const archInfo = this.activeField.views[this.viewMode]; - const xmlDoc = parser.parseXML(archInfo.__rawArch); + const archInfo = this.activeField.views[this.props.viewMode]; + const xmlDoc = archInfo.xmlDoc; ["create", "delete"].forEach(function (item) { - if (self.activeActions[item] && _.has(xmlDoc.attributes, item)) { + if (item in self.activeActions && xmlDoc.hasAttribute(item)) { const expr = xmlDoc.getAttribute(item); try { self.activeActions[item] = evaluateExpr(