changeset a0e27be9082a in sao:default
details: https://hg.tryton.org/sao?cmd=changeset&node=a0e27be9082a
description:
        Use dictionary as domain for Reference field

        issue11074
        review383911002
diffstat:

 src/model.js |  10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r 3aed6c2db5e3 -r a0e27be9082a src/model.js
--- a/src/model.js      Thu Feb 03 22:27:19 2022 +0100
+++ b/src/model.js      Thu Feb 03 23:05:47 2022 +0100
@@ -2687,6 +2687,16 @@
         validation_domains: function(record, pre_validate) {
             return this.get_domains(record, pre_validate)[0];
         },
+        get_domains: function(record, pre_validate) {
+            var model = null;
+            if (record._values[this.name]) {
+                model = record._values[this.name][0];
+            }
+            var domains = Sao.field.Reference._super.get_domains.call(
+                this, record, pre_validate);
+            domains[1] = domains[1][model] || [];
+            return domains;
+        },
         get_domain: function(record) {
             var model = null;
             if (record._values[this.name]) {

Reply via email to