add a new "merge_attributes" extension point to view inheritance system
Currently, there are 3 view extension points, "before", "after" and "replace" a given XML element of inherited view, for instance:
<field name="arch" type="xml">
<field name="invoiced" position="after">
</field>
However, often we would like to extend an existing view simply to change/extend some attributes of some inherited XML element. For instance:
- change on on_change signature to pass more parameters because we redefined/overrided the on_change method
- change some "attrs" attribute, for instance to change the condition to display/hide or make mandatory or not the element/field
- change the color of tree elements
- change an existing list view to editable or not
In the last 2 cases: "change the color of tree elements" and "change an existing list view to editable or not", this is currently very annoying to achieve. Why, because your can only do this be using replace and redefine the whole tree XML.
This is very weak toward future changes/bug fixes in the original XML, duplicate code and could even not work properly anymore when several extensions tries to alter the original tree XML.
That's why I suggest we add a new anchor called "merge_attribute". We would use it like:
<field name="arch" type="xml">
<field name="move_ids" position=
</field>
This would simply alter the orginal move_ids element and define/redefine the defined attributes here ("colors" and "editable"), keeping the other original attributes not defined here unchanged.
A very good example of module that would benefit from that is the mrp_prodlot_
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
-
Implemented
- Milestone target:
-
6.0
- Started by
- Raphaël Valyi - http://www.akretion.com
- Completed by
- Raphaël Valyi - http://www.akretion.com
Whiteboard
NB: a hugly workaround meanwhile: http://
Good progress, see related branch https:/
All right, I consider this done, see for example the position=