Community: Framework mailing list archives

expert-framework@mail.odoo.com

R: Set field attributes in views dynamically from python

by
Cristian Esposito
- 11/02/2016 05:16:26

The @api.one was the problem.

It seems that the @api.one can’t return the domain as this:

 

{‘domain’ : domain}

 

Thank you everybody for the help!

 

Cristian Esposito

347 5389673

 

Da: Adrian Enns [mailto:enns@guard-tec.de]
Inviato: giovedì 27 ottobre 2016 17:27
A: Community: Framework <expert-framework@mail.odoo.com>
Oggetto: Re: Set field attributes in views dynamically from python

 

http://odoo-new-api-guide-line.readthedocs.io/en/latest/decorator.html#warning-and-domain

 

@api.onchange

....

 

Warning and Domain

To change domain or send a warning just return the usual dictionary. Be careful not to use @api.onein that case as it will mangle the dictionary (put it in a list, which is not supported by the web client).


 

 

 

Immagine rimossa dal mittente.

GUARD-TEC
Christian-Lassen-Str. 9
53117 Bonn
Tel.:   0228 / 28 699 500
Mob.: 0176 / 62 31 08 25
Mail: enns@guard-tec.de
Web: www.guard-tec.de




Das Unternehmen GUARD-TEC ist eine Marke / Unternehmenszweig der "WEBER-TECH GROUP" und wird vertreten durch den Geschäftsinhaber Waldemar Weber. Gerichtsstand Bonn.



Privacy & Confidentiality Notice

The information contained in this e-mail is intended for the named recipients only. It may contain privileged and confidential information and if you are not the adressee or the person responsible for delivering this to the adressee, you may not copy, distribute or take action in reliance on it. If you have received this e-mail in error, please notify us immediately by returning the original message to the sender by e-mail.       

 

2016-10-27 12:17 GMT+02:00 Bohdan Lisnenko <lem8r.ka11a@gmail.com>:

Maybe set condition in domain?

 

2016-10-27 12:52 GMT+03:00 Cristian Esposito <cristian.esposito@hotmail.com>:

Hi,

 

i need to set a domain on a standard field many2one, based on change of a custom value.

Example:

@api.one
@api.onchange('flag_riordino_products')
def onchange_flag_riordino_products(self):
   
if self.flag_riordino_products: # if this flag == True: need to set domain
        # set domain
   
else:
       
# if the flag == False: no domain

Does someone have any idea?

 

Thanks a lot for your support

 

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

 

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

 

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