Ir al contenido
Menú
Se marcó esta pregunta
1685 Vistas

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
jul 20
5175
1
abr 20
4081
1
ene 20
3031
1
abr 19
2870
0
mar 19
2944