Skip to Content
Menu
This question has been flagged
913 Views

In the Enterprise Tax Cloud module:   sale_account_taxcloud | sale_order.py | validate_taxes_on_sales_order()


Consider that if Tax Cloud returns a % that is not already in Odoo, it will Create a new one.  BUT, if one exists it simply re-uses it.

HOWEVER, in the re-use code, you always set it to Active - 

if tax:
   tax.active = True  # Needs to be active to be included in order total computation

Issue:  This simple activity will cause a LOT of triggers to fire on Line Items, which will then fire on Sales Orders.  Programmers may not be existing this to happen.  

Consider an approval check, whereby a coder monitors the Amount_Total field on the Sales Order Header - if a constraint is made to warn a user about large transactions (or transactions that are over a recommended amount), the Tax Cloud operation will actually do this for MANY sales orders (even if in the UI, the user is Confirming a single sales order).

At minimum, this operation should check if it is Inactive first - even better would be simply warning the user that the Tax record already exists but is disabled, and instead some other operation should take place.  But it is fairly common to monitor the total amount of a Sales Order and build checks/approvals for such activity.

Avatar
Discard
Related Posts Replies Views Activity
1
Jul 20
4235
1
Apr 20
3095
1
Jan 20
2167
1
Apr 19
2111
0
Mar 19
2157