mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
Merge branch '11.0' of https://github.com/hootel/hootel into 11.0
This commit is contained in:
@@ -44,10 +44,13 @@ class AccountInvoice(models.Model):
|
|||||||
@api.multi
|
@api.multi
|
||||||
def action_invoice_open(self):
|
def action_invoice_open(self):
|
||||||
to_open_invoices_without_vat = self.filtered(lambda inv: inv.state != 'open' and inv.partner_id.vat == False)
|
to_open_invoices_without_vat = self.filtered(lambda inv: inv.state != 'open' and inv.partner_id.vat == False)
|
||||||
if to_open_invoices_without_vat:
|
to_open_invoices_without_country = self.filtered(lambda inv: inv.state != 'open' and not inv.partner_id.country_id)
|
||||||
vat_error = _("We need the VAT of the following companies")
|
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:
|
for invoice in to_open_invoices_without_vat:
|
||||||
vat_error += ", " + invoice.partner_id.name
|
vat_error += ", " + invoice.partner_id.name
|
||||||
|
for invoice in to_open_invoices_without_country:
|
||||||
|
vat_error += ", " + invoice.partner_id.name
|
||||||
raise ValidationError(vat_error)
|
raise ValidationError(vat_error)
|
||||||
return super(AccountInvoice, self).action_invoice_open()
|
return super(AccountInvoice, self).action_invoice_open()
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,6 @@
|
|||||||
/>
|
/>
|
||||||
<field placeholder="Partner Notes" colspan="2" nolabel="1" name="partner_internal_comment" string="Partner Note"
|
<field placeholder="Partner Notes" colspan="2" nolabel="1" name="partner_internal_comment" string="Partner Note"
|
||||||
attrs="{'invisible': [('reservation_type','in',('out'))]}"/>
|
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 nolabel="1" colspan="2" placeholder="Description in Guest Documents" name="name"/>
|
||||||
<field name="nights"/>
|
<field name="nights"/>
|
||||||
<field placeholder="Arriva Hour" name="arrival_hour"/>
|
<field placeholder="Arriva Hour" name="arrival_hour"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user