Fix
This commit is contained in:
parent
1f2034fbec
commit
56950e2fb7
|
@ -481,6 +481,7 @@ class Booking(Workflow, ModelSQL, ModelView):
|
|||
'reference': reference,
|
||||
'agent': agent_id,
|
||||
'rooms': fo.room.name,
|
||||
'ota_booking_code': bk.ota_booking_code or '',
|
||||
'company': bk.company.id,
|
||||
'price_list': bk.price_list.id if bk.price_list else None,
|
||||
'add_default_charges': False,
|
||||
|
@ -651,22 +652,18 @@ class Booking(Workflow, ModelSQL, ModelView):
|
|||
])
|
||||
Folio.write([folio], {'invoice_line': line.id})
|
||||
invoice.save()
|
||||
print(' antes de ........... ', invoice.state)
|
||||
invoice.update_taxes([invoice])
|
||||
cls.write([bk], {'channel_invoice': invoice.id})
|
||||
Invoice.validate([invoice])
|
||||
invoice.save()
|
||||
invoice, = Invoice.browse([invoice.id])
|
||||
print(' invoice 1 ', invoice.state)
|
||||
try:
|
||||
Invoice.submit(invoices)
|
||||
invoice.save()
|
||||
print(' invoice 2 ', invoice.state, invoice.cufe)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
invoice = Invoice(invoice.id)
|
||||
print(' invoice 3 ', invoice.state, invoice.cufe)
|
||||
Invoice.post(invoices)
|
||||
except:
|
||||
pass
|
||||
|
@ -744,10 +741,11 @@ class Booking(Workflow, ModelSQL, ModelView):
|
|||
|
||||
company_id = Transaction().context.get('company')
|
||||
party = data['party']
|
||||
ota_code = data.get('ota_booking_code', '')
|
||||
if data.get('description'):
|
||||
description = data['description']
|
||||
else:
|
||||
description = f"{data['number']} | {data.get('rooms')}"
|
||||
description = f"{data['number']} | {ota_code} | {data.get('rooms')}"
|
||||
reference = data.get('reference')
|
||||
agent = None
|
||||
if data.get('agent'):
|
||||
|
|
Loading…
Reference in New Issue