add field base price for create_sale
This commit is contained in:
parent
277243943c
commit
a66265d40e
10
sale.py
10
sale.py
|
@ -62,6 +62,7 @@ class Sale(metaclass=PoolMeta):
|
||||||
if field_status_order:
|
if field_status_order:
|
||||||
line['status_order'] = 'requested'
|
line['status_order'] = 'requested'
|
||||||
line['unit'] = template.default_uom.id
|
line['unit'] = template.default_uom.id
|
||||||
|
line['base_price'] = line['unit_price']
|
||||||
line['description'] = template.name
|
line['description'] = template.name
|
||||||
taxes = list(template.account_category.customer_taxes_used)
|
taxes = list(template.account_category.customer_taxes_used)
|
||||||
taxes_ids = [t.id for t in taxes]
|
taxes_ids = [t.id for t in taxes]
|
||||||
|
@ -105,12 +106,13 @@ class Sale(metaclass=PoolMeta):
|
||||||
del v['total_amount']
|
del v['total_amount']
|
||||||
v['type'] = 'line'
|
v['type'] = 'line'
|
||||||
v['unit_price'] = round(Decimal(v['unit_price']), 4)
|
v['unit_price'] = round(Decimal(v['unit_price']), 4)
|
||||||
|
v['base_price'] = round(Decimal(v['unit_price']), 4)
|
||||||
product = Product(v['product'])
|
product = Product(v['product'])
|
||||||
|
|
||||||
if v.get('discount') and v['discount'] != '':
|
# if v.get('discount') and v['discount'] != '':
|
||||||
v['discount'] = Decimal(v['discount']) / 100
|
# v['discount'] = Decimal(v['discount']) / 100
|
||||||
elif v.get('discount'):
|
# elif v.get('discount'):
|
||||||
del v['discount']
|
# del v['discount']
|
||||||
|
|
||||||
template = product.template
|
template = product.template
|
||||||
cls._add_values(template, v, field_status_order)
|
cls._add_values(template, v, field_status_order)
|
||||||
|
|
Loading…
Reference in New Issue