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/9.0/10.0/11.0/master] Incorrect multi-level onchanges #20163

Closed
pedrobaeza opened this issue Oct 14, 2017 · 20 comments
Closed

[8.0/9.0/10.0/11.0/master] Incorrect multi-level onchanges #20163

pedrobaeza opened this issue Oct 14, 2017 · 20 comments
Labels
Framework General frontend/backend framework issues

Comments

@pedrobaeza
Copy link
Collaborator

pedrobaeza commented Oct 14, 2017

Impacted versions:

8.0, 9.0, 10.0, 11.0, master

Steps to reproduce:

With the following demonstration module:
onchange_multi_level.zip

  • Install the module
  • Go to Tests > Onchange multi-level test
  • Create a record
  • Type a letter on the main name field
  • Change the focus of the field
  • A new line called "Test level 1" should appear.
  • Open that line.

Current behavior:

There are 3 levels of models:

main
   |
   level1_ids > level1
      |
      level2_ids > level2

Assigning both levels through an onchange:

    @api.onchange('name')
    def _onchange_name(self):
        if not self.name:
            return
        self.level1_ids = [
            (0, 0, {
                'name': 'Test level 1',
                'level2_ids': [
                    (0, 0, {
                        'name': 'Test level 2',
                    })
                ]
            })
        ]

should fill them correctly, and more after the commit 886003a

But instead, you get different incorrect behaviors depending the version:

  • On v9/v10, lines are added but without values (all blank). When you try to save, and error is arisen.
  • On v11, you get the following error when opening the subform of level1:
Error:
TypeError: this.state.fields[node.attrs.name] is undefined

http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1559
Traceback:
_renderBodyCell@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1559:209
_renderRow/$cells<@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1582:127
_.collect@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:13:270
_renderRow@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1582:80
_renderRow@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1527:59
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3814:368
_.collect@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:13:270
_renderRows@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1583:83
_renderRows@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1528:48
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3814:368
_renderBody@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1558:52
_renderBody@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1526:364
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3814:368
_renderView@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1584:499
OdooClass.extend/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3811:485
_renderView@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1529:67
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3814:368
_render@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1278:173
_render@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1526:295
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3814:613
start@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1067:330
OdooClass.extend/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3811:485
start@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1508:8
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3814:613
__widgetRenderAndInsert/<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3931:958
then/</</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:678
fire@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:796:281
add@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:797:467
then/</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:631
each@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:625:758
then/<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:553
Deferred@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:803:189
then@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:518
__widgetRenderAndInsert@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3931:879
appendTo@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3931:92
_render@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1025:83
OdooClass.extend/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3811:485
start/<@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:884:1290
then/</</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:678
fire@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:796:281
add@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:797:467
then/</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:631
each@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:625:758
then/<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:553
Deferred@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:803:189
then@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:518
start@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:884:1165
OdooClass.extend/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3811:485
then/</</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:678
fire@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:796:281
add@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:797:467
then/</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:631
each@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:625:758
then/<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:553
Deferred@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:803:189
then@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:518
start@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1019:102
OdooClass.extend/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3811:485
__widgetRenderAndInsert/<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3931:958
then/</</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:678
fire@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:796:281
add@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:797:467
then/</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:631
each@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:625:758
then/<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:553
Deferred@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:803:189
then@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:518
__widgetRenderAndInsert@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3931:879
_renderFieldWidget@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1279:73
_renderFieldWidget@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1318:181
OdooClass.extend/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3811:485
_renderTagField@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1332:981
_renderNode@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1327:237
_renderNode@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:2240:39
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3814:368
_.collect@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:13:270
_renderTagForm@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1333:16
_renderNode@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1327:237
_renderNode@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:2240:39
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3814:368
_renderView@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1340:1360
_render@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1278:173
start@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1067:330
OdooClass.extend/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3811:485
__widgetRenderAndInsert/<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3931:958
then/</</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:678
fire@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:796:281
add@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:797:467
then/</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:631
each@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:625:758
then/<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:553
Deferred@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:803:189
then@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:518
__widgetRenderAndInsert@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3931:879
appendTo@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3931:92
start@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1074:560
OdooClass.extend/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3811:485
start@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1250:1006
OdooClass.extend/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3811:485
__widgetRenderAndInsert/<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3931:958
then/</</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:678
fire@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:796:281
add@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:797:467
then/</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:631
each@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:625:758
then/<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:553
Deferred@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:803:189
then@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:518
__widgetRenderAndInsert@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3931:879
appendTo@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3931:92
open/<@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1301:1
then/</</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:678
fire@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:796:281
add@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:797:467
then/</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:631
each@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:625:758
then/<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:553
Deferred@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:803:189
then@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:802:518
open@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1299:1
OdooClass.extend/</prototype[name]</<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3811:485
_onOpenOne2ManyRecord@http://localhost:11069/web/content/540-9c46f05/web.assets_backend.js:1354:1
proxy/<@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3908:8
trigger@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3906:166
_trigger_up@http://localhost:11069/web/content/539-f49a5cf/web.assets_common.js:3912:340

Expected behavior:

You know, everything working correctly 😉

I think there's some problem with the information passed from server to client or how to interpret it. @rco-odoo @ged-odoo please investigate it as this is a blocking point for advanced modules like OCA/account-closing#50 / OCA/account-closing#51

cc @Tecnativa

@gdgellatly
Copy link
Contributor

gdgellatly commented Oct 14, 2017

@pedrobaeza I have a similar module which works using self.level1_ids.level2_ids.new(). I can't say for sure ts the exact same scenario, but its an onchange in picking that takes a barcode, parses it for product, weight and lot and creates the lot, so that would be picking, stock_move, production_lot. Seems similar. I don't have any like that for an m2m though, just m2o and o2m fields

@pedrobaeza
Copy link
Collaborator Author

Thanks for the tip. I'm going to try and tell you.

@pedrobaeza
Copy link
Collaborator Author

@gdgellatly I'm afraid it doesn't work. In fact, in the real module I'm just doing like you say: https://github.com/OCA/account-closing/pull/50/files#diff-a1e53f9a256c02d42410243e01d9cc71R138

@Yenthe666 Yenthe666 added the Logistics about stock, mrp, delivery, purchase label Oct 16, 2017
@dhannyz
Copy link

dhannyz commented Oct 17, 2017

Bugger, I had hoped these onchange + relational field issues like these would have been smoothed out in the move to v11

@sle-odoo sle-odoo added Framework General frontend/backend framework issues and removed Logistics about stock, mrp, delivery, purchase labels Oct 18, 2017
@ged-odoo
Copy link
Contributor

@dhannyz we have now the tools to properly fix such issues, and make sure they do not come back. @pedrobaeza thanks for such a nice bug report. I'll work on it tomorrow and see what I can do.

@aab-odoo
Copy link
Contributor

@pedrobaeza The issue is fixed in v11 from rev. 16c9013
Multi level onchanges is a feature that has been introduced in v11, so there's nothing we can do in 8, 9 and 10.

Regards

@pedrobaeza
Copy link
Collaborator Author

Thank you very much for the patch.

Isn't there any possibility to backport it, taking into account that I have backported the ORM part?:

@aab-odoo
Copy link
Contributor

The webclient code (including the JS part of the onchange mechanism) has been completely rewrote in v11, so there is no chance that this can be backported.

@pedrobaeza
Copy link
Collaborator Author

OK, it's a pity, but thanks again.

@dhannyz
Copy link

dhannyz commented Oct 26, 2017

@aab-odoo
Great news regarding this fix, I expect to be making use of this in the near future.

@JordiBForgeFlow
Copy link
Contributor

@aab-odoo Seems that this is not correctly fixed. In OCA/account-closing#58 we try to implement this onchange. According to the instructions in 16c9013, when you change the o2m_1, the o2m_2 is proposed. But if you save WITHOUT OPENING the form view of the o2m_1, the o2m_2 is not saved. If you open FIRST the form view for each o2m_1 record, and then you save the main record, then it is fine.

If I manually open the form view of the o2m_1 record.
image

If I save without opening the form view of the o2m_1 record:
image

@aab-odoo
Copy link
Contributor

aab-odoo commented Nov 6, 2017

Hello @jbeficent

Yes, we are aware of this behavior. We discussed a lot about it, actually.

The problem is that we can't save the value of o2m_2 when the form view hasn't been opened as it is right now, because without opening the form view, we don't know the type of o2m_2 and we don't know if it is readonly or not, so we don't even know if we are allowed to save it (this is a technical limitation).

We could have fix it (for instance, by making an extra fields_view_get at some point). However, it would have implied a lot of unnecessary fields_view_get.

Our point for deciding not to fix it is that onchanges should not be used to ensure the business logic. They are meant to show to the user the impact of a change, in live, in the interface. So the specs are as follows: every onchange that the user sees is saved. What he doesn't see isn't saved. So if you open the form view, it will save the fields that are in the form (including o2m_2, with its value from the onchange). If you don't open it, it will only save the values from the list view.

Note that actually, it saves all fields that are in the definition of the list view, even those that are invisible, so a workaround would be to add the field o2m_2 to the list, with attrs invisible="1".

Regards

@pedrobaeza
Copy link
Collaborator Author

I think the workaround can be enough, isn't it, @jbeficent ?

@JordiBForgeFlow
Copy link
Contributor

@aab-odoo @pedrobaeza

When you introduce the o2m_2 to the list, with attrs invisible="1", it crashes at the time of saving, with this error:

`Error:
TypeError: this.state.fields[node.attrs.name] is undefined

http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1570
Traceback:
_renderBodyCell@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1570:209
_renderRow/$cells<@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1593:127
_.collect@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:13:270
_renderRow@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1593:80
_renderRow@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1538:59
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3814:368
_.collect@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:13:270
_renderRows@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1594:83
_renderRows@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1539:48
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3814:368
_renderBody@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1569:52
_renderBody@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1537:364
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3814:368
_renderView@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1595:499
OdooClass.extend/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3811:485
_renderView@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1540:67
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3814:368
_render@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1288:173
_render@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1537:295
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3814:613
start@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1072:330
OdooClass.extend/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3811:485
start@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1519:8
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3814:613
__widgetRenderAndInsert/<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3932:958
then/</</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:678
fire@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:796:281
add@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:797:467
then/</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:631
each@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:625:758
then/<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:553
Deferred@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:803:189
then@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:518
__widgetRenderAndInsert@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3932:879
appendTo@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3932:92
_render@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1030:83
OdooClass.extend/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3811:485
start/<@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:888:1311
then/</</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:678
fire@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:796:281
add@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:797:467
then/</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:631
each@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:625:758
then/<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:553
Deferred@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:803:189
then@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:518
start@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:888:1186
OdooClass.extend/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3811:485
then/</</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:678
fire@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:796:281
add@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:797:467
then/</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:631
each@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:625:758
then/<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:553
Deferred@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:803:189
then@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:518
start@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1024:102
OdooClass.extend/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3811:485
__widgetRenderAndInsert/<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3932:958
then/</</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:678
fire@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:796:281
add@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:797:467
then/</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:631
each@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:625:758
then/<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:553
Deferred@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:803:189
then@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:518
__widgetRenderAndInsert@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3932:879
_renderFieldWidget@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1289:73
_renderFieldWidget@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1328:181
OdooClass.extend/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3811:485
_renderInnerGroupField@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1336:380
_renderInnerGroup/<@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1334:39
_.forEach@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:12:558
_renderInnerGroup@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1331:61
_renderTagGroup@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1343:237
_renderNode@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1337:237
_renderNode@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:2256:39
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3814:368
_.collect@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:13:270
_renderTagSheet@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1350:1143
_renderNode@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1337:237
_renderNode@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:2256:39
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3814:368
_.collect@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:13:270
_renderTagForm@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1343:16
_renderNode@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1337:237
_renderNode@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:2256:39
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3814:368
_renderView@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1350:1360
_render@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1288:173
start@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1072:330
OdooClass.extend/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3811:485
__widgetRenderAndInsert/<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3932:958
then/</</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:678
fire@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:796:281
add@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:797:467
then/</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:631
each@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:625:758
then/<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:553
Deferred@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:803:189
then@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:518
__widgetRenderAndInsert@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3932:879
appendTo@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3932:92
start@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1079:560
OdooClass.extend/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3811:485
start@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1260:1006
OdooClass.extend/</prototype[name]</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3811:485
__widgetRenderAndInsert/<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3932:958
then/</</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:678
fire@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:796:281
add@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:797:467
then/</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:631
each@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:625:758
then/<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:553
Deferred@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:803:189
then@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:518
__widgetRenderAndInsert@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3932:879
appendTo@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:3932:92
open/<@http://localhost:8069/web/content/818-7fceef4/web.assets_backend.js:1311:1
then/</</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:678
fire@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:796:281
add@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:797:467
then/</<@http://localhost:8069/web/content/812-3d76d10/web.assets_common.js:802:631`

@aab-odoo
Copy link
Contributor

@jbeficent @pedrobaeza

Sorry for the late reply.

I face the same issue if i don't define the list and form subviews inline in the main form view, but it works fine with inline views. This is a bug. I'll try to fix it this week.

Could you confirm that you can make it work using inline views?

Regards.

@pedrobaeza
Copy link
Collaborator Author

@jbeficent did you try this again?

@pedrobaeza
Copy link
Collaborator Author

@aab-odoo today I have experimented with this multi-level onchange, and even adding the o2m_2 with inline <tree> and <form>elements, I get weird behavior:

Selección_044

The form is saved without an error, but looking in the content, the records of the o2m_2 appears empty.

Any way, it's a pity also to require the inline view definition, as this kills in a practical way the inheritance possibilities (you have to explicitly add other fields to this inline view that other modules can add to the o2m_2 model).

Can you please check what is happening?

@pedrobaeza
Copy link
Collaborator Author

I think we should reopen this and extend it for newer versions.

@SimoRubi
Copy link
Contributor

I just tried the zipped module, had to change the version to 14.0.1.0.0 and add security rules:
ir.model.access.csv
After that, it looks like the behavior is the expected one:

You know, everything working correctly 😉

Peek 2021-06-17 12-43

@pedrobaeza
Copy link
Collaborator Author

Yes, there has been some improvements on the ORM side as well and now all should be handled correctly.

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

9 participants