Final fix

This commit is contained in:
Oscar Alvarez 2020-12-03 12:01:04 -05:00
parent c6cbbb596a
commit 2b12a7fc33
2 changed files with 4 additions and 76 deletions

View File

@ -544,76 +544,6 @@ class Booking(Workflow, ModelSQL, ModelView):
context['taxes'] = taxes
return context
# def create_sale(self):
# pool = Pool()
# Model = pool.get('ir.model')
# SaleLine = pool.get('sale.line')
# Configuration = pool.get('hotel.configuration')
# configuration = Configuration.get_configuration()
# date_ = datetime.today().date()
# model = Model.search([('name', '=', str(self.__name__))])
# ctx = {}
#
# if not self.payment_term:
# self.raise_user_error('payterm_missing')
#
# if self.price_list:
# ctx['price_list'] = self.price_list
# ctx['sale_date'] = date_
# ctx['currency'] = self.currency.id
# if self.party:
# ctx['customer'] = self.party.id
#
# if not model:
# model = 'Booking'
# else:
# model = model[0].name
#
# if self.invoice_method == 'by_booking':
# bookings_ = [(self.party, self.lines)]
# else:
# bookings_ = [
# (line.main_guest, [line]) for line in self.lines
# ]
#
# for party, lines in bookings_:
# sale = self.get_sale(party, date_)
# sale.save()
# for line in lines:
# if line.nights_quantity <= 0:
# continue
#
# if self.price_list:
# with Transaction().set_context(ctx):
# unit_price = self.price_list.compute(
# self.party, line.product,
# line.product.template.list_price,
# line.nights_quantity, line.product.default_uom)
# else:
# unit_price = line.unit_price
#
# unit_price = self.currency.round(line.unit_price)
# new_line = self.create_sale_line(sale, line, unit_price)
# SaleLine.create([new_line])
#
# # Add and create default charges lines if exists
# for product in configuration.default_charges:
# taxes_ids = self.get_taxes(product)
# new_line = {
# 'sale': sale.id,
# 'type': 'line',
# 'unit': product.template.default_uom.id,
# 'quantity': 1,
# 'unit_price': product.template.list_price,
# 'product': product.id,
# 'description': product.rec_name,
# }
# if taxes_ids:
# new_line.update({'taxes': [('add', taxes_ids)]})
# if new_line:
# SaleLine.create([new_line])
# self.write([self], {'sales': [('add', [sale.id])]})
def update_occupancy(self, state):
Operation = Pool().get('hotel.operation')
OperationVoucher = Pool().get('hotel.operation-account.voucher')

View File

@ -44,12 +44,10 @@ this repository contains the full copyright notices and license terms. -->
<field name="company"/>
<label name="currency"/>
<field name="currency"/>
<!--
<label name="origin"/>
<field name="origin"/>
<label name="sale_line"/>
<field name="sale_line"/>
-->
<label name="origin"/>
<field name="origin"/>
<label name="sale_line"/>
<field name="sale_line"/>
<separator name="notes" colspan="4"/>
<field name="notes" colspan="4"/>
</page>