Merge PR #13 into 14.0

Signed-off-by DarioLodeiros
This commit is contained in:
OCA-git-bot
2021-06-19 06:16:56 +00:00
6 changed files with 24 additions and 26 deletions

View File

@@ -396,7 +396,7 @@ class PmsFolio(models.Model):
store=True,
selection=[
("invoiced", "Fully Invoiced"),
("to invoice", "To Invoice"),
("to_invoice", "To Invoice"),
("no", "Nothing to Invoice"),
],
compute="_compute_get_invoice_status",
@@ -691,7 +691,7 @@ class PmsFolio(models.Model):
- no: if the Folio is in status 'draft', we consider that there is nothing to
invoice. This is also the default value if the conditions of no
other status is met.
- to invoice: if any SO line is 'to invoice', the whole SO is 'to invoice'
- to_invoice: if any SO line is 'to_invoice', the whole SO is 'to_invoice'
- invoiced: if all SO lines are invoiced, the SO is invoiced.
"""
unconfirmed_orders = self.filtered(lambda so: so.state in ["draft"])
@@ -719,9 +719,9 @@ class PmsFolio(models.Model):
if order.state in ("draft"):
order.invoice_status = "no"
elif any(
invoice_status == "to invoice" for invoice_status in line_invoice_status
invoice_status == "to_invoice" for invoice_status in line_invoice_status
):
order.invoice_status = "to invoice"
order.invoice_status = "to_invoice"
elif line_invoice_status and all(
invoice_status == "invoiced" for invoice_status in line_invoice_status
):