Merge lp://staging/~openerp-dev/openobject-client-web/6.0-opw-578024-xal into lp://staging/openobject-client-web

Proposed by Xavier ALT
Status: Needs review
Proposed branch: lp://staging/~openerp-dev/openobject-client-web/6.0-opw-578024-xal
Merge into: lp://staging/openobject-client-web
Diff against target: 32 lines (+7/-3)
1 file modified
addons/openerp/static/javascript/form.js (+7/-3)
To merge this branch: bzr merge lp://staging/~openerp-dev/openobject-client-web/6.0-opw-578024-xal
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+119368@code.staging.launchpad.net

Description of the change

Hi,

This fix a silent failure in eval_domain_context_request() when create a new o2m record on an unsaved parent (and that unsaved parent is also a one2many).

If you have view hierarchy like this:

- root object (form)
  - sale_order_ids field (one2many => ...)
    - line_ids field (one2many => ...)
      (with attrs like context="{'default_name': name, 'form_view_ref': 'customz.my_beautiful_form_view'}")

Steps:
- we create a root object
- we click on create from "sale_order_ids" field
  (this save the parent "root object" - then open a popup window for "sale_order_ids" form view)
- we click on create from "line_ids" field
  (this save the parent "sale_order_ids" - then open a popup window for "line_ids" form view)

Current: we get standard form view of "line_ids", name is unfilled
Expected: as per context, we should get "a beautiful view" and name should be filled

NOTE: The problem is that when saving "sale_order_ids" parent - resulting view doesn't containt "_terp_editable" field, getFormData() then believe we're not editable and doesn't add any field value. We simple get the "_terp_editable" from the widgets one.

Regards,
Xavier

To post a comment you must log in.

Unmerged revisions

4878. By Xavier ALT

[FIX] web: correctly get if view is editable when _terp_editable is prefixed by o2m widget name

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.