Odoo Help

0

2
2 Answers
0
Dharmesh Rathod
2013/6/1 上午4:23

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

0
allanjm
2013/6/1 上午4:08
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)
Ask a Question
Writer
100
N
Keep Informed
0 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now