Browse Source

[10.0] migrated to new API module web_action_conditionable (#547)

* [IMP] migrated to new API

* Update view.xml
pull/1073/head
Cristian Salamea 6 years ago
committed by Moises Lopez - https://www.vauxoo.com/
parent
commit
2cc3ba4bff
  1. 5
      web_action_conditionable/__manifest__.py
  2. 9
      web_action_conditionable/static/src/js/views.js
  3. 2
      web_action_conditionable/views/view.xml

5
web_action_conditionable/__manifest__.py

@ -1,10 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
{ {
"name": 'web_action_conditionable', "name": 'web_action_conditionable',
"version": "10.0.1.0.0",
"version": "10.0.0.1.0",
"depends": [ "depends": [
'base',
'web',
'web'
], ],
'data': ['views/view.xml'], 'data': ['views/view.xml'],
"author": "Cristian Salamea,Odoo Community Association (OCA)", "author": "Cristian Salamea,Odoo Community Association (OCA)",

9
web_action_conditionable/static/src/js/views.js

@ -1,10 +1,12 @@
odoo.define('web.web_action_conditionable', function (require) {
/*global openerp, _, $ */
odoo.define('web_action_conditionable', function(require){
"use strict"; "use strict";
var View = require('web.View');
var View = require('web.view');
View.include({ View.include({
is_action_enabled: function(action) {
is_action_enabled: function(action){
var attrs = this.fields_view.arch.attrs; var attrs = this.fields_view.arch.attrs;
if (action in attrs) { if (action in attrs) {
try { try {
@ -20,5 +22,6 @@ odoo.define('web.web_action_conditionable', function (require) {
return true; return true;
} }
} }
}); });
}); });

2
web_action_conditionable/views/view.xml

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<data>
<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"> <xpath expr="." position="inside">
<script type="text/javascript" src="/web_action_conditionable/static/src/js/views.js"></script> <script type="text/javascript" src="/web_action_conditionable/static/src/js/views.js"></script>
</xpath> </xpath>
</template> </template>
</data>
</odoo> </odoo>
Loading…
Cancel
Save