【发布时间】:2020-06-08 12:36:59
【问题描述】:
如何计算(折扣=销售价格-单价) (1-price_unite/list_price)*100
【问题讨论】:
如何计算(折扣=销售价格-单价) (1-price_unite/list_price)*100
【问题讨论】:
请根据您的sale_price 和unit_price 制作一个可以计算 diccount 的计算函数。
@api.depends('unit_price', 'sale_price')
def compute_discount(self):
for rec in self:
rec.discount = (1-unit_price/sale_price)/100
如果我猜对了,您需要在 purchase.order.line 中添加此计算方法。
【讨论】: