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

Good morning,


I would like to add field that shows the total of the costs of only some of the prodcut of the quotations, for example:

line1: Solar panel Quantity: 2 Cost for each  panel:€100

line2: Battery Quantity: 1 Cost:€100

line3: Installation Quantity: 1 Cost: €50

I would like to add a field the shows only the total of the cost of the sum of line1 and line2.


I have two idea to achieve this:


1-Using Studio and Python code

I have added a field with studio and then in Property section--> Advanced I tried to write a code in Python. I am quite new to Python and it is not clear what to put in the dependencies section:

I have tried this code, but it is probably wrong:

for record in self:
    record.write({'x_studio_totale_costo_materiali': sum(rec.order_line.mapped('product_uom_qty')*rec.order_line.mapped('purchase_price'))})

Could you help me in anyway?


2- Using the new quote calculator spreadsheet:

I see that in Odoo 18 you can link a spreadsheet to crerate formulas for the product price.

I try to link a cell to a custom fields but it seems that the system only recognises the standard fields, so you can modify only the price of the product.

My idea is to create a cell with a formula.

Is there a way to link a cell to a custom field in the spreadsheet?


Thank you 

아바타
취소
관련 게시물 답글 화면 활동
0
5월 22
1782
1
4월 16
9005
0
5월 24
5
0
2월 24
972
0
5월 23
2245