mirror of https://github.com/OCA/web.git
[MIG] web_action_conditionable: Migration to 17.0
parent
fafcc22e7e
commit
e3b45308ab
|
@ -87,11 +87,12 @@ Contributors
|
|||
- `Trobz <https://trobz.com>`__:
|
||||
|
||||
- Nguyễn Minh Chiến <chien@trobz.com>
|
||||
- Tran Thanh Trai <traitt@trobz.com>
|
||||
|
||||
Other credits
|
||||
-------------
|
||||
|
||||
The migration of this module from 15.0 to 16.0 was financially supported
|
||||
The migration of this module from 15.0 to 17.0 was financially supported
|
||||
by Camptocamp
|
||||
|
||||
Maintainers
|
||||
|
|
|
@ -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)",
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
|
||||
- [Trobz](https://trobz.com):
|
||||
- Nguyễn Minh Chiến \<<chien@trobz.com>\>
|
||||
- Tran Thanh Trai \<<traitt@trobz.com>\>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
The migration of this module from 15.0 to 16.0 was financially supported
|
||||
The migration of this module from 15.0 to 17.0 was financially supported
|
||||
by Camptocamp
|
||||
|
|
|
@ -424,13 +424,14 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|||
<li>Jasper Jumelet <<a class="reference external" href="mailto:jasper.jumelet@codeforward.nl">jasper.jumelet@codeforward.nl</a>></li>
|
||||
<li><a class="reference external" href="https://trobz.com">Trobz</a>:<ul>
|
||||
<li>Nguyễn Minh Chiến <<a class="reference external" href="mailto:chien@trobz.com">chien@trobz.com</a>></li>
|
||||
<li>Tran Thanh Trai <<a class="reference external" href="mailto:traitt@trobz.com">traitt@trobz.com</a>></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 15.0 to 17.0 was financially supported
|
||||
by Camptocamp</p>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue