when nested o2m are there. `New` for o2m does not work when o2m-level>1 in first go (when parent is not saved yet)

Bug #733089 reported by ksh (Axelor)
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Web Client
Status tracked in 6.0
6.0
Fix Committed
Low
Unassigned
Trunk
Fix Released
Low
Unassigned

Bug Description

Hello,

When we have nested o2m in an object, and assuming we are not saving parent record manually and no o2m is inline-editable.
on click of `New` for first-level o2m (say X) works fine, and opens empty-X-form in frame dialog
now in X's form, for second-level o2m (say Y) when we click on `New`, it saves X(means its parent) but could not open Y's form in first click. but once X is saved (manually or indirectly), we can create Y successfully.

Some fields of DOM could not be find in `edit` function of `One2Many` javascript class in first go when o2m-level>1.
you can test this in Human Resources -> Configuration -> Payroll -> Salary Structure (to test no o2m should be inline editable)

Note: this bug exist in web-client-trunk

Related branches

Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :

Thanks For Reporting.

Changed in openobject-client-web:
assignee: nobody → OpenERP SA's Web Client R&D (openerp-dev-web)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Jiten (OpenERP) (jiten-openerp) wrote :

Thanks for reporting this, I have tested as your description for nested o2m and faced the same problem.

I have tested with,
Sales > Configuration > Pricelists >New (Create new record) > New (Pricelist Version) > New (Products Listprices Items)
- Now first click on button "New" it saves the parent record but could not open next form And it opens after second click.

So, I have fixed this problem with revision number 4635 in dev branch like,
lp:~openerp-dev/openobject-client-web/trunk-bug-733089-jra .

Revision info:
4635 <email address hidden>

Changed in openobject-client-web:
status: Confirmed → Fix Committed
Revision history for this message
Krisztian Eyssen (eyssen) wrote :

Hi

This commit doesn't work in 6.0 branch

If i uncomment this lines it resolve the problem
http://bazaar.launchpad.net/~openerp/openobject-client-web/6.0/revision/4566

Revision history for this message
Krisztian Eyssen (eyssen) wrote :

This is my patch for 6.0 branch

Revision history for this message
Sananaz (Open ERP) (sma-tiny) wrote :

Hello NOVOTRADE RENDSZERHÁZ,

Yes you are right, your patch is correct.
Current code creates problem and we have already sent merge proposal for the same.

The fix for web-client has been committed to lp:~openerp-dev/openobject-client-web/6.0-opw-5073-sma
with the following revision.

Revision-info:
4575 <email address hidden>

Soon it will be merged into stable web-client branch.

Thanks for reporting!

Revision history for this message
Jiten (OpenERP) (jiten-openerp) wrote :

Hello NOVOTRADE RENDSZERHÁZ,

Your patch as #4 (in which my changes are reverted) is not correct for nested o2m case, Its create a problem to load new o2m form.

Please try and check the behaviour as under,

Sales > Configuration > Pricelists > New (Products Price List)> New (Pricelist Version) > New (Products Listprices Items).

There should be open New form of Products Listprices Items on First click only.
But its save the parent record and do nothing for expected New Form open Because,
it does not find the value of terp_id, terp_model, terp_view_mode, etc..

So that changes are needed and Yes after that changes in revision 4566, the problem faced with only view_mode which is solved in sma's branch as #5.

So, both changes are needed for the nested o2m case and it works fine.

Thanks !

Revision history for this message
Krisztian Eyssen (eyssen) wrote :

Hi Jiten,

Yes you are right!

If I apply this two patch it resolve the problem.

http://bazaar.launchpad.net/~openerp/openobject-client-web/6.0/revision/4566
http://bazaar.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-5073-sma/revision/4575

If you add my two patch you get the same code

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.