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

[14.0] Tree attributes edit/create/delete behaving weird #73148

Open
treylade opened this issue Jul 2, 2021 · 4 comments
Open

[14.0] Tree attributes edit/create/delete behaving weird #73148

treylade opened this issue Jul 2, 2021 · 4 comments
Labels
Framework General frontend/backend framework issues

Comments

@treylade
Copy link

treylade commented Jul 2, 2021

Impacted versions:

Odoo 14.0-20210701

Steps to reproduce:

  • create many2many field "active_engagements"
active_engagements = fields.Many2many(
     comodel_name='swaf.hr.engagement',
     relation='swaf_hr_process_change_engagement_role_wiz_active_engagements')
  • expose field in wizard view as tree
<field name="active_engagements" colspan="4" nolabel="1">
        <tree default_order="begin_date ASC" edit="true" create="false" delete="false" decoration-success="status == 'aktiv'" decoration-warning="status == 'pausiert'">
                <field name="program" readonly="True" />
                <field name="program_department" readonly="True" />
                <field name="status" readonly="True" />
                <field name="is_program_vereint" invisible="True" />
                <field name="status_pausiert_until" readonly="True" />
                <field name="main_role" readonly="True" />
                <field name="additional_roles" readonly="True" attrs="{'invisible':[('is_program_vereint', '=', True)]}" widget="many2many_tags" />
                <field name="begin_date" readonly="True" />
                <field name="end_date" readonly="True" />
                <field name="end_switch" widget="boolean_toggle" />
        </tree>
</field>

Current behavior:

  • attributes create and delete don't have any effect, a new entry is still addable and entries are deletable
  • I can edit the only non readonly field "end_switch", as expected

Expected behavior:

  • I expect only to be able to edit "end_switch", no create, no delete with these attributes set
  • I remember that this was exactly the behaviour in the past

Video/Screenshot link (optional):

Support ticket number submitted via odoo.com/help (optional):

@pedrobaeza
Copy link
Collaborator

Such attributes don't apply over the m2m dialog. They are intended for direct tree views.

I let this to see if Odoo considers that this behavior should be added or not.

@treylade
Copy link
Author

treylade commented Jul 2, 2021

Thank you for your quick response.
That would be very helpful in many cases! Please consider this request.

@Yenthe666
Copy link
Collaborator

@rco-odoo @Feyensv maybe one of you can give the final feedback here?

@pedrobaeza
Copy link
Collaborator

This is something of web client, not ORM.

@Feyensv Feyensv added the Framework General frontend/backend framework issues label Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework General frontend/backend framework issues
Projects
None yet
Development

No branches or pull requests

4 participants