use context {'default_FIELD': ...} on action raise Integrity Error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
affects openobject-server
Version affected:
OpenObject Server 5.0 (stable) - lastest revision id
Steps to reproduce the problem:
1. Modify action related on menuitem Partner > Partner).
Change context from {} to {'default_name': False}
res.partner have field 'name' with required=True
2. Try to create a new partner.
3. It raise:
Integrity Error
ERREUR: une valeur NULL viole la contrainte NOT NULL de la colonne
« name »
Problem is, default_get() from orm_memory class is managing default
value correctly:
server/
...
1615 # get the default values from the context$
1616 for key in context or {}:$
1617 if key.startswith(
fields_list):$
1618 value[key[8:]] = context[key]$
1619 return value$
...
But default_get() from orm class is not:
server/
...
2203 for key in context or {}:$
2204 if key.startswith(
2205 value[key[8:]] = context[key]$
2206 return value$
...
See patch attached which fixed the problem for me :)
--
Xavier ALT
AJM Technologies S.A.
22, rue Goethe / L-1637 Luxembourg
Related branches
Changed in openobject-server: | |
status: | New → Confirmed |
It has been corrected by revision 1956 <email address hidden>.
Thank you for pointing out and the patch.