# Domain not updated

**URL:** https://discuss.tryton.org/t/domain-not-updated/1407
**Category:** Developer
**Created:** [May 22, 2019, 7:51am UTC](https://discuss.tryton.org/t/domain-not-updated/1407 "2019-05-22T07:51:39Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![prak](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/prak/32/321_2.png) [@prak](https://discuss.tryton.org/u/prak)
#### Post date: [May 22, 2019, 7:51am UTC](https://discuss.tryton.org/t/domain-not-updated/1407/1 "2019-05-22T07:51:39Z")

</div>

I am trying to update the domain in windows action. The issue is that if I try to update it from the UI, then since the record is created using XML, it is considered as a part of base configuration and is not updated further.

If I am trying to update it from the XML file, the system says that it can not be updated because it has been changed. However, the notation of the domain gets changed from to a detailed pyson notation in the database.

Is there any solution / workaround to work on the same.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [May 22, 2019, 8:16am UTC](https://discuss.tryton.org/t/domain-not-updated/1407/2 "2019-05-22T08:16:14Z")

</div>

Normally updating from XML should work. Be sure before the update that the model data are all synchronized.

---

<div class="post-metadata">

### Author: ![prak](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/prak/32/321_2.png) [@prak](https://discuss.tryton.org/u/prak)
#### Post date: [May 22, 2019, 8:42am UTC](https://discuss.tryton.org/t/domain-not-updated/1407/3 "2019-05-22T08:42:45Z")

</div>

The reason that it does not work is due to the fact that the domin in the XML file is written something like this -

[‘OR’, [‘establishment.admin’, ‘=’, Get(Eval(‘user’, {}), ‘employee’, None)], [‘establishment.admin’, ‘=’, Eval(‘employee’, {})]]

When I checked in the database, it gets converted to -

[“OR”,[“establishment.admin”,“=”,{“ **class** ”:“Get”,“v”:{“ **class** ”:“Eval”,“v”:“user”,“d”:{}},“k”:“employee”,“d”:null}],[“establishment.admin”,“=”,{“ **class** ”:“Eval”,“v”:“employee”,“d”:{}}]]

So when I run the trytond-admin to update the database, it gives me the following warning -  
WARNING trytond.convert Field domain of 195@ir.action.act\_window not updated (id: act\_xxxxx\_department), because it has changed since the last update

I guess that because the domain gets converted into Pyson way of writing the domains, the system treats it as if the domain has been updated.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [May 22, 2019, 9:05am UTC](https://discuss.tryton.org/t/domain-not-updated/1407/4 "2019-05-22T09:05:21Z")

</div>

Normally, it is the encoded format that is used for comparison. But I think the problem is the key sorting.  
I filled [Sort keys of PYSON XML value (#8369) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue8369)

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [May 23, 2019, 7:23am UTC](https://discuss.tryton.org/t/domain-not-updated/1407/5 "2019-05-23T07:23:09Z")

</div>

Please, can you confirm that the issue fix your problem?

---

<div class="post-metadata">

### Author: ![prak](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/prak/32/321_2.png) [@prak](https://discuss.tryton.org/u/prak)
#### Post date: [May 24, 2019, 10:02am UTC](https://discuss.tryton.org/t/domain-not-updated/1407/6 "2019-05-24T10:02:24Z")

</div>

To fix the issue as of now, I marked the flag “noupdate” in ir\_model\_data by looking for the fs\_id. And then updated the record from front end.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [May 24, 2019, 10:03am UTC](https://discuss.tryton.org/t/domain-not-updated/1407/7 "2019-05-24T10:03:29Z")

</div>

What about the patch?

---

<div class="post-metadata">

### Author: ![prak](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/prak/32/321_2.png) [@prak](https://discuss.tryton.org/u/prak)
#### Post date: [June 4, 2019, 7:58am UTC](https://discuss.tryton.org/t/domain-not-updated/1407/8 "2019-06-04T07:58:11Z")

</div>

@ced The patch did not work. It still shows the same error.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [June 4, 2019, 8:23am UTC](https://discuss.tryton.org/t/domain-not-updated/1407/9 "2019-06-04T08:23:12Z")

</div>

I think you have to force the data update from the administration menu. Both formats should be regenerated in order to be normalized.  
Indeed the best way to test is to start with a clean database and redo the workflow.

---

<div class="post-metadata">

### Author: ![prak](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/prak/32/321_2.png) [@prak](https://discuss.tryton.org/u/prak)
#### Post date: [June 4, 2019, 8:26am UTC](https://discuss.tryton.org/t/domain-not-updated/1407/10 "2019-06-04T08:26:35Z")

</div>

> [@ced](#):
>
> I think you have to force the data update from the administration menu. Both formats should be regenerated in order to be normalized.

This is something that I am doing as of now to run the system. But it is not a very clean workaround.

> [@ced](#):
>
> Indeed the best way to test is to start with a clean database and redo the workflow.

This is not a possibility if the server is up and running.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [June 4, 2019, 8:36am UTC](https://discuss.tryton.org/t/domain-not-updated/1407/11 "2019-06-04T08:36:32Z")

</div>

No patch will fix corrupted data. The goal of the change is to prevent future issue with the same pattern.
