[IMP] : black, isort, prettier

pull/2435/head
ahenriquez 2020-04-27 18:47:21 +02:00 committed by Jasper Jumelet
parent 667cc81197
commit 75b9541531
3 changed files with 21 additions and 17 deletions

View File

@ -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,
}

View File

@ -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
}

View File

@ -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>