[WISH] please add __hash__ to browse_null
Bug #1235194 reported by
Holger Brunn (Therp)
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
New
|
Undecided
|
Unassigned |
Bug Description
Given that browse_record implements __hash__, we can use them securely as indices for dictionaries.
Unfortunately, in cases where the relevant field can be null, we get different dict-entries for every browse_null record we stick into the dict because then we have the standard hash function for objects. And probably we want the null case end up in the same dictionary entry.
Adding a simple
def __hash__(self):
return 0
to browse_null would fix this problem and we never would have to worry about fields being null in this context.
Please give your opinion about this one, if positive I'll provide the relevant merge requests.
To post a comment you must log in.