diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index f756ec42100..d45fa6fd9c5 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1830,6 +1830,8 @@ class AccountPaymentTerm(models.Model): @api.multi def unlink(self): + if self.env['account.invoice'].search([('payment_term_id', 'in', self.ids)]): + raise UserError(_('You can not delete payment terms as other records still reference it. However, you can archive it.')) property_recs = self.env['ir.property'].search([('value_reference', 'in', ['account.payment.term,%s'%payment_term.id for payment_term in self])]) property_recs.unlink() return super(AccountPaymentTerm, self).unlink() diff --git a/addons/account/views/account_invoice_view.xml b/addons/account/views/account_invoice_view.xml index d699ff237b9..ba8dbc1e54f 100644 --- a/addons/account/views/account_invoice_view.xml +++ b/addons/account/views/account_invoice_view.xml @@ -136,6 +136,8 @@ + + @@ -199,6 +201,8 @@ + + @@ -277,7 +281,7 @@ - @@ -434,7 +438,7 @@ - diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml index dddaacd1ead..9ce5bab4cdb 100644 --- a/addons/account/views/account_view.xml +++ b/addons/account/views/account_view.xml @@ -1000,6 +1000,18 @@ + + + account.invoice.line.tax.search + account.tax + + + + + + + + account.tax.kanban account.tax @@ -1043,6 +1055,17 @@ + + account.tax.search.filters + account.tax + + + + + + + + account.tax.form account.tax diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index 270c792c606..486f4c50d07 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -3,7 +3,7 @@