Tax not created because template is marked not active

I have a situation where I have defined a list of template taxes in XML and some of them are marked as not active (i.e. field active is set to False). They are marked inactive because these taxes are rarely used and are left up to the user to enable them back if he/she really needs it. I was expecting that by having the template set inactive, the corresponding created tax for the company will also be marked as not active. However this does not happen, instead, no taxes are created from those templates marked inactive during the Create Chart of Accounts from Template operation. Therefore, the creation of chart of accounts will fail because some of the tax code lines cannot be created because of missing taxes (those that were not created).

Hence, I wonder if this is normal behavior or is it considered a bug?

I know the solution is to change the tax templates back to active by editing the XML, but this will not help accomplish my intention which is hide those rarely used taxes unless the user explicitly needs them.

For me it is the expected behavior. Because the users have not write access on templates so they can not be used for some kind of configuration.

If you want to have different set of taxes for the same chart of account, you can define for example extended taxes in a dedicated module that create them as template linked to the base chart of account and register them in the tax code templates.

I was thinking that the user will not modify the template but instead modify the tax afterwards when it was created. If the current behavior is expected then what is the purpose of active field defined in the template?

The tax template is rarely edited from the Tryton client (probably you can’t really change it), most of the time it is imported from the XML of a module. So over time, if taxes change due to government policies updates, most likely the template XML will be updated. I don’t see the active field being used in the template. So, most likely a developer will not use this active field and have it set to False just to exclude the tax from being created, if he/she doesn’t need a tax it is reasonable that the template would not be included in the XML in the first place. I was hoping to ease the trouble of having to create an additional module just to extend those optional taxes, and just have the system create the corresponding taxes but mark them as not active just as the template indicates from XML. Then the user will enabled these optional Taxes as he/she needs without touching the templates at all.

To register the deletion of a record.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.