From a375471bea3e33e3aeee60d9cca537d1b18e0225 Mon Sep 17 00:00:00 2001 From: Shreya Modi Date: Tue, 26 Mar 2019 07:30:18 +0000 Subject: [PATCH] [IMP] account : show type of tax in fiscal position. On fiscal position, there is a mix of sales & purchases invoice which makes it difficult to understand. So display the type of tax on fiscal position and improve the name_get so type must be translated. also improve the default tree view of tax so it will display the same on 'search more' of many2one. Task-ID: 1943502 Closes: #32241 Signed-off-by: oco-odoo --- addons/account/models/account.py | 3 ++- addons/account/views/account_view.xml | 2 +- addons/account/views/partner_view.xml | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/account/models/account.py b/addons/account/models/account.py index e9f51aefc74..db5a88044a6 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -958,7 +958,8 @@ class AccountTax(models.Model): def name_get(self): if not self._context.get('append_type_to_tax_name'): return super(AccountTax, self).name_get() - return [(tax.id, '%s (%s)' % (tax.name, tax.type_tax_use)) for tax in self] + tax_type = dict(self._fields['type_tax_use']._description_selection(self.env)) + return [(tax.id, '%s (%s)' % (tax.name, tax_type.get(tax.type_tax_use))) for tax in self] @api.model def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None): diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml index 5477247eebc..33e1a5c9b0c 100644 --- a/addons/account/views/account_view.xml +++ b/addons/account/views/account_view.xml @@ -1077,7 +1077,7 @@ account.tax - + diff --git a/addons/account/views/partner_view.xml b/addons/account/views/partner_view.xml index e696e1b0d96..5b194f79eea 100644 --- a/addons/account/views/partner_view.xml +++ b/addons/account/views/partner_view.xml @@ -40,15 +40,15 @@ - + - - + +
- - + +