Account Voucher on_change_journal_voucher method ERROR

Bug #660907 reported by Jacara
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
Unassigned

Bug Description

When I set a journal on Account Voucher object then getting error message:

File "/home/jacara/Pydev-workspace/monoserp/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/home/jacara/Pydev-workspace/monoserp/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/home/jacara/Pydev-workspace/monoserp/osv/osv.py", line 57, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/jacara/Pydev-workspace/monoserp/osv/osv.py", line 140, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/jacara/Pydev-workspace/monoserp/osv/osv.py", line 130, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/jacara/Pydev-workspace/monoserp/osv/orm.py", line 2960, in read
    select = map(lambda x: isinstance(x, dict) and x['id'] or x, select)
  File "/home/jacara/Pydev-workspace/monoserp/osv/orm.py", line 2960, in <lambda>
    select = map(lambda x: isinstance(x, dict) and x['id'] or x, select)
KeyError: 'id'

addons revision 4332
server revision 2870

Revision history for this message
Jacara (baskhuujacara) wrote :

On Account Voucher view (xml_id = 'view_voucher_form') :

<field name="partner_id" required="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
                        <field name="journal_id" widget="selection" select="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>

param line_ids is missmatched to orm.read method.

On osv/orm.py line 2960 :
 The value of select variable is must be [23]
but this time :
 value of select is [{'date_due': False, 'name': u'SAJ/2010/001', 'date_original': '2010-10-15', 'move_line_id': 2, 'amount_unreconciled': 35000.0, 'amount': 0.0, 'type': 'cr', 'amount_original': 35000.0, 'account_id': 76}]
##

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hi,

It seems like working perfect with my code.
Can you recheck?

I am keen to know the steps you followed.
Thanks.

Changed in openobject-addons:
status: New → Incomplete
milestone: none → 6.0
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

Hello Jacara,

Would you please check with the latest code.
Currently I am closing this bug. You can reopen this with proper description and steps if you will face similar problem again.

Thanks.

Changed in openobject-addons:
importance: Undecided → Medium
status: Incomplete → 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.