From 7b5fe5c61c74f0c1d6fd3f7f7fef546996dd32a3 Mon Sep 17 00:00:00 2001 From: Dario Lodeiros Date: Tue, 16 Apr 2019 10:27:35 +0200 Subject: [PATCH 1/2] [ADD] required country_id to open invoice --- hotel/models/inherited_account_invoice.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hotel/models/inherited_account_invoice.py b/hotel/models/inherited_account_invoice.py index 97c3da25c..31537804a 100644 --- a/hotel/models/inherited_account_invoice.py +++ b/hotel/models/inherited_account_invoice.py @@ -44,10 +44,13 @@ class AccountInvoice(models.Model): @api.multi def action_invoice_open(self): to_open_invoices_without_vat = self.filtered(lambda inv: inv.state != 'open' and inv.partner_id.vat == False) - if to_open_invoices_without_vat: - vat_error = _("We need the VAT of the following companies") + to_open_invoices_without_country = self.filtered(lambda inv: inv.state != 'open' and not inv.partner_id.country_id) + if to_open_invoices_without_vat or to_open_invoices_without_country: + vat_error = _("We need the VAT and Country of the following companies") for invoice in to_open_invoices_without_vat: vat_error += ", " + invoice.partner_id.name + for invoice in to_open_invoices_without_country: + vat_error += ", " + invoice.partner_id.name raise ValidationError(vat_error) return super(AccountInvoice, self).action_invoice_open() From 693c6f734179a48ff844aadf542504bc830fd760 Mon Sep 17 00:00:00 2001 From: Dario Lodeiros Date: Tue, 16 Apr 2019 11:03:01 +0200 Subject: [PATCH 2/2] [FIX] duplicated cancelled reason on reservation form --- hotel/views/hotel_reservation_views.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/hotel/views/hotel_reservation_views.xml b/hotel/views/hotel_reservation_views.xml index 25fbfbf69..74a9ef4ec 100644 --- a/hotel/views/hotel_reservation_views.xml +++ b/hotel/views/hotel_reservation_views.xml @@ -190,7 +190,6 @@ /> -