mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[RFC] renaming to invoice -> to_invoice
This commit is contained in:
@@ -81,12 +81,11 @@ class FolioSaleLine(models.Model):
|
||||
string="Invoice Status",
|
||||
help="Invoice Status; it can be: upselling, invoiced, to invoice, no",
|
||||
readonly=True,
|
||||
default="no",
|
||||
store=True,
|
||||
selection=[
|
||||
("upselling", "Upselling Opportunity"),
|
||||
("invoiced", "Fully Invoiced"),
|
||||
("to invoice", "To Invoice"),
|
||||
("to_invoice", "To Invoice"),
|
||||
("no", "Nothing to Invoice"),
|
||||
],
|
||||
compute="_compute_invoice_status",
|
||||
@@ -512,7 +511,7 @@ class FolioSaleLine(models.Model):
|
||||
# why status to_invoice?? this behavior is copied from sale order
|
||||
# https://github.com/OCA/OCB/blob/14.0/addons/sale/models/sale.py#L1160
|
||||
elif not float_is_zero(line.qty_to_invoice, precision_digits=precision):
|
||||
line.invoice_status = "to invoice"
|
||||
line.invoice_status = "to_invoice"
|
||||
elif (
|
||||
float_compare(
|
||||
line.qty_invoiced,
|
||||
|
||||
@@ -397,7 +397,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",
|
||||
@@ -692,7 +692,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"])
|
||||
@@ -720,9 +720,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
|
||||
):
|
||||
|
||||
@@ -493,17 +493,16 @@ class PmsReservation(models.Model):
|
||||
invoice_status = fields.Selection(
|
||||
string="Invoice Status",
|
||||
help="The status of the invoices in folio. Can be 'invoiced',"
|
||||
" 'to invoice' or 'no'.",
|
||||
compute="_compute_invoice_status",
|
||||
" 'to_invoice' or 'no'.",
|
||||
store=True,
|
||||
readonly=True,
|
||||
selection=[
|
||||
("upselling", "Upselling Opportunity"),
|
||||
("invoiced", "Fully Invoiced"),
|
||||
("to invoice", "To Invoice"),
|
||||
("to_invoice", "To Invoice"),
|
||||
("no", "Nothing to Invoice"),
|
||||
],
|
||||
default="no",
|
||||
compute="_compute_invoice_status",
|
||||
)
|
||||
analytic_tag_ids = fields.Many2many(
|
||||
string="Analytic Tags",
|
||||
|
||||
@@ -143,7 +143,7 @@ class PmsService(models.Model):
|
||||
compute="_compute_invoice_status",
|
||||
selection=[
|
||||
("invoiced", "Fully Invoiced"),
|
||||
("to invoice", "To Invoice"),
|
||||
("to_invoice", "To Invoice"),
|
||||
("no", "Nothing to Invoice"),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
string="Create Invoice"
|
||||
type="action"
|
||||
class="btn-primary"
|
||||
attrs="{'invisible': [('invoice_status', '!=', 'to invoice')]}"
|
||||
attrs="{'invisible': [('invoice_status', '!=', 'to_invoice')]}"
|
||||
/>
|
||||
<field
|
||||
name="state"
|
||||
@@ -332,8 +332,8 @@
|
||||
/>
|
||||
<field
|
||||
name="product_uom_qty"
|
||||
decoration-info="(not display_type and invoice_status == 'to invoice')"
|
||||
decoration-bf="(not display_type and invoice_status == 'to invoice')"
|
||||
decoration-info="(not display_type and invoice_status == '')"
|
||||
decoration-bf="(not display_type and invoice_status == '')"
|
||||
context="{
|
||||
'partner_id': parent.partner_id,
|
||||
'quantity': product_uom_qty,
|
||||
@@ -344,8 +344,8 @@
|
||||
/>
|
||||
<field
|
||||
name="qty_invoiced"
|
||||
decoration-info="(not display_type and invoice_status == 'to invoice')"
|
||||
decoration-bf="(not display_type and invoice_status == 'to invoice')"
|
||||
decoration-info="(not display_type and invoice_status == '')"
|
||||
decoration-bf="(not display_type and invoice_status == '')"
|
||||
string="Invoiced"
|
||||
attrs="{'column_invisible': [('parent.state', '=', 'draft')]}"
|
||||
optional="show"
|
||||
@@ -517,7 +517,7 @@
|
||||
name="invoice_status"
|
||||
widget="badge"
|
||||
decoration-success="invoice_status == 'invoiced'"
|
||||
decoration-info="invoice_status == 'to invoice'"
|
||||
decoration-info="invoice_status == ''"
|
||||
optional="show"
|
||||
/>
|
||||
<field
|
||||
@@ -590,7 +590,7 @@
|
||||
<filter
|
||||
name="to_invoice"
|
||||
string="To invoice"
|
||||
domain="[('invoice_status', '=', 'to invoice')]"
|
||||
domain="[('invoice_status', '=', '')]"
|
||||
/>
|
||||
<filter
|
||||
name="payment_pending"
|
||||
|
||||
Reference in New Issue
Block a user