Thu 21 Apr 2016 03:38:35 PM UTC, comment #1:
Hi !
It really depends on the context. A lot of the data imported in GNU Health default modules is pretty much static (WHO essential meds, ICD10 dx codes, ICD9 procedures, disease genes ... ). Those are part of the system, and changing them by a user would suppose a risk.
Actually, I think that is a Tryton limitation, because currentlly modifying a record field coming from xml is an all-or-nothing task (if the field is declared on the xml file, then becomes non-modifiable).
This is what I propose :
In the XML file, we can include a new atribute (eg, "modifiable") for the xml element that allows to modify the specific field. This will provide maximum flexibility, on which fields can be modified and which can not.
In the example of the product associated to the WHO meds, this is the situation:
The list and cost prices associated to the product are required fields, so we need to include them in the xml datafile.
If we have include the new attribute :
<field name="list_price" eval="0.0" modifiable="1"/>
Then Tryton would allow the user to modify that specific field, and it will skip the value in the xml in the future (to avoid overriding the current value).
With this design, in the WHO med products example, we have both non modifiable fields (medicament product name, category, ... ) and modifiable fields (prices). All of this while keeping data in XML format, which is the best way.
I will create a proposal in Tryton for this.
Bests,
|