Skip to content

Commit

Permalink
[FIX] fix and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nayatec committed Oct 25, 2024
1 parent a8618d7 commit 48484c6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions sale_import_base/components/importer_sale_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def _prepare_sale_vals(self, data):
channel = self.env["sale.channel"].browse(self.collection.record_id)
partner = self._process_partner(data["address_customer"])
address_invoice, address_shipping = self._process_addresses(
partner, data["address_invoicing"], data["address_shipping"], channel.auto_archive_address
partner,
data["address_invoicing"],
data["address_shipping"],
channel.auto_archive_addresses,
)
so_vals = {
"partner_id": partner.id,
Expand Down Expand Up @@ -147,12 +150,14 @@ def _prepare_partner(self, data, parent_id=None, archived=None):
result["state_id"] = state.id
return result

def _process_addresses(self, parent, address_invoice, address_shipping, archive_address=True):
def _process_addresses(
self, parent, address_invoice, address_shipping, archive_addresses=True
):
vals_addr_invoice = self._prepare_partner(
address_invoice, parent.id, archive_address
address_invoice, parent.id, archive_addresses
)
vals_addr_shipping = self._prepare_partner(
address_shipping, parent.id, channel.archive_address
address_shipping, parent.id, archive_addresses
)
if vals_addr_invoice == vals_addr_shipping:
# not technically correct for the shipping addr, but this shouldn't matter
Expand Down

0 comments on commit 48484c6

Please sign in to comment.