Review: Disapprove
Hi Guys,
Sorry but I need to disapprove this fix.
Example:
0. Modify account.move form view to show "balance" field (with will be updated
by "onchange_line_id" when modifing a new line)
1. Now considering an entry with two lines:
- name: test
debit: 0.0
credit: 3000.0
- name: test
debit: 300.0
credit: 0.0
2. A start balance will be 0.
* in GTK change first line "credit" to 2500.0
=> onchange will update balance to 500.0, which is *ok*
* in Web change first line "credit" to 2500.0
=> onchange will update balance to -2500.0, which is *wrong*
As of web v6.1, web client support sending only modified fields, this means
that if we edit an existing line (ex: only "credit"):
- web v6.1 will send
[(1, ID_LINE_1, {'credit': 2500.0}), (1, ID_LINE_2, False)]
- whereas in v6.0 or v6.1 gtk we will send
[(1, ID_LINE_1, {'debit': 0.0, 'credit': 2500.0, ....and all other
fields...}),
(1, ID_LINE_2, {'debit': 300.0, 'credit': 0.0, ...and all other
fields...})]
In that case, starting for v6.1 and for "onchange" on one2many fields we should
use "resolve_o2m_commands_to_record_dicts" to convert value from fields to dict
with full values.
So here:
line_ids = self.resolve_o2m_commands_to_record_dicts(cr, uid, 'line_id',
line_ids, context=context)
Cheers,
Xavier
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-579553-ado/+merge/126152
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.1-opw-579553-ado.
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp