Community mailing list archives

community@mail.odoo.com

RE: V8 New API questions

by
hans.yonathan
- 11/25/2014 20:58:39

For frozen dict, I manage it by copy the context and used the new one.

 

Thank You.

 

Best Regards,

Hans Yonathan

Odoo Support

FALINWA Limited

Expert in Finance, Information System & Business Intelligence

Odoo Silver Partner

Website: www.falinwa.com

Tel. 13670137019 (China - Shenzhen)

 

From: Jos De Graeve [mailto:jos.degraeve@apertoso.be]
Sent: Tuesday, November 25, 2014 8:43 PM
To: Community
Subject: V8 New API questions

 

Hi,

I have two questions about the new on-change api:

 

How would one implement functionality like the "warning" module with the new API: https://github.com/odoo/odoo/blob/8.0/addons/warning/warning.py#L56

Is it required to override the 'onchange' method
https://github.com/odoo/odoo/blob/8.0/openerp/models.py#L5700 or is there another way to do this?

The env.context dictionary is a frozen dict, is there still a way to insert the context with a variable ?  I wanted to use the on-change api to set a new default value in the context.

My use case is sale order line entry: when a user creates a new order line and changes a certain field, a new default value is set in the context, so that the next created order line would have the same value as entered in the previous order line.

 

Tnx,


Jos De Graeve - Apertoso business ICT

 

 

Guido Gezellelaan 16 - B-9800 Deinze - Belgium

 

Direct: +32 9 381 64 51

General:+32 9 381 64 50

Mobile: +32 475 54 68 80

mail/im/skype: Jos.DeGraeve@apertoso.be - apertoso

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