Contributors mailing list archives


Re: How to update field context by xml

by Jay Vora <> - 10/04/2017 20:59:24

Use the context itself but another key like special, and/or give your view a priority, and/or a dummy field in XML to handle the value. Then possibly a trick of onchange n attrs to alter behavior.


On Apr 11, 2017 12:23 AM, "Alex Comba" <> wrote:
Hi everyone,

in a module I'm developing I would need to set a default on the invoice line getting value from partner. To do this I set context on invoice_line_ids field as follows:

          <xpath expr="//field[@name='invoice_line_ids']" position="attributes">
                <attribute name="context">{'partner_id': partner_id}</attribute>

Unfortunately, in the customer database is installed another module (on which I cannot depend) that overwrites the context of the same field and the result is that partner_id is overwritten at all.

A quick and dirty solution could be create a bridge module that passes to the field context all the values added by two modules.

Anyone knows if there is a cleaner way to update the context by xml? 

Any feedback would be very appreciated.

Thank you in advance,


Post to: