Skip to content

Commit

Permalink
[MIG] web_action_conditionable: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
traitrantrobz committed Jul 26, 2024
1 parent bd8069b commit 526befe
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
3 changes: 2 additions & 1 deletion web_action_conditionable/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ Contributors
- `Trobz <https://trobz.com>`__:

- Nguyễn Minh Chiến <[email protected]>
- Tran Thanh Trai <[email protected]>

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
Expand Down
2 changes: 1 addition & 1 deletion web_action_conditionable/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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)",
Expand Down
1 change: 1 addition & 0 deletions web_action_conditionable/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@

- [Trobz](https://trobz.com):
- Nguyễn Minh Chiến \<<[email protected]>\>
- Tran Thanh Trai \<<[email protected]>\>
2 changes: 1 addition & 1 deletion web_action_conditionable/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion web_action_conditionable/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,14 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li>Jasper Jumelet &lt;<a class="reference external" href="mailto:jasper.jumelet&#64;codeforward.nl">jasper.jumelet&#64;codeforward.nl</a>&gt;</li>
<li><a class="reference external" href="https://trobz.com">Trobz</a>:<ul>
<li>Nguyễn Minh Chiến &lt;<a class="reference external" href="mailto:chien&#64;trobz.com">chien&#64;trobz.com</a>&gt;</li>
<li>Tran Thanh Trai &lt;<a class="reference external" href="mailto:traitt&#64;trobz.com">traitt&#64;trobz.com</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
<p>The migration of this module from 15.0 to 16.0 was financially supported
<p>The migration of this module from 16.0 to 17.0 was financially supported
by Camptocamp</p>
</div>
<div class="section" id="maintainers">
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down

0 comments on commit 526befe

Please sign in to comment.