[FIX] l10n_in_sale: place of supply base on delivery address

Before this commit:

place of supply always set from customer address.

After this commit:

place of supply is set by delivery address

closes odoo/odoo#67393

Opw: 2456095
X-original-commit: dd141a882478c2e3684638321f36b952bcac3858
Signed-off-by: Josse Colpaert <jco@openerp.com>
This commit is contained in:
Jigar Vaghela
2021-03-05 15:47:15 +00:00
parent 076952189c
commit ec72da926f
@@ -7,6 +7,16 @@ from odoo import models
class L10nInAccountInvoiceReport(models.Model):
_inherit = "l10n_in.account.invoice.report"
def _from(self):
from_str = super(L10nInAccountInvoiceReport, self)._from()
return from_str.replace(
"LEFT JOIN res_country_state ps ON ps.id = p.state_id",
"""
LEFT JOIN res_partner dp ON dp.id = am.partner_shipping_id
LEFT JOIN res_country_state ps ON ps.id = dp.state_id
"""
)
def _where(self):
where_str = super(L10nInAccountInvoiceReport, self)._where()
where_str += """ AND (aml.product_id IS NULL or aml.product_id != COALESCE(