Initial commit: OCA Technical packages (595 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:03 +02:00
commit 2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions

View file

@ -0,0 +1,37 @@
/** @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", {
get rendererProps() {
this.updateActiveActions();
return this._super(...arguments);
},
updateActiveActions() {
if (this.viewMode === "list" && this.activeActions.type === "one2many") {
const self = this;
const parser = new XMLParser();
const archInfo = this.activeField.views[this.viewMode];
const xmlDoc = parser.parseXML(archInfo.__rawArch);
["create", "delete"].forEach(function (item) {
if (self.activeActions[item] && _.has(xmlDoc.attributes, item)) {
const expr = xmlDoc.getAttribute(item);
try {
self.activeActions[item] = evaluateExpr(
expr,
self.props.record.data
);
} catch (ignored) {
console.log(
"[web_action_conditionable] unrecognized expr '" +
expr +
"', ignoring"
);
}
}
});
}
},
});