Merge lp:~openerp/openobject-server/trunk-wip-niv into lp:openobject-server
Proposed by
Nicolas Vanhoren (OpenERP)
Status: | Merged |
---|---|
Merged at revision: | 3506 |
Proposed branch: | lp:~openerp/openobject-server/trunk-wip-niv |
Merge into: | lp:openobject-server |
Diff against target: |
28 lines (+15/-3) 1 file modified
openerp/osv/orm.py (+15/-3) |
To merge this branch: | bzr merge lp:~openerp/openobject-server/trunk-wip-niv |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vo Minh Thu (community) | Approve | ||
Review via email: mp+67297@code.launchpad.net |
Description of the change
Improved modifiers.
To post a comment you must log in.
Before merging, can you add test cases to the modifiers_tests() function?
I think you can reuse the modifiers variable instead of using a default_values intermediary variable. This would simplify the last loop a bit.
Some variable name consistency would be nice too. exceptions instead of modifs, (a, value) instead of (modif[0], modif[1]) and renaming a into attr, or attr in a.
default_values[a] = False
default_ values[ a] = bool(field.get(a))
if field.get(a):
can be simplified to
default_values[a] = bool(field.get(a))
field. get("states" ) or {}
can be just
field. get("states" , {})
At line 18, no need for parens.