Check required Many2One against null only
0 is a valid required value for Many2One issue5373 review21831002
This commit is contained in:
1 parent
a94b436c9c
commit
cd965b2fb6
1 file changed
+10
@@ -1688,6 +1688,16 @@
|
||||
|
||||
Sao.field.Many2One = Sao.class_(Sao.field.Field, {
|
||||
_default: null,
|
||||
check_required: function(record) {
|
||||
var state_attrs = this.get_state_attrs(record);
|
||||
if (state_attrs.required == 1) {
|
||||
if ((this.get(record) === null) &&
|
||||
(state_attrs.readonly != 1)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
get_client: function(record) {
|
||||
var rec_name = record._values[this.name + '.rec_name'];
|
||||
if (rec_name === undefined) {
|
||||
|
||||
Reference in new issue
Block a user