Fix
This commit is contained in:
parent
1106a077b4
commit
4946e090f2
5
sale.py
5
sale.py
|
@ -177,7 +177,6 @@ class Sale(metaclass=PoolMeta):
|
|||
User = Pool().get('res.user')
|
||||
context = Transaction().context
|
||||
today = date.today()
|
||||
print('>>>>>>>>', args)
|
||||
if context.get('shop'):
|
||||
shop = Shop(context['shop'])
|
||||
else:
|
||||
|
@ -212,15 +211,17 @@ class Sale(metaclass=PoolMeta):
|
|||
'price_list': shop.price_list,
|
||||
'payment_term': shop.payment_term.id,
|
||||
'state': 'draft',
|
||||
'order_status': 'commanded',
|
||||
'lines': [('create', args['lines'])],
|
||||
}
|
||||
if args.get('description'):
|
||||
to_create['description'] = args.get('description')
|
||||
try:
|
||||
sale, = cls.create([to_create])
|
||||
sale.set_number([sale])
|
||||
return sale.id
|
||||
except Exception as e:
|
||||
print(e, 'error')
|
||||
return {'ok'}
|
||||
|
||||
@classmethod
|
||||
def report_sales_day(cls, args, ctx):
|
||||
|
|
Loading…
Reference in New Issue