mirror of https://github.com/OCA/web.git
[IMP] : black, isort, prettier
parent
667cc81197
commit
75b9541531
|
@ -1,14 +1,11 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
{
|
||||
"name": 'web_action_conditionable',
|
||||
"name": "web_action_conditionable",
|
||||
"version": "12.0.1.0.0",
|
||||
"depends": [
|
||||
'base',
|
||||
'web',
|
||||
],
|
||||
'data': ['views/view.xml'],
|
||||
"depends": ["base", "web",],
|
||||
"data": ["views/view.xml"],
|
||||
"author": "Cristian Salamea,Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/web",
|
||||
"license": "AGPL-3",
|
||||
'installable': True,
|
||||
"installable": True,
|
||||
}
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
/* global py */
|
||||
/* Copyright 2019 Alexandre Díaz
|
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
||||
odoo.define('web.web_action_conditionable', function (require) {
|
||||
odoo.define("web.web_action_conditionable", function(require) {
|
||||
"use strict";
|
||||
|
||||
var FieldOne2Many = require('web.relational_fields').FieldOne2Many;
|
||||
var FieldOne2Many = require("web.relational_fields").FieldOne2Many;
|
||||
|
||||
FieldOne2Many.include({
|
||||
init: function () {
|
||||
init: function() {
|
||||
var self = this;
|
||||
try {
|
||||
return this._super.apply(this, arguments);
|
||||
} catch (error) {
|
||||
var arch = this.view && this.view.arch;
|
||||
if (arch) {
|
||||
['create', 'delete'].forEach(function (item) {
|
||||
["create", "delete"].forEach(function(item) {
|
||||
if (!_.has(arch.attrs, item)) {
|
||||
return;
|
||||
}
|
||||
var expr = arch.attrs[item];
|
||||
try {
|
||||
self.activeActions[item] = py.evaluate(
|
||||
py.parse(py.tokenize(expr)),
|
||||
self.recordData).toJSON();
|
||||
self.activeActions[item] = py
|
||||
.evaluate(py.parse(py.tokenize(expr)), self.recordData)
|
||||
.toJSON();
|
||||
} catch (ignored) {
|
||||
// Do nothing
|
||||
}
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<template id="assets_backend" name="action conditionable assets" inherit_id="web.assets_backend">
|
||||
<template
|
||||
id="assets_backend"
|
||||
name="action conditionable assets"
|
||||
inherit_id="web.assets_backend"
|
||||
>
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/web_action_conditionable/static/src/js/field_one2many.js"></script>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/web_action_conditionable/static/src/js/field_one2many.js"
|
||||
/>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
|
|
Loading…
Reference in New Issue