class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
@api.multi
@api.onchange('product_id')
def product_id_change(self):
res = super(SaleOrderLine, self).product_id_change()
self.product_code=self.product_id.barcode
self.product_code_details=self.product_id.product_code
self.product_brand_line=self.product_id.brand
self.price_unit=self.order_id.partner_id.cost*self.product_id.list_price#This is not updating
print('RESSSSSSSSSS',self.price_unit)
return res
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
1
الرد
3122
أدوات العرض
Hello,
You Can Try This, May be It Will Help You.
print 'res'. Find your Field and Update that one. You Need To Update 'res' so Update res Dictionary, than your Problem was Solved.
res.update({'price_unit': self.order_id.partner_id.cost * self.product_id.list_price})
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيل