I would like to know when we create some records in a XML file inside a module, for example adding some ir.trigger events or some default products, and we modify this data after the module was activated, the DB needs to be updated with a manual update like:
trytond-admin -c config -u module_name -d db_name
Sometimes the XML new data gets updated to their respective models, and sometimes they don’t and one have to go into Administration->Models->Models->Data and look for “out of sync” resources and manually click on “Sync” to synchronize them.
So what I would like to know is under what conditions do these resources requires the manual Sync and when do they update automatically?
If you want to avoid such issue, you must never remove any <field/> declaration because trytond could not compare with something that does not exist anymore.
Thanks you for the hints. So in summary, to avoid the issue of manual sync we must for the XML data:
Avoid non-canonical data, i.e. if the field expects a “Decimal” then we do eval=“Decimal(‘1.00’)” instead of eval=“1.00”
Avoid removing declared <field/> on subsequent changes. But if they are removed because the model definition changed, then a manual sync is needed and unavoidable.