mirror of
https://github.com/NaN-tic/sao-base.git
synced 2023-12-14 03:13:01 +01:00
Check required Many2One against null only
0 is a valid required value for Many2One issue5373 review21831002
This commit is contained in:
parent
3a705ad3a5
commit
048b3c4986
10
src/model.js
10
src/model.js
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue