[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 <oco-odoo@users.noreply.github.com>
This commit is contained in:
Shreya Modi
2019-05-10 09:39:36 +00:00
committed by Barad Mahendra
parent b48d47b806
commit a375471bea
3 changed files with 8 additions and 7 deletions
+2 -1
View File
@@ -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):
+1 -1
View File
@@ -1077,7 +1077,7 @@
<field name="model">account.tax</field>
<field name="arch" type="xml">
<tree string="Account Tax">
<field name="name"/>
<field name="display_name" string="name"/>
<field name="description"/>
</tree>
</field>
+5 -5
View File
@@ -40,15 +40,15 @@
<notebook>
<page name="tax_mapping" string="Tax Mapping">
<group>
<field name="tax_ids" widget="one2many" nolabel="1">
<field name="tax_ids" widget="one2many" nolabel="1" context="{'append_type_to_tax_name': True}">
<tree name="tax_map_tree" string="Tax Mapping" editable="bottom">
<field name="tax_src_id" domain="[('type_tax_use', '!=', None)]"/>
<field name="tax_dest_id" domain="[('type_tax_use', '!=', None)]"/>
<field name="tax_src_id" domain="[('type_tax_use', '!=', None)]" context="{'append_type_to_tax_name': True}"/>
<field name="tax_dest_id" domain="[('type_tax_use', '!=', None)]" context="{'append_type_to_tax_name': True}"/>
</tree>
<form name="tax_map_form" string="Tax Mapping">
<group>
<field name="tax_src_id" domain="[('type_tax_use', '!=', None)]"/>
<field name="tax_dest_id" domain="[('type_tax_use', '!=', None)]"/>
<field name="tax_src_id" domain="[('type_tax_use', '!=', None)]" context="{'append_type_to_tax_name': True}"/>
<field name="tax_dest_id" domain="[('type_tax_use', '!=', None)]" context="{'append_type_to_tax_name': True}"/>
</group>
</form>
</field>