Hi, i am writing the create method of a sale order in a custom module. I want to get the order lines of this sale order in my method. How can i do that. I have heard about the "vals" parameters, but i dont know how to use it. Thanks !
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
2
Risposte
13822
Visualizzazioni
def create (cr, uid, vals, context=None)
#vals or values returns dictionary containing all the fields, so you can use it like this to assign new values
vals['field_name_1'] = new_value_1
vals['field_name_2'] = new_value_2
#or assign to a variable
var_1 = vals['field_name_1']
var_2 = vals['field_name_2']
return super(class_name, self).create(cr, uid, vals, context=context)
Hi,
def create(cr, uid, vals, context=None): if context is None: context = {} if vals.get('order_line'): #YOUR LOGIC# return super(CLASS, self).create(cr, uid, vals, context=context)
Email : info@acespritech.com
Skype : acespritech
Blog : acespritechblog.wordpress.com
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
1
dic 22
|
6231 | ||
|
0
set 17
|
3863 | ||
How to access the vals dict.
Risolto
|
|
4
set 15
|
7026 | |
|
2
gen 23
|
14635 | ||
|
1
ago 16
|
10552 |