Browse Source

[CHG] some code review:

* Use a better test condition
* Fix the email address
[FIX]
* rename the path and web instance just as the module was
pull/162/head
Jonathan Nemry (ACSONE) 10 years ago
parent
commit
3b984312b6
  1. 2
      web_readonly_bypass/README.rst
  2. 6
      web_readonly_bypass/static/src/js/readonly_bypass.js
  3. 4
      web_readonly_bypass/views/readonly_bypass.xml

2
web_readonly_bypass/README.rst

@ -56,7 +56,7 @@ Contributors
------------ ------------
* Jonathan Nemry <jonathan.nemry@acsone.eu> * Jonathan Nemry <jonathan.nemry@acsone.eu>
* Laetitia Gangloff <laetitia.gangloff.eu>
* Laetitia Gangloff <laetitia.gangloff@acsone.eu>
Maintainer Maintainer
---------- ----------

6
web_readonly_bypass/static/src/js/readonly_bypass.js

@ -2,7 +2,7 @@
* Allow to bypass readonly fi the value is changed * Allow to bypass readonly fi the value is changed
*/ */
openerp.readonly_bypass = function(instance) {
openerp.web_readonly_bypass = function(instance) {
var QWeb = instance.web.qweb, _t = instance.web._t; var QWeb = instance.web.qweb, _t = instance.web._t;
/** /**
@ -19,8 +19,8 @@ openerp.readonly_bypass = function(instance) {
*/ */
function ignore_readonly(data, options, mode, context){ function ignore_readonly(data, options, mode, context){
if (options){ if (options){
if (!('filter_out_readonly' in context && context['filter_out_readonly'] == true
&& 'readonly_fields' in options && options['readonly_fields'])) {
if ('readonly_fields' in options && options['readonly_fields'] &&
!('filter_out_readonly' in context && context['filter_out_readonly'] == true )) {
if(mode){ if(mode){
$.each( options.readonly_fields, function( key, value ) { $.each( options.readonly_fields, function( key, value ) {
if(value==false){ if(value==false){

4
web_readonly_bypass/views/readonly_bypass.xml

@ -5,8 +5,8 @@
<data> <data>
<template id="assets_backend" name="readonly_bypass" inherit_id="web.assets_backend"> <template id="assets_backend" name="readonly_bypass" inherit_id="web.assets_backend">
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<script type="text/javascript" src="/readonly_bypass/static/src/js/readonly_bypass.js"></script>
<script type="text/javascript" src="/web_readonly_bypass/static/src/js/readonly_bypass.js"></script>
</xpath> </xpath>
</template> </template>
</data> </data>
</openerp>
</openerp>
Loading…
Cancel
Save