Minor fix
This commit is contained in:
parent
e831f50010
commit
9fd22fea6a
18
sale.py
18
sale.py
|
@ -80,7 +80,17 @@ class Sale(metaclass=PoolMeta):
|
||||||
product_id = args['product']['id']
|
product_id = args['product']['id']
|
||||||
product = Product(product_id)
|
product = Product(product_id)
|
||||||
|
|
||||||
with Transaction().set_context(ctx):
|
context = {
|
||||||
|
'company': ctx['company'],
|
||||||
|
'currency': ctx['currency'],
|
||||||
|
}
|
||||||
|
price_list_id = None
|
||||||
|
price_list = args.get('price_list')
|
||||||
|
if price_list:
|
||||||
|
price_list_id = price_list['id']
|
||||||
|
context['price_list'] = price_list_id
|
||||||
|
|
||||||
|
with Transaction().set_context(context):
|
||||||
unit_price = product.list_price
|
unit_price = product.list_price
|
||||||
|
|
||||||
if args.get('quantity'):
|
if args.get('quantity'):
|
||||||
|
@ -88,11 +98,6 @@ class Sale(metaclass=PoolMeta):
|
||||||
else:
|
else:
|
||||||
quantity = 1
|
quantity = 1
|
||||||
|
|
||||||
if ctx.get('price_list'):
|
|
||||||
price_list_id = ctx.get('price_list')['id']
|
|
||||||
else:
|
|
||||||
price_list_id = None
|
|
||||||
|
|
||||||
percent_commission = 0
|
percent_commission = 0
|
||||||
if price_list_id:
|
if price_list_id:
|
||||||
price_lines = PriceListLine.search([
|
price_lines = PriceListLine.search([
|
||||||
|
@ -108,7 +113,6 @@ class Sale(metaclass=PoolMeta):
|
||||||
#ADD TAXES
|
#ADD TAXES
|
||||||
taxes_ids = [t.id for t in product.customer_taxes_used]
|
taxes_ids = [t.id for t in product.customer_taxes_used]
|
||||||
# res = cls.get_price_with_tax([line], ['amount_w_tax', 'unit_price_w_tax'])
|
# res = cls.get_price_with_tax([line], ['amount_w_tax', 'unit_price_w_tax'])
|
||||||
print('prueba.........')
|
|
||||||
res = {
|
res = {
|
||||||
# 'unit_price_w_tax': math.ceil(res['unit_price_w_tax'][None]),
|
# 'unit_price_w_tax': math.ceil(res['unit_price_w_tax'][None]),
|
||||||
# 'amount_w_tax': math.ceil(res['amount_w_tax'][None]),
|
# 'amount_w_tax': math.ceil(res['amount_w_tax'][None]),
|
||||||
|
|
Loading…
Reference in New Issue