Merge branch '11.0' of https://github.com/hootel/hootel into 11.0

This commit is contained in:
Pablo
2019-04-16 15:59:32 +02:00
2 changed files with 5 additions and 3 deletions

View File

@@ -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()

View File

@@ -190,7 +190,6 @@
/>
<field placeholder="Partner Notes" colspan="2" nolabel="1" name="partner_internal_comment" string="Partner Note"
attrs="{'invisible': [('reservation_type','in',('out'))]}"/>
<field nolabel="1" placeholder="Cancel Reason" name="cancelled_reason" attrs="{'invisible':[('state','not in',('cancelled'))]}"/>
<field nolabel="1" colspan="2" placeholder="Description in Guest Documents" name="name"/>
<field name="nights"/>
<field placeholder="Arriva Hour" name="arrival_hour"/>