Review: Needs Fixing

I think this fix is too complex for its own good, and there is no reason to 
delay the default_get to happen within `this.ready` (even more so because until 
`default_get` is called *the widget is not ready*, so it's not correct) 
especially since it could happen in parallel with the (numerous) fields_get 
call necessary to correctly fill the autocompletion table.

I'd suggest the following changes:
1. perform a default_get call pushed into the `this.ready` queue right before 
the `fields_get` (at the end of `start`), this would have to be on all fields, 
but I would say it's not a huge issue (compared to the bunch of fields_get 
calls we have to do anyway), store just the field names from its result into an 
array (e.g. `self.fields_with_defaults`)
2. During the filtering to know which fields are required and which are not, 
just add a call to `_.difference`, to remove all fields with default values

Should be about 4 lines, something like that.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-871625-ysa/+merge/79073
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-bug-871625-ysa.

_______________________________________________
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

Reply via email to