-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] New module: web_readonly_bypass #162
Conversation
8939d07
to
5c0c721
Compare
------------ | ||
|
||
* Jonathan Nemry <jonathan.nemry@acsone.eu> | ||
* Laetitia Gangloff <laetitia.gangloff.eu> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think email address isn't correct
Can you remove |
Little remarks on readme file and about header. Otherwise, 👍 |
# | ||
# Authors: Nemry Jonathan & Laetitia Gangloff | ||
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) | ||
# All Rights Reserved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this useless line
Very interesting feature! 👍 (code review) |
5c0c721
to
3260cd2
Compare
<data> | ||
<template id="assets_backend" name="readonly_bypass" inherit_id="web.assets_backend"> | ||
<xpath expr="." position="inside"> | ||
<script type="text/javascript" src="/readonly_bypass/static/src/js/readonly_bypass.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you rename module you miss to change the path:
Should be
<script type="text/javascript" src="/web_readonly_bypass/static/src/js/readonly_bypass.js"></script>
* Use a better test condition * Fix the email address [FIX] * rename the path and web instance just as the module was
Excellent 👍 |
DO NOT MERGE YET! Thinking about this carefully, this module inverts the behaviour by default, so it applies to all existing codebase, and can lead to unexpected behaviours in modules that rely on the volatibility of onchange to change data, but they don't want to store it. The module must act the contrary: use the normal behaviour by default, and include a context key |
Although I don't have any concrete cases in mind, I agree with @pedrobaeza: it's risky to have a module that changes the standard behavior system wide, as this may have unexpected side effects. @petrus-v since you are testing it these days, would you mind doing that change? |
I agree with @pedrobaeza! This behavior will be safer for me as well, I'll make change on #164 as well! I wonder how to set the context correctly, I expected to set it on the field or the entire view but it looks more complicated as I expected to forward it properly! Thanks to take me in consideration! |
I think the best approach is to define the context at field level, so you can fine-grain the control over each readonly field. |
@petrus-v |
Well, I prefer the duality of the key in the action window context or the key in the field context. |
function ignore_readonly(data, options, mode, context){ | ||
if (options){ | ||
if ('readonly_fields' in options && options['readonly_fields'] && | ||
!('filter_out_readonly' in context && context['filter_out_readonly'] == true )) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be accurate, my problem was that, when I quickly tested to define context on the field like this on the view:
<field name="my_readonly_field" context="{'filter_out_readonly': True}" />
or on the action windows.
The javascript context
parameter does'nt contain the filter_out_readonly
properties :-/
It needs more investigations ;-)
Added a specific context into a field will be not propagated until the |
Ok, I don't know about the difficulty in JS side, so go ahead with the one you propose, @JonathanNEMRY |
So @petrus-v do you think it is OK for you to consider the special context key will be added into the action's context ( |
Yes I'm fine with that! I'll do the same. thanks for the tip! |
@JonathanNEMRY I've done some works there https://github.com/petrus-v/web/tree/8.0-web_readonly_bypass but I'm going to be off for a month, I could create a PR on acsone repo first, then let you follow this PR, or I create a new fresh PR on OCA/web repo, or you can directly merge my branch (becarefull I rebase on the top of oca/8.0)? What do you prefer ? |
@petrus-v you can make a PR on https://github.com/acsone/web/tree/8.0-web_readonly_bypass-jne and then I will take care of the next steps! see you next month ;) |
Ok, thanks, I'll do that. |
readonly_by_pass. This context can either be a bool or field name array
BufferedDataSet Class
Any update on this? |
8.0 web readonly bypass jne
I think we could replace Obviously I give my 👍 as I've done the end of works, but I'm not sure it has values! |
@@ -0,0 +1,86 @@ | |||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | |||
:alt: License: AGPL-3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you take a look to the latest version of the sample README.rst (https://raw.githubusercontent.com/OCA/maintainer-tools/master/template/module/README.rst) and fix the following issues?
- add target to the image licence badge
- put a lot of '===' above the module title to make the title a real title
- add a link 'Try me on Runbot' in the usage section
* Improve .rst * user_strict into js * review Authors
Hi, |
👍 |
------------ | ||
|
||
* Jonathan Nemry <jonathan.nemry@acsone.eu> | ||
* Laetitia Gangloff <laetitia.gangloff@acsone.eu> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add @petrus-v in contributors.
@petrus-v is added to the contributors into README.rst: sorry for this omission and thanks again for your contribution! |
oh yes I missed it too, thanks! That was with pleasure ;), you did the hardest way |
👍 |
[ADD] New module: web_readonly_bypass
Update all submodules + project + fix build
…constraint BSMTS-286 Remove BVR/ESR unique constraint
This Module provides a solution to the problem of the interaction between 'readonly' attribute and 'on_change' attribute when used together