[Trunk/7.0] Journal entry: Cannot read property 'id' of null

Bug #1182101 reported by Lorenzo Battistini
186
This bug affects 34 people
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
High
OpenERP Publisher's Warranty Team

Bug Description

openobject-addons/7.0 revno 9141
openerp-web/7.0 revno 3932

 - Go to http://7-0-11259.runbot.openerp.com/
 - Go to 'journal entries'
 - Click on 'create'
 - Select a journal
 - 'Add an item'
 - Fill 'name' field
 - Hit TAB until the end of the line

Get

Uncaught TypeError: Cannot read property 'id' of null
http://7-0-11259.runbot.openerp.com/web/webclient/js?db=7-0-11259-all:3777

and

Uncaught Error: Object can not be converted to JSON
http://7-0-11259.runbot.openerp.com/web/webclient/js?db=7-0-11259-all:2827

Tags: maintenance

Related branches

summary: - Journal entry: Cannot read property 'id' of null
+ [Trunk/7.0] Journal entry: Cannot read property 'id' of null
Changed in openerp-web:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
Changed in openerp-web:
assignee: OpenERP R&D Web Team (openerp-dev-web) → Nicolas (OpenERP) (niv-openerp)
Revision history for this message
Darshan Kalola(OpenERP) (dka-openerp) wrote :

Hello,

                It has been Fixed in https://code.launchpad.net/~openerp-dev/openerp-web/7.0-bug-1182101-darshan

                revision-id : <email address hidden>

                revno : 3937

Thanks,
Darshan

Changed in openerp-web:
status: Confirmed → In Progress
Changed in openerp-web:
status: In Progress → Fix Committed
Revision history for this message
Lara (Therp) (lfreeke) wrote :

Hello,

I tested the fix and it is working.

Thanks

Revision history for this message
AlGaTTaS (algattas) wrote :

me also

Revision history for this message
Alexandre Allouche (alexandre-allouche) wrote :

Hello,

I just tested it in runbot (build 11981) and it is not fixed.
You can try any journal entry on any journal.

I used journal MISC with only a name, an account and a debit amount.
keying [enter] or tabing until the end of the line will produce the same error.

By the way, it seems to be a regression as I cannot reproduce it on revision 3850 and I already encounted the issue on revision 3932.

Hope this helps

Revision history for this message
AlGaTTaS (algattas) wrote :

sorry.. it not fixed in the last version openerp_7.0-20130528-231047-1.tar.gz

Revision history for this message
Jad Tabet (jtabet) wrote :

Still not fixed, we are facing the issue also.

Revision history for this message
Lorenzo Battistini (elbati) wrote : Re: [Bug 1182101] Re: [Trunk/7.0] Journal entry: Cannot read property 'id' of null
hiren (hiren-6)
Changed in openerp-web:
status: Fix Committed → Fix Released
Revision history for this message
hiren (hiren-6) wrote :

Oops, mistakely changed the status to fix committed thinking the link gives me more information about that state, and surprised it allowed me to change it anyway, can't seem to move it back, so fix is not released, sorry about this.

Changed in openerp-web:
status: Fix Released → Fix Committed
Revision history for this message
jeffery chen fan (jeffery9) wrote :

in reversion 3931, Xavier remove the pyobject. toJSON implementation.
but why do that ?

Changed in openerp-web:
importance: Medium → High
status: Fix Committed → Confirmed
Changed in openerp-web:
assignee: Nicolas V.(OpenERP) (niv-openerp) → Xavier (Open ERP) (xmo)
Changed in openerp-web:
status: Confirmed → In Progress
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Issue should be resolved in the latest 7.0 revision (<email address hidden>), do note if the problem is not or not fully resolved.

Changed in openerp-web:
status: In Progress → Fix Released
Revision history for this message
Alexandre Allouche (alexandre-allouche) wrote :

Hi,
This fix seems to have unexpected side effects in other situations.
The primary issue reported here is properly fixed.

Now, in some cases, on a one2many dropdown in a editable listview, I get this error :
Uncaught TypeError: Cannot read property 'constructor' of null

To reproduce :
- have openerp-web on revision 3985
- go to human ressources / expenses / expenses
- create
- add an item
- use the article dropdown to raise the error (no error server side)

Sorry for being able to investigate any further. As far as I'm concerned, using both journal entries and expenses, the last working revision is 3930 :/

Revision history for this message
Alexandre Allouche (alexandre-allouche) wrote :

About comment #13
I meant a many2one dropdown list of course...

Revision history for this message
Alexandre Allouche (alexandre-allouche) wrote :

everything fine in rev 3092 \o/

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

Can you change the bug status as it is clearly not 'Fix Released' ?

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

Even if the merge proposal has been rejected, this bug does not occur with the latest revision.

It would have been nice to get the branch fixing this bug attached to it.

Revision history for this message
gonzalezmfrank@gmail.com (gonzalezmfrank) wrote :

Sorry, but the message is still on the last repo ....

Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello,

As per the bug reported on lp:1245451 , I have checked this again, And Still I am facing this error. So, I am reopening it with my attached video.

Thanks.

Changed in openerp-web:
status: Fix Released → Confirmed
Revision history for this message
Michel Meyer (michel-b) wrote :

Hi,

After some investigations, the problem seems to come from One2ManyListView Widget and can affect any modules I think.

Bug description:

In short words, after that a one2manylist row has been saved and the next one is initialized, one2many list will listen to blurred event and call cancel_editor() too early.

Event sequences:

1. One2ManyListView listenTo "edit:before"

2. ListView:start_edition > ensure_saved() > deferrer resolved > call with_event(edit) > fire "edit:before"
// at this time, the editor.record is not yet set, it will be done in with_event callback...

3. One2ManyListView catch "edit:before" event, then bind _on_form_blur to "blurred" event from editor.form

4. FormView:widgetBlurred fire the "blurred" event

5. One2ManyListView catch "blurred" and _on_form_blur is called

6. One2ManyListView call cancel_edition()

7. ListView:cancel_edition: call editor.cancel()

8. Editor:cancel resolve a deferrer with this.record value (but this.record == null)

9. ListView:cancel_edition: at deferrer resolving, try to get attr.id from the resolve parameter... but attr == editor.record == null

Solution:

One2ManyListView listen to "blurred" only when "editor:after" has been fired, instead of "editor:before".
It works when I test it manually, but I'm not a core expert, please check my solution and see if there's no side effects.

The patch is attached to this post.

Changed in openerp-web:
assignee: Xavier (Open ERP) (xmo) → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Revision history for this message
Scribder (scribder) wrote :

Hi Dear Community,

Actually im still facing the same issue, and none of the patches proposed are working for me.

But i have a remarque here, the Edit in One2many widget is working fine in Mozilla but not in Chrome.

My Mozilla version is : 24.0
My Chrome Version is : 30.0.1599.101 m

I have tested that many times in Mozilla and its working fine. but never in Chrome.

Thanks,

Revision history for this message
Scribder (scribder) wrote :

Hi Michel Meyer,

/!\ Sorry P.A . : 'i didn't reload the application in my browser' /!\

Actually the Patch in comment #20 is working Perfect for me, it fixed the issue in Chrome and it still working in Mozilla also.

Thanks for the patch, Hope others can test it to marque it as Fixed.

'Im not deleting my first comment, to let others know, there was different result between Chrome & Mozilla"

Thanks Again.

Revision history for this message
Mohammed Shekha(Open ERP) (msh-openerp) wrote :

Hello all,

The issue is from editable list with TAB key and anf form-blur event, _on_form_blur(view_form.js line no.3975) called two times, one with last element of form and one form-blur.

Ignored blur event through keydown_TAB on last element and let edition form-blur do the job.

Hope this will help.

Thanks.

Changed in openerp-web:
status: Confirmed → Fix Committed
Revision history for this message
Jean-Michel (jeanmichel-awad) wrote :

Hello,

Is this fix can be commited as soon as possible ?

This fix is not in the latest nightly openerp 7 version.

Thank you.

Revision history for this message
Jean-Michel (jeanmichel-awad) wrote :

Oops sorry i just changed the status of this bug accidentally to (Fix Commited)...

I need an admin to put back the rignt status...

Really Sorry...

Changed in openerp-web:
status: Fix Committed → Fix Released
Changed in openerp-web:
status: Fix Released → Fix Committed
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Michel Meyer's patch has been merged into 7.0, it should make its way to saas branches and trunk over time. Thank you for the help Mr Meyer.

Changed in openerp-web:
status: Fix Committed → Fix Released
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.