[6.1] account_voucher : onchange_partner_id method call to fix in few modules

Bug #847630 reported by Yannick Vaucher @ Camptocamp
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
OpenERP Publisher's Warranty Team

Bug Description

Hello,

In 6.1, the signature of the voucher method onchange_partner_id changed.
"currency_id" has been replaced by "voucher_currency_id"
Then following modules must be updated:

l10n_ch
account_payment
account_coda_import

A patch proposal to change calls in those modules is attached.

An other option could be to recover the preview signature for compatibility reasons.
And to keep clarity in the code, doing a simple copy of in parameter currency_id into the voucher_currency_id variable.

Regards,
Yannick

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :
Changed in openobject-addons:
status: New → Fix Committed
Amit Parik (amit-parik)
Changed in openobject-addons:
status: Fix Committed → New
Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :
Download full text (3.8 KiB)

Still, calls and signature doesn't match. However, don't use my preview patch, it is inverted.

bzr revno openobject-addons/
5383
bzr revno openobject-server/
3768

[2011-10-18 07:04:30,964][test_voucher] DEBUG:tests.l10n_ch:Exception during evaluation of !python block in yaml_file .../openobject-addons/l10n_ch/test/l10n_ch_dta.yml.
Traceback (most recent call last):
  File ".../openobject-server/openerp/tools/yaml_import.py", line 426, in process_python
    unsafe_eval(code_obj, {'ref': self.get_id}, code_context)
  File ".../openobject-addons/l10n_ch/test/l10n_ch_dta.yml", line 13, in <module>
    account_id: account.a_pay
  File ".../openobject-addons/account_payment/wizard/account_payment_populate_statement.py", line 79, in populate_statement
    result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), voucher_currency_id= statement.currency.id, ttype='payment', date=line.ml_maturity_date, context=context)
TypeError: onchange_partner_id() got an unexpected keyword argument 'voucher_currency_id'
[2011-10-18 07:04:30,965][test_voucher] ERROR:tests.l10n_ch:onchange_partner_id() got an unexpected keyword argument 'voucher_currency_id'
Traceback (most recent call last):
  File ".../openobject-server/openerp/tools/yaml_import.py", line 740, in process
    self._process_node(node)
  File ".../openobject-server/openerp/tools/yaml_import.py", line 755, in _process_node
    self.process_python(node)
  File ".../openobject-server/openerp/tools/yaml_import.py", line 426, in process_python
    unsafe_eval(code_obj, {'ref': self.get_id}, code_context)
  File ".../openobject-addons/l10n_ch/test/l10n_ch_dta.yml", line 13, in <module>
    account_id: account.a_pay
  File ".../openobject-addons/account_payment/wizard/account_payment_populate_statement.py", line 79, in populate_statement
    result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), voucher_currency_id= statement.currency.id, ttype='payment', date=line.ml_maturity_date, context=context)
TypeError: onchange_partner_id() got an unexpected keyword argument 'voucher_currency_id'
[2011-10-18 07:04:30,965][test_voucher] ERROR:init.test:Tests failed to execute in module l10n_ch
Traceback (most recent call last):
  File ".../openobject-server/openerp/modules/loading.py", line 100, in load_test
    _load_data(cr, module_name, idref, mode, 'test')
  File ".../openobject-server/openerp/modules/loading.py", line 135, in _load_data
    tools.convert_yaml_import(cr, module_name, fp, idref, mode, noupdate)
  File ".../openobject-server/openerp/tools/yaml_import.py", line 805, in yaml_import
    yaml_interpreter.process(yaml_string)
  File ".../openobject-server/openerp/tools/yaml_import.py", line 740, in process
    self._process_node(node)
  File ".../openobject-server/openerp/tools/yaml_import.py", line 755, in _process_node
    self.process_python(node)
  File ".../openobject-server/openerp/tools/yaml_import.py", line 426, in process_python
    unsafe_eval(code_obj, {'ref': self.get_id}, code_context)
  File ".../openobject-addons/l10n_ch/t...

Read more...

Revision history for this message
qdp (OpenERP) (qdp) wrote :

err...

it's not the case (anymore?) in revision 5488 of trunk addons where currency_id is the arg received. I'm setting this bug as invalid.

Thanks

Changed in openobject-addons:
status: New → Invalid
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.