minor fix

This commit is contained in:
wilsongomez 2022-04-04 17:49:31 -05:00
parent 9f8aa2a998
commit 866538f787
1 changed files with 5 additions and 0 deletions

View File

@ -221,6 +221,11 @@ class Sale(metaclass=PoolMeta):
try:
sale, = cls.create([to_create])
sale.set_number([sale])
if sale.table_assigned:
ShopTable = Pool().get('sale.shop.table')
tables = ShopTable.search([('id', '=', sale.table_assigned.id)])
if tables:
ShopTable.write(tables, {'sale': sale.id, 'state':'occupied'})
return sale.id
except Exception as e:
print(e, 'error')