I am doing:
line.sale_margin_percent = 100-((line.purchase_price*100)/line.price_unit)
Whe line.price_unit is 0 I get:
ZeroDivisionError: float division by zero
Which is the regular way to avoid that in python/odoo?
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 2/9/16, 10:47 AM|
|Seen: 1471 times|
|Last updated: 2/9/16, 1:31 PM|