Closed maneandrea closed 2 months ago
For internal reference, here is the motivation of the PR:
In IRCodoo we have a map_tax
that looks like this:
def map_tax(self, taxes):
fees = self.mapped("tax_ids.tax_dest_id").filtered("is_fee")
if fees:
taxes |= fees
return super().map_tax(taxes)
so if this function gets an empty recordset, it could still output something useful.
However, the condition if tax_ids
here just skips that line (with the logic that in normal Odoo that like is useless on an empty recordset.)
See related MR in ircodoo https://gitlab.com/ircanada/ircodoo/-/merge_requests/2939
@moylop260 @luisg123v
IRC doesn't use this feature since that they are using sale.order instead of account.move
sale.order is doing the things good however it looks they have different code
Also, @randall-vx sent us a commit where all these kind of methods were merged in one model:
So, maybe we shouldn't dedicate resources to this now
In odoo the function
map_tax
in account.fiscal.position returns an empty recordset of account.tax if it receives an empty recordset as input.Some extensions of odoo might change this behavior and return a non- empty recordset even with an empty input. For example
map_tax
might returntax_ids.tax_dest_id
which haveis_fee = True
.This commit removes the validation
if tax_ids
so thatmap_tax
is always called. In vanilla Odoo this just adds a noop because it would call a method which loops over zero elements and returns.I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr