Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
2490 Vizualizări

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

Imagine profil
Abandonează

Hello Jan,

Do you have a solution for this ?

Thank you

Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

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. 

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
3
sept. 25
3184
0
aug. 25
746
1
aug. 25
2946
2
iul. 25
8579
2
iul. 25
4982