Community mailing list archives

Re: Set custom domain when displaying existing record (when onchange is not triggered)

Open For Small Business Ltd, Graeme Gellatly
- 09/16/2015 03:56:14

If it is just a domain for search / constraints all I do is set a fake xml domain like (field, =, sol_o2m) .

Then use an override of search to test for it and transform it to the actual domain I want. 

It isn't exactly your use case but the concept will work. 

Sent from TypeMail

On 16 Sep 2015, at 6:07 PM, Jonathan Wilson <> wrote:
Hi Community

We have a need for a fairly complex domain on a many2one on sales order lines on the form view that pops up from sales order header.

While it can be easily calculated in one browse and lookup, it cannot be expressed in the xml. (The domain, in some cases, simply ends up being [('id', 'in', (x, y))]

This is triggered by onchanges and works well for new data, or when data changes.

However, when opening an existing line, the onchanges are not triggered.

Since the domain should be set for an existing record and there is no way to code it in to the default domain, is there a way we could cause the display of an existing record to trigger an onchange?  Even if I define a new invisible column on the view, I can not think of any way to get a new record to put a value in there to cause an onchange!

Thanks in advance.

Jonathan Wilson
ph: +61 3 8506 0393
mob: +61 4 000 17 444
2013 & 2015 Odoo Best Partner Asia/Pacific
Creators of  Odoo-Pentaho integration project

Post to: