minor fix
This commit is contained in:
parent
9f8aa2a998
commit
866538f787
5
sale.py
5
sale.py
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue