mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
@@ -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,
|
||||
|
||||
@@ -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
|
||||
):
|
||||
|
||||
@@ -497,17 +497,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"
|
||||
|
||||
@@ -13,7 +13,7 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
||||
partner_invoice_id = fields.Many2one(
|
||||
string="Billing contact",
|
||||
help="Invoice address for current partner",
|
||||
default=lambda self: self._default_partner_invoice_id,
|
||||
default=lambda self: self._default_partner_invoice_id(),
|
||||
comodel_name="res.partner",
|
||||
)
|
||||
advance_payment_method = fields.Selection(
|
||||
@@ -41,17 +41,17 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
||||
string="Has down payments",
|
||||
help="Has down payments",
|
||||
readonly=True,
|
||||
default=lambda self: self._default_has_down_payment,
|
||||
default=lambda self: self._default_has_down_payment(),
|
||||
)
|
||||
product_id = fields.Many2one(
|
||||
string="Down Payment Product",
|
||||
default=lambda self: self._default_product_id,
|
||||
default=lambda self: self._default_product_id(),
|
||||
comodel_name="product.product",
|
||||
domain=[("type", "=", "service")],
|
||||
)
|
||||
count = fields.Integer(
|
||||
string="Order Count",
|
||||
default=lambda self: self._count,
|
||||
default=lambda self: self._count(),
|
||||
)
|
||||
amount = fields.Float(
|
||||
string="Down Payment Amount",
|
||||
@@ -62,7 +62,7 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
||||
string="Currency",
|
||||
help="Currency used in invoices",
|
||||
comodel_name="res.currency",
|
||||
default=lambda self: self._default_currency_id,
|
||||
default=lambda self: self._default_currency_id(),
|
||||
)
|
||||
fixed_amount = fields.Monetary(
|
||||
string="Down Payment Amount (Fixed)",
|
||||
@@ -71,14 +71,14 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
||||
deposit_account_id = fields.Many2one(
|
||||
string="Income Account",
|
||||
help="Account used for deposits",
|
||||
default=lambda self: self._default_deposit_account_id,
|
||||
default=lambda self: self._default_deposit_account_id(),
|
||||
comodel_name="account.account",
|
||||
domain=[("deprecated", "=", False)],
|
||||
)
|
||||
deposit_taxes_id = fields.Many2many(
|
||||
string="Customer Taxes",
|
||||
help="Taxes used for deposits",
|
||||
default=lambda self: self._default_deposit_taxes_id,
|
||||
default=lambda self: self._default_deposit_taxes_id(),
|
||||
comodel_name="account.tax",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user