콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
2518 화면

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. 

아바타
취소
관련 게시물 답글 화면 활동
3
9월 25
3202
0
8월 25
762
1
8월 25
2971
2
7월 25
8598
2
7월 25
4999