Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
2468 มุมมอง

Hi 


I would like to replace the value of the "Expected revenue" when a quotation exists.

If a quotation exists I would like to show the "untaxed amount" of the last created quotation in the "expected revenue" field.


Thanks for your help.


Jan

อวตาร
ละทิ้ง

Hello Jan,

Do you have a solution for this ?

Thank you

คำตอบที่ดีที่สุด

Hi Jan,

Try this example code 

class CRMleadInherit(models.Model):
_inherit='crm.lead'

amount = fields.Float(compute='_compute_expected_revenue', store=True)

@api.depends('order_ids')
def _compute_expected_revenue(self):
for rec in self:
if rec.order_ids:
last_quotation = rec.order_ids[0]
rec.amount = last_quotation.amount_untaxed
else:
rec.amount = 0.0

​Here in this field amount have the calculation that you needed


Regards

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Julien

No not yet... 

We asked our Odoo partner to have a look at this, because they did some programming on top of this field. 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.ย. 25
3179
0
ส.ค. 25
737
1
ส.ค. 25
2933
2
ก.ค. 25
8564
2
ก.ค. 25
4967