Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

You need to be registered to interact with the community.
This question has been flagged
1 Reply
53 Views

How to create

How to define / setup in odoo

Avatar
Discard
Author Best Answer

Need to make sure the field type is the same. Also should define if a field used in calculation is blank / missing, to use default value. 

If you want to use this on a report, needs to be indexed. If you want to use this on report and "Sum" of that filed on the report / list, then you need to store field. If field is stored, it won't calculated unless one of the input fields is changed. 


Define section: 

product_uom_qty, x_stndpricestockmove


Compute section: 

for record in self:

    if not record.product_uom_qty:

        record['x_totalcostsm'] = 0.00

    else:

        record['x_totalcostsm'] = record.product_uom_qty * record.x_stndpricestockmove




Avatar
Discard