From 37a999dc77911696ed054dd02e4003c34b49fedf Mon Sep 17 00:00:00 2001
From: Laurent Smet <las@odoo.com>
Date: Fri, 29 Oct 2021 09:42:08 +0000
Subject: [PATCH] [FIX] account_facturx: Don't import the delivery address

When exporting, the delivery address is put inside the xml.
This field is added by the 'sale' module and is not supposed to be displayed for vendor bill.
However, even if this field isn't displayed, the factur-x module was setting the wrong delivery address on it.

closes odoo/odoo#79194

Issue: 2668902
X-original-commit: 75b233712c192d50b6f42044e84e1eae62173050
Signed-off-by: Josse Colpaert <jco@openerp.com>
Signed-off-by: Laurent Smet <las@openerp.com>
---
 addons/account_edi_facturx/models/account_edi_format.py | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/addons/account_edi_facturx/models/account_edi_format.py b/addons/account_edi_facturx/models/account_edi_format.py
index 8b3a1f684f7f..9206c517c967 100644
--- a/addons/account_edi_facturx/models/account_edi_format.py
+++ b/addons/account_edi_facturx/models/account_edi_format.py
@@ -203,14 +203,6 @@ class AccountEdiFormat(models.Model):
                 vat=self._find_value('//ram:' + partner_type + '/ram:SpecifiedTaxRegistration/ram:ID', tree, namespaces=tree.nsmap),
             )
 
-            # Delivery partner
-            if 'partner_shipping_id' in invoice._fields:
-                invoice_form.partner_shipping_id = self_ctx._retrieve_partner(
-                    name=self._find_value('//ram:ShipToTradeParty/ram:Name', tree, namespaces=tree.nsmap),
-                    mail=self._find_value('//ram:ShipToTradeParty//ram:URIID[@schemeID=\'SMTP\']', tree, namespaces=tree.nsmap),
-                    vat=self._find_value('//ram:ShipToTradeParty/ram:SpecifiedTaxRegistration/ram:ID', tree, namespaces=tree.nsmap),
-                )
-
             # Reference.
             elements = tree.xpath('//rsm:ExchangedDocument/ram:ID', namespaces=tree.nsmap)
             if elements:
-- 
GitLab