diff options
| author | Wolfgang Taferner <wolfgang.taferner@wt-io-it.at> | 2019-08-11 15:02:08 +0000 |
|---|---|---|
| committer | Wolfgang Taferner <wolfgang.taferner@wt-io-it.at> | 2019-08-11 17:12:46 +0000 |
| commit | f20a8285f3135d01fe02c795e7373b1c2aa26e22 (patch) | |
| tree | da454427ed8edfbd641930c5eb798853d7da4729 | |
| parent | 0f15adb304e1d6a44d05e55b3ec105acd7910d13 (diff) | |
[FIX] account: extend the scope of the template tax too for the usage
closes odoo/odoo#35622
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
| -rw-r--r-- | addons/account/models/account.py | 8 | ||||
| -rw-r--r-- | addons/account/models/chart_template.py | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 63d35e9b317..412381ddc4f 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -11,6 +11,12 @@ from odoo.exceptions import UserError, ValidationError from odoo import api, fields, models, _ from odoo.tests.common import Form +TYPE_TAX_USE = [ + ('sale', 'Sales'), + ('purchase', 'Purchases'), + ('none', 'None'), +] + class AccountAccountType(models.Model): _name = "account.account.type" @@ -1035,7 +1041,7 @@ class AccountTax(models.Model): return self.env['account.tax.group'].search([], limit=1) name = fields.Char(string='Tax Name', required=True) - type_tax_use = fields.Selection([('sale', 'Sales'), ('purchase', 'Purchases'), ('none', 'None'), ('adjustment', 'Adjustment')], string='Tax Scope', required=True, default="sale", + type_tax_use = fields.Selection(TYPE_TAX_USE, string='Tax Scope', required=True, default="sale", help="Determines where the tax is selectable. Note : 'None' means a tax can't be used by itself, however it can still be used in a group. 'adjustment' is used to perform tax adjustment.") amount_type = fields.Selection(default='percent', string="Tax Computation", required=True, selection=[('group', 'Group of Taxes'), ('fixed', 'Fixed'), ('percent', 'Percentage of Price'), ('division', 'Percentage of Price Tax Included')], diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index 04f75ac4894..ed2e8b7ee26 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -5,6 +5,7 @@ from odoo import api, fields, models, _ from odoo import SUPERUSER_ID from odoo.exceptions import UserError, ValidationError from odoo.http import request +from odoo.addons.account.models.account import TYPE_TAX_USE import logging @@ -802,7 +803,7 @@ class AccountTaxTemplate(models.Model): chart_template_id = fields.Many2one('account.chart.template', string='Chart Template', required=True) name = fields.Char(string='Tax Name', required=True) - type_tax_use = fields.Selection([('sale', 'Sales'), ('purchase', 'Purchases'), ('none', 'None')], string='Tax Scope', required=True, default="sale", + type_tax_use = fields.Selection(TYPE_TAX_USE, string='Tax Scope', required=True, default="sale", help="Determines where the tax is selectable. Note : 'None' means a tax can't be used by itself, however it can still be used in a group.") amount_type = fields.Selection(default='percent', string="Tax Computation", required=True, selection=[('group', 'Group of Taxes'), ('fixed', 'Fixed'), ('percent', 'Percentage of Price'), ('division', 'Percentage of Price Tax Included')]) |
