Community mailing list archives

community@mail.odoo.com

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

by
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 <jon@willowit.com.au> 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




_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe