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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
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.
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
3
سبتمبر 25
|
3182 | ||
|
0
أغسطس 25
|
743 | ||
|
1
أغسطس 25
|
2942 | ||
|
2
يوليو 25
|
8572 | ||
|
2
يوليو 25
|
4977 |
Hello Jan,
Do you have a solution for this ?
Thank you