From 3f298b30696a5d0c2e8a49a5d48cdcab6ea28b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Tue, 1 Feb 2022 20:46:53 +0100 Subject: [PATCH] [IMP]pms: add options property autotinvoice --- pms/models/pms_property.py | 29 +++++++++++++++++++++++++++++ pms/views/pms_property_views.xml | 21 +++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/pms/models/pms_property.py b/pms/models/pms_property.py index 317f12e02..7b53f54f2 100644 --- a/pms/models/pms_property.py +++ b/pms/models/pms_property.py @@ -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", diff --git a/pms/views/pms_property_views.xml b/pms/views/pms_property_views.xml index f1ba521dc..20a4e255b 100644 --- a/pms/views/pms_property_views.xml +++ b/pms/views/pms_property_views.xml @@ -85,6 +85,27 @@ + + + + + + +