[IMP]pms: add options property autotinvoice

This commit is contained in:
Darío Lodeiros
2022-02-01 20:46:53 +01:00
parent c372c94ee5
commit 3f298b3069
2 changed files with 50 additions and 0 deletions

View File

@@ -142,6 +142,35 @@ class PmsProperty(models.Model):
is_modified_auto_mail = fields.Boolean(string="Auto Send Modification Mail")
is_canceled_auto_mail = fields.Boolean(string="Auto Send Cancellation Mail")
default_invoicing_policy = fields.Selection(
string="Invoicing Policy",
selection=[
("manual", "Manual"),
("checkout", "Checkout"),
],
default="manual",
)
journal_simplified_invoice_id = fields.Many2one(
string="Simplified Invoice Journal",
comodel_name="account.journal",
domain=[
("type", "=", "sale"),
],
help="Journal used to create the simplified invoice",
check_company=True,
check_pms_properties=True,
)
journal_normal_invoice_id = fields.Many2one(
string="Normal Invoice Journal",
comodel_name="account.journal",
domain=[("type", "=", "sale")],
help="Journal used to create the normal invoice",
check_company=True,
check_pms_properties=True,
)
@api.depends_context(
"checkin",
"checkout",

View File

@@ -85,6 +85,27 @@
<field name="room_ids" />
</group>
</page>
<page string="Invoicing" name="property_invoicing">
<group>
<field name="default_invoicing_policy" />
<field
name="journal_simplified_invoice_id"
attrs="{'required': [('default_invoicing_policy', '!=', 'manual')]}"
domain="[
('type', '=', 'sale'),
('company_id','=',company_id),
]"
/>
<field
name="journal_normal_invoice_id"
attrs="{'required': [('default_invoicing_policy', '!=', 'manual')]}"
domain="[
('type', '=', 'sale'),
('company_id','=',company_id),
]"
/>
</group>
</page>
<page string="Email Configuration">
<group>
<div class="row">