Browse Source

Aug 18: [FIX] Bug Fixed 'hotel_management_odoo'

pull/397/head
Risvana Cybro 3 months ago
parent
commit
5bb706563b
  1. 5
      hotel_management_odoo/doc/RELEASE_NOTES.md
  2. 6
      hotel_management_odoo/models/event_booking_line.py
  3. 4
      hotel_management_odoo/models/fleet_booking_line.py
  4. 4
      hotel_management_odoo/models/food_booking_line.py
  5. 7
      hotel_management_odoo/models/room_booking_line.py
  6. 4
      hotel_management_odoo/models/service_booking_line.py
  7. 28
      hotel_management_odoo/static/description/index.html

5
hotel_management_odoo/doc/RELEASE_NOTES.md

@ -19,3 +19,8 @@
#### Version 18.0.1.1.1 #### Version 18.0.1.1.1
#### UPDT #### UPDT
- Added copy=false in some fields of room_booking model - Added copy=false in some fields of room_booking model
#### 19.08.2025
#### Version 18.0.1.1.2
#### UPDT
- Fixed the error shown while click Add Line in Food, Service or any extra Services

6
hotel_management_odoo/models/event_booking_line.py

@ -76,14 +76,14 @@ class EventBookingLine(models.Model):
string="Order Status", string="Order Status",
help="State of Room Booking", copy=False) help="State of Room Booking", copy=False)
@api.depends('uom_qty', 'price_unit', 'tax_ids') @api.depends('uom_qty', 'price_unit', 'tax_ids','currency_id')
def _compute_price_subtotal(self): def _compute_price_subtotal(self):
"""Compute the amounts of the room booking line.""" """Compute the amounts of the room booking line."""
for line in self: for line in self:
base_line = line._prepare_base_line_for_taxes_computation() base_line = line._prepare_base_line_for_taxes_computation()
self.env['account.tax']._add_tax_details_in_base_line(base_line, self.env.company) self.env['account.tax']._add_tax_details_in_base_line(base_line, self.env.company)
line.price_subtotal = base_line['tax_details']['total_excluded_currency'] line.price_subtotal = base_line['tax_details']['raw_total_excluded_currency']
line.price_total = base_line['tax_details']['total_included_currency'] line.price_total = base_line['tax_details']['raw_total_included_currency']
line.price_tax = line.price_total - line.price_subtotal line.price_tax = line.price_total - line.price_subtotal
if self.env.context.get('import_file', if self.env.context.get('import_file',
False) and not self.env.user. \ False) and not self.env.user. \

4
hotel_management_odoo/models/fleet_booking_line.py

@ -87,8 +87,8 @@ class FleetBookingLine(models.Model):
for line in self: for line in self:
base_line = line._prepare_base_line_for_taxes_computation() base_line = line._prepare_base_line_for_taxes_computation()
self.env['account.tax']._add_tax_details_in_base_line(base_line, self.env.company) self.env['account.tax']._add_tax_details_in_base_line(base_line, self.env.company)
line.price_subtotal = base_line['tax_details']['total_excluded_currency'] line.price_subtotal = base_line['tax_details']['raw_total_excluded_currency']
line.price_total = base_line['tax_details']['total_included_currency'] line.price_total = base_line['tax_details']['raw_total_included_currency']
line.price_tax = line.price_total - line.price_subtotal line.price_tax = line.price_total - line.price_subtotal
if self.env.context.get('import_file', if self.env.context.get('import_file',
False) and not self.env.user. \ False) and not self.env.user. \

4
hotel_management_odoo/models/food_booking_line.py

@ -85,8 +85,8 @@ class FoodBookingLine(models.Model):
for line in self: for line in self:
base_line = line._prepare_base_line_for_taxes_computation() base_line = line._prepare_base_line_for_taxes_computation()
self.env['account.tax']._add_tax_details_in_base_line(base_line, self.env.company) self.env['account.tax']._add_tax_details_in_base_line(base_line, self.env.company)
line.price_subtotal = base_line['tax_details']['total_excluded_currency'] line.price_subtotal = base_line['tax_details']['raw_total_excluded_currency']
line.price_total = base_line['tax_details']['total_included_currency'] line.price_total = base_line['tax_details']['raw_total_included_currency']
line.price_tax = line.price_total - line.price_subtotal line.price_tax = line.price_total - line.price_subtotal
if self.env.context.get('import_file', if self.env.context.get('import_file',
False) and not self.env.user. \ False) and not self.env.user. \

7
hotel_management_odoo/models/room_booking_line.py

@ -105,16 +105,14 @@ class RoomBookingLine(models.Model):
qty = qty + 1 qty = qty + 1
self.uom_qty = qty self.uom_qty = qty
@api.depends('uom_qty', 'price_unit', 'tax_ids') @api.depends('uom_qty', 'price_unit', 'tax_ids','currency_id')
def _compute_price_subtotal(self): def _compute_price_subtotal(self):
"""Compute the amounts of the room booking line.""" """Compute the amounts of the room booking line."""
for line in self: for line in self:
base_line = line._prepare_base_line_for_taxes_computation() base_line = line._prepare_base_line_for_taxes_computation()
self.env['account.tax']._add_tax_details_in_base_line(base_line, self.env.company) self.env['account.tax']._add_tax_details_in_base_line(base_line, self.env.company)
line.price_subtotal = base_line['tax_details']['raw_total_excluded_currency'] line.price_subtotal = base_line['tax_details']['raw_total_excluded_currency']
print("total_excluded_currency",line.price_subtotal)
line.price_total = base_line['tax_details']['raw_total_included_currency'] line.price_total = base_line['tax_details']['raw_total_included_currency']
print("total_included_currency",line.price_total)
line.price_tax = line.price_total - line.price_subtotal line.price_tax = line.price_total - line.price_subtotal
if self.env.context.get('import_file', if self.env.context.get('import_file',
False) and not self.env.user. \ False) and not self.env.user. \
@ -128,7 +126,10 @@ class RoomBookingLine(models.Model):
:return: A python dictionary. :return: A python dictionary.
""" """
self.ensure_one() self.ensure_one()
if not self.booking_id.pricelist_id:
self.currency_id = self.env.company.currency_id
return self.env['account.tax']._prepare_base_line_for_taxes_computation( return self.env['account.tax']._prepare_base_line_for_taxes_computation(
self, self,
**{ **{

4
hotel_management_odoo/models/service_booking_line.py

@ -86,8 +86,8 @@ class ServiceBookingLine(models.Model):
for line in self: for line in self:
base_line = line._prepare_base_line_for_taxes_computation() base_line = line._prepare_base_line_for_taxes_computation()
self.env['account.tax']._add_tax_details_in_base_line(base_line, self.env.company) self.env['account.tax']._add_tax_details_in_base_line(base_line, self.env.company)
line.price_subtotal = base_line['tax_details']['total_excluded_currency'] line.price_subtotal = base_line['tax_details']['raw_total_excluded_currency']
line.price_total = base_line['tax_details']['total_included_currency'] line.price_total = base_line['tax_details']['raw_total_included_currency']
line.price_tax = line.price_total - line.price_subtotal line.price_tax = line.price_total - line.price_subtotal
if self.env.context.get('import_file', if self.env.context.get('import_file',
False) and not self.env.user. \ False) and not self.env.user. \

28
hotel_management_odoo/static/description/index.html

@ -1056,6 +1056,34 @@
<div style="padding:0 0 0; border-bottom:1px solid #E3E3E3"> <div style="padding:0 0 0; border-bottom:1px solid #E3E3E3">
</div> </div>
</div> </div>
<div class="col-md-3">
<h4 style="font-size:16px; font-weight:600; color:#514F4F; margin:0; line-height:26px;">
Latest Release 18.0.1.1.2
</h4>
<span style="font-size:14px; color:#7A7979; display:block; margin-bottom:20px;">
19th August, 2025
</span>
</div>
<div class="col-md-8">
<div style="padding:0 0 40px">
<div style="margin:0 0 10px">
<div style="display:inline-block; padding:0px 8px; color:#514F4F; background-color:#FFD8D8; border-radius:20px">
BUG FIX
</div>
</div>
<div class="d-flex m-0"
style="color:#7A7979;">
<ul class="pl-3 mb-0">
<li>
Fixed the error shown while click Add Line in Food, Service or any extra Services.
</li>
</ul>
</div>
</div>
<div style="padding:0 0 0; border-bottom:1px solid #E3E3E3">
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save