Hello,
I've added an additional status (draft, sale, etc) to the state field of the sales order model and I would like to add it to the sales order form.
I am using the following xpath sequence to do so:
<xpath expr="//field[@name='state']" position="attributes">
<attribute name="statusbar_visible" >{new_status}</attribute>
</xpath>
The problem is that xpath replaces all the existing values (draft,sent,sale )of the attribut statusbar_visible !
I've searched over the net but I didn't found a way to add one attribute value to the existing ones.
Does anyone knows how I can do this (without hard coding the existing values in the xpath sequence) ?
Thanks !
HI Avinash and thank you for your answer!
I already extended the sale order model adding the new value to the state selection field.
I fully agree with you I can simply write all the standard attribute values plus my new one in the attribute field inside the xpath locator.
But if I do this, I am actually overriding the existing sale.order attribute values.
What I would like to do is just add my new value attribute to the others, so if one day Odoo decides to create a new state to this model I won't be overriding it without knowing
Do you think is there a way to insert a attribute value into the existing ones without overriding the whole statusbar_visible attributes?
Thank you!!
Reference: https://learnopenerp.blogspot.com/2018/01/inheritance-in-models-and-views.html