Skip to content
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

[8.0] web_readonly_bypass: Doesn't work on children popup views #256

Closed
pedrobaeza opened this issue Nov 14, 2015 · 5 comments
Closed

[8.0] web_readonly_bypass: Doesn't work on children popup views #256

pedrobaeza opened this issue Nov 14, 2015 · 5 comments

Comments

@pedrobaeza
Copy link
Member

When you have a view that contains a one2many field, and this field opens a popup for the form window, fields that are readonly in this sub-model are not saved although you pass the correct context.

@JonathanNEMRY, @petrus-v, have you faced this case?

@petrus-v
Copy link

@pedrobaeza,

I've no idea, can you let an example of your definition view, what do you mean by 'you pass the correct context'? I wonder if the context is forwarded to the popup and if it should be retrieved in the same way as a form view. Did you try to add context on the one2many field that open the popup?

@JonathanNEMRY
Copy link

@pedrobaeza normally this case is covered...can you explain What you mean by "correct context" ? and where do you add it?

@pedrobaeza
Copy link
Member Author

Thanks for your replies.

Yeah, I tried both. Let me draft one quick example (the one where I tried was on MRP routing line sub-sub-screen, so it's very difficult to see full example with that):

<record id="..." model="ir.actions.act_window">
    <field name="res_model">main.model</field>
    <field name="context">{'readonly_by_pass': True}</field>
    ...
</record>

<record id="..." model="ir.ui.view">
    <field name="model">main.model</field>
    ...
    <field name=arch>
        <form string="...">
            <field name="submodel_one2many_field"
                   context="{'readonly_by_pass': True}"/> <!-- I have tried also this -->
        </form>
    </field>
</record>

<record id="..." model="ir.ui.view">
    <field name="model">sub.model</field>
    ...
    <field name=arch>
        <form string="...">
            <field name="readonly_field" readonly="1"/>
        </form>
    </field>
</record>

@JonathanNEMRY
Copy link

@pedrobaeza
The right place to set the readonly_by_pass attribute is into the context of the action.
But with some missing args into Odoo, it appears that the options dictionary is not well passed.
So I propose an added value with this #258

hope this solves this issue

-jne

@pedrobaeza
Copy link
Member Author

Solved already, so I close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants