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",
|
string="Invoice Status",
|
||||||
help="Invoice Status; it can be: upselling, invoiced, to invoice, no",
|
help="Invoice Status; it can be: upselling, invoiced, to invoice, no",
|
||||||
readonly=True,
|
readonly=True,
|
||||||
default="no",
|
|
||||||
store=True,
|
store=True,
|
||||||
selection=[
|
selection=[
|
||||||
("upselling", "Upselling Opportunity"),
|
("upselling", "Upselling Opportunity"),
|
||||||
("invoiced", "Fully Invoiced"),
|
("invoiced", "Fully Invoiced"),
|
||||||
("to invoice", "To Invoice"),
|
("to_invoice", "To Invoice"),
|
||||||
("no", "Nothing to Invoice"),
|
("no", "Nothing to Invoice"),
|
||||||
],
|
],
|
||||||
compute="_compute_invoice_status",
|
compute="_compute_invoice_status",
|
||||||
@@ -512,7 +511,7 @@ class FolioSaleLine(models.Model):
|
|||||||
# why status to_invoice?? this behavior is copied from sale order
|
# 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
|
# 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):
|
elif not float_is_zero(line.qty_to_invoice, precision_digits=precision):
|
||||||
line.invoice_status = "to invoice"
|
line.invoice_status = "to_invoice"
|
||||||
elif (
|
elif (
|
||||||
float_compare(
|
float_compare(
|
||||||
line.qty_invoiced,
|
line.qty_invoiced,
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ class PmsFolio(models.Model):
|
|||||||
store=True,
|
store=True,
|
||||||
selection=[
|
selection=[
|
||||||
("invoiced", "Fully Invoiced"),
|
("invoiced", "Fully Invoiced"),
|
||||||
("to invoice", "To Invoice"),
|
("to_invoice", "To Invoice"),
|
||||||
("no", "Nothing to Invoice"),
|
("no", "Nothing to Invoice"),
|
||||||
],
|
],
|
||||||
compute="_compute_get_invoice_status",
|
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
|
- 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
|
invoice. This is also the default value if the conditions of no
|
||||||
other status is met.
|
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.
|
- invoiced: if all SO lines are invoiced, the SO is invoiced.
|
||||||
"""
|
"""
|
||||||
unconfirmed_orders = self.filtered(lambda so: so.state in ["draft"])
|
unconfirmed_orders = self.filtered(lambda so: so.state in ["draft"])
|
||||||
@@ -719,9 +719,9 @@ class PmsFolio(models.Model):
|
|||||||
if order.state in ("draft"):
|
if order.state in ("draft"):
|
||||||
order.invoice_status = "no"
|
order.invoice_status = "no"
|
||||||
elif any(
|
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(
|
elif line_invoice_status and all(
|
||||||
invoice_status == "invoiced" for invoice_status in line_invoice_status
|
invoice_status == "invoiced" for invoice_status in line_invoice_status
|
||||||
):
|
):
|
||||||
|
|||||||
@@ -497,17 +497,16 @@ class PmsReservation(models.Model):
|
|||||||
invoice_status = fields.Selection(
|
invoice_status = fields.Selection(
|
||||||
string="Invoice Status",
|
string="Invoice Status",
|
||||||
help="The status of the invoices in folio. Can be 'invoiced',"
|
help="The status of the invoices in folio. Can be 'invoiced',"
|
||||||
" 'to invoice' or 'no'.",
|
" 'to_invoice' or 'no'.",
|
||||||
compute="_compute_invoice_status",
|
|
||||||
store=True,
|
store=True,
|
||||||
readonly=True,
|
readonly=True,
|
||||||
selection=[
|
selection=[
|
||||||
("upselling", "Upselling Opportunity"),
|
("upselling", "Upselling Opportunity"),
|
||||||
("invoiced", "Fully Invoiced"),
|
("invoiced", "Fully Invoiced"),
|
||||||
("to invoice", "To Invoice"),
|
("to_invoice", "To Invoice"),
|
||||||
("no", "Nothing to Invoice"),
|
("no", "Nothing to Invoice"),
|
||||||
],
|
],
|
||||||
default="no",
|
compute="_compute_invoice_status",
|
||||||
)
|
)
|
||||||
analytic_tag_ids = fields.Many2many(
|
analytic_tag_ids = fields.Many2many(
|
||||||
string="Analytic Tags",
|
string="Analytic Tags",
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ class PmsService(models.Model):
|
|||||||
compute="_compute_invoice_status",
|
compute="_compute_invoice_status",
|
||||||
selection=[
|
selection=[
|
||||||
("invoiced", "Fully Invoiced"),
|
("invoiced", "Fully Invoiced"),
|
||||||
("to invoice", "To Invoice"),
|
("to_invoice", "To Invoice"),
|
||||||
("no", "Nothing to Invoice"),
|
("no", "Nothing to Invoice"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
string="Create Invoice"
|
string="Create Invoice"
|
||||||
type="action"
|
type="action"
|
||||||
class="btn-primary"
|
class="btn-primary"
|
||||||
attrs="{'invisible': [('invoice_status', '!=', 'to invoice')]}"
|
attrs="{'invisible': [('invoice_status', '!=', 'to_invoice')]}"
|
||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="state"
|
name="state"
|
||||||
@@ -332,8 +332,8 @@
|
|||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="product_uom_qty"
|
name="product_uom_qty"
|
||||||
decoration-info="(not display_type and invoice_status == 'to invoice')"
|
decoration-info="(not display_type and invoice_status == '')"
|
||||||
decoration-bf="(not display_type and invoice_status == 'to invoice')"
|
decoration-bf="(not display_type and invoice_status == '')"
|
||||||
context="{
|
context="{
|
||||||
'partner_id': parent.partner_id,
|
'partner_id': parent.partner_id,
|
||||||
'quantity': product_uom_qty,
|
'quantity': product_uom_qty,
|
||||||
@@ -344,8 +344,8 @@
|
|||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="qty_invoiced"
|
name="qty_invoiced"
|
||||||
decoration-info="(not display_type and invoice_status == 'to invoice')"
|
decoration-info="(not display_type and invoice_status == '')"
|
||||||
decoration-bf="(not display_type and invoice_status == 'to invoice')"
|
decoration-bf="(not display_type and invoice_status == '')"
|
||||||
string="Invoiced"
|
string="Invoiced"
|
||||||
attrs="{'column_invisible': [('parent.state', '=', 'draft')]}"
|
attrs="{'column_invisible': [('parent.state', '=', 'draft')]}"
|
||||||
optional="show"
|
optional="show"
|
||||||
@@ -517,7 +517,7 @@
|
|||||||
name="invoice_status"
|
name="invoice_status"
|
||||||
widget="badge"
|
widget="badge"
|
||||||
decoration-success="invoice_status == 'invoiced'"
|
decoration-success="invoice_status == 'invoiced'"
|
||||||
decoration-info="invoice_status == 'to invoice'"
|
decoration-info="invoice_status == ''"
|
||||||
optional="show"
|
optional="show"
|
||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
@@ -590,7 +590,7 @@
|
|||||||
<filter
|
<filter
|
||||||
name="to_invoice"
|
name="to_invoice"
|
||||||
string="To invoice"
|
string="To invoice"
|
||||||
domain="[('invoice_status', '=', 'to invoice')]"
|
domain="[('invoice_status', '=', '')]"
|
||||||
/>
|
/>
|
||||||
<filter
|
<filter
|
||||||
name="payment_pending"
|
name="payment_pending"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
partner_invoice_id = fields.Many2one(
|
partner_invoice_id = fields.Many2one(
|
||||||
string="Billing contact",
|
string="Billing contact",
|
||||||
help="Invoice address for current partner",
|
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",
|
comodel_name="res.partner",
|
||||||
)
|
)
|
||||||
advance_payment_method = fields.Selection(
|
advance_payment_method = fields.Selection(
|
||||||
@@ -41,17 +41,17 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
string="Has down payments",
|
string="Has down payments",
|
||||||
help="Has down payments",
|
help="Has down payments",
|
||||||
readonly=True,
|
readonly=True,
|
||||||
default=lambda self: self._default_has_down_payment,
|
default=lambda self: self._default_has_down_payment(),
|
||||||
)
|
)
|
||||||
product_id = fields.Many2one(
|
product_id = fields.Many2one(
|
||||||
string="Down Payment Product",
|
string="Down Payment Product",
|
||||||
default=lambda self: self._default_product_id,
|
default=lambda self: self._default_product_id(),
|
||||||
comodel_name="product.product",
|
comodel_name="product.product",
|
||||||
domain=[("type", "=", "service")],
|
domain=[("type", "=", "service")],
|
||||||
)
|
)
|
||||||
count = fields.Integer(
|
count = fields.Integer(
|
||||||
string="Order Count",
|
string="Order Count",
|
||||||
default=lambda self: self._count,
|
default=lambda self: self._count(),
|
||||||
)
|
)
|
||||||
amount = fields.Float(
|
amount = fields.Float(
|
||||||
string="Down Payment Amount",
|
string="Down Payment Amount",
|
||||||
@@ -62,7 +62,7 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
string="Currency",
|
string="Currency",
|
||||||
help="Currency used in invoices",
|
help="Currency used in invoices",
|
||||||
comodel_name="res.currency",
|
comodel_name="res.currency",
|
||||||
default=lambda self: self._default_currency_id,
|
default=lambda self: self._default_currency_id(),
|
||||||
)
|
)
|
||||||
fixed_amount = fields.Monetary(
|
fixed_amount = fields.Monetary(
|
||||||
string="Down Payment Amount (Fixed)",
|
string="Down Payment Amount (Fixed)",
|
||||||
@@ -71,14 +71,14 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
deposit_account_id = fields.Many2one(
|
deposit_account_id = fields.Many2one(
|
||||||
string="Income Account",
|
string="Income Account",
|
||||||
help="Account used for deposits",
|
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",
|
comodel_name="account.account",
|
||||||
domain=[("deprecated", "=", False)],
|
domain=[("deprecated", "=", False)],
|
||||||
)
|
)
|
||||||
deposit_taxes_id = fields.Many2many(
|
deposit_taxes_id = fields.Many2many(
|
||||||
string="Customer Taxes",
|
string="Customer Taxes",
|
||||||
help="Taxes used for deposits",
|
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",
|
comodel_name="account.tax",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user