|
|
|
@ -105,16 +105,14 @@ class RoomBookingLine(models.Model): |
|
|
|
qty = qty + 1 |
|
|
|
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): |
|
|
|
"""Compute the amounts of the room booking line.""" |
|
|
|
for line in self: |
|
|
|
base_line = line._prepare_base_line_for_taxes_computation() |
|
|
|
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'] |
|
|
|
print("total_excluded_currency",line.price_subtotal) |
|
|
|
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 |
|
|
|
if self.env.context.get('import_file', |
|
|
|
False) and not self.env.user. \ |
|
|
|
@ -128,7 +126,10 @@ class RoomBookingLine(models.Model): |
|
|
|
|
|
|
|
:return: A python dictionary. |
|
|
|
""" |
|
|
|
|
|
|
|
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( |
|
|
|
self, |
|
|
|
**{ |
|
|
|
|