Add "true margin" to products XLSX export
This commit is contained in:
parent
85166d5beb
commit
e7871380a9
|
@ -663,6 +663,7 @@ class ProductView(MasterView):
|
|||
fields.append('vendor_name')
|
||||
fields.append('vendor_item_code')
|
||||
fields.append('unit_cost')
|
||||
fields.append('true_margin')
|
||||
|
||||
return fields
|
||||
|
||||
|
@ -724,6 +725,11 @@ class ProductView(MasterView):
|
|||
if 'unit_cost' in fields:
|
||||
row['unit_cost'] = product.cost.unit_cost if product.cost else None
|
||||
|
||||
if 'true_margin' in fields:
|
||||
row['true_margin'] = None
|
||||
if product.volatile and product.volatile.true_margin:
|
||||
row['true_margin'] = product.volatile.true_margin
|
||||
|
||||
return row
|
||||
|
||||
def get_instance(self):
|
||||
|
|
Loading…
Reference in a new issue