This commit is contained in:
oscar alvarez 2022-04-04 08:18:43 -05:00
parent 1106a077b4
commit 4946e090f2
1 changed files with 3 additions and 2 deletions

View File

@ -177,7 +177,6 @@ class Sale(metaclass=PoolMeta):
User = Pool().get('res.user') User = Pool().get('res.user')
context = Transaction().context context = Transaction().context
today = date.today() today = date.today()
print('>>>>>>>>', args)
if context.get('shop'): if context.get('shop'):
shop = Shop(context['shop']) shop = Shop(context['shop'])
else: else:
@ -212,15 +211,17 @@ class Sale(metaclass=PoolMeta):
'price_list': shop.price_list, 'price_list': shop.price_list,
'payment_term': shop.payment_term.id, 'payment_term': shop.payment_term.id,
'state': 'draft', 'state': 'draft',
'order_status': 'commanded',
'lines': [('create', args['lines'])], 'lines': [('create', args['lines'])],
} }
if args.get('description'): if args.get('description'):
to_create['description'] = args.get('description') to_create['description'] = args.get('description')
try: try:
sale, = cls.create([to_create]) sale, = cls.create([to_create])
sale.set_number([sale])
return sale.id
except Exception as e: except Exception as e:
print(e, 'error') print(e, 'error')
return {'ok'}
@classmethod @classmethod
def report_sales_day(cls, args, ctx): def report_sales_day(cls, args, ctx):