Hi, everyone!
Two Error Dialog will pop up when I create Sale Orders (sale.order) on my Odoo 10 service
No. 1
-----
ValueError: <type 'exceptions.NameError'>: "name 'self' is not defined" while evaluating u'
sale_obj = self.pool[\'sale.order.line\']
sale_list = sale_obj.search(cr,uid,[(\'order_id\',\'=\',object.name)],context=context)
if sale_list:
for line in sale_list:
product_type = sale_obj.browse(cr,uid,line).product_id.type
if product_type != \'service\':
product_uom_qty = sale_obj.browse(cr,uid,line).product_uom_qty
qty_delivered = sale_obj.browse(cr,uid,line).qty_delivered
if product_uom_qty != qty_delivered:
self.write(cr, uid, object.id, {"x_stock":\'1\'}, context=context)
break
else:
self.write(cr, uid, object.id, {"x_stock":\'2\'}, context=context)
else:
self.write(cr, uid, object.id, {"x_stock":\'2\'}, context=context)
else:
self.write(cr, uid, object.id, {"x_stock":\'3\'}, context=context)
'
No. 2
-----
ValueError: <type 'exceptions.NameError'>: "name 'self' is not defined" while evaluating u"
product_type = object.product_id.type self.write(cr,uid,object.id,({'x_type':product_type}),context=context)
"
"x_stock" is a custom field in model "sale.order". Meanwhile, "x_type" is a custom field in model "sale.order.line".
These two block of python code which following "ValueError" didn't find in the source code of Odoo 10. So, these codes have been stored in PostgreSQL?
Are there anyone can give me some advises to fix it?
do you have sale_order in your module dependency ?
I didn't find the module which Technical Name is "sale_order" in the addons folder. However, there is a similar one which Name is "sale_order_dates". The issue should be fixed if I install it?