Review: Needs Fixing

You replaced many (implicit) "write" by "onchange" methods calls.  That is 
nice, but those onchange method do not modify the database, hence they change 
the test.  For instance,

    self.onchange_user(cr, uid, [ref('hr_employee_mark')], 
ref('hr_users_markjohnson0'), None)

does *not* modify the record ref('hr_employee_mark').  It simply browses the 
user record to retrieve its email address, and returns a dictionary.  You may 
check the result by committing the tests in the database, and compare to what 
the trunk would commit.

To commit the effect, you have to simulate the user saving the form by calling 
write:

    res = self.onchange_user(cr, uid, [ref('hr_employee_mark')], 
ref('hr_users_markjohnson0'), None)
    values = dict([('user_id', ref('hr_users_markjohnson0'))] + 
res['value'].items())
    self.write(cr, uid, [ref('hr_employee_mark')], values, None)

Please fix it.

Thanks,
Raphael

-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-hr_yaml_coverage-uco/+merge/76727
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-hr_yaml_coverage-uco.

_______________________________________________
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