mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
pms: improvement compute folio invoice status
This commit is contained in:
@@ -1071,20 +1071,11 @@ class PmsFolio(models.Model):
|
|||||||
elif line_invoice_status and any(
|
elif line_invoice_status and any(
|
||||||
invoice_status == "invoiced" for invoice_status in line_invoice_status
|
invoice_status == "invoiced" for invoice_status in line_invoice_status
|
||||||
):
|
):
|
||||||
if (
|
order.invoice_status = "invoiced"
|
||||||
all(
|
|
||||||
invoice_status == "invoiced"
|
|
||||||
for invoice_status in line_invoice_status
|
|
||||||
)
|
|
||||||
or order.force_nothing_to_invoice
|
|
||||||
):
|
|
||||||
order.invoice_status = "invoiced"
|
|
||||||
else:
|
|
||||||
order.invoice_status = "no"
|
|
||||||
else:
|
else:
|
||||||
order.invoice_status = "no"
|
order.invoice_status = "no"
|
||||||
|
|
||||||
@api.depends("untaxed_amount_to_invoice", "amount_total")
|
@api.depends("untaxed_amount_to_invoice")
|
||||||
def _compute_force_nothing_to_invoice(self):
|
def _compute_force_nothing_to_invoice(self):
|
||||||
# If the invoice amount and amount total are the same,
|
# If the invoice amount and amount total are the same,
|
||||||
# and the qty to invoice is not 0, we force nothing to invoice
|
# and the qty to invoice is not 0, we force nothing to invoice
|
||||||
@@ -1199,6 +1190,7 @@ class PmsFolio(models.Model):
|
|||||||
/ sum(folio.reservation_ids.mapped("adults"))
|
/ sum(folio.reservation_ids.mapped("adults"))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@api.depends("sale_line_ids.untaxed_amount_to_invoice")
|
||||||
def _compute_untaxed_amount_to_invoice(self):
|
def _compute_untaxed_amount_to_invoice(self):
|
||||||
for folio in self:
|
for folio in self:
|
||||||
folio.untaxed_amount_to_invoice = sum(
|
folio.untaxed_amount_to_invoice = sum(
|
||||||
|
|||||||
Reference in New Issue
Block a user