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