Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Hpar <[email protected]>
  • Loading branch information
nayatec and hparfr authored Oct 25, 2024
1 parent 433fec1 commit a8618d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 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,7 @@ 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
partner, data["address_invoicing"], data["address_shipping"], channel.auto_archive_address
)
so_vals = {
"partner_id": partner.id,
Expand Down Expand Up @@ -147,12 +147,12 @@ 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, channel):
def _process_addresses(self, parent, address_invoice, address_shipping, archive_address=True):
vals_addr_invoice = self._prepare_partner(
address_invoice, parent.id, channel.auto_archive_addresses
address_invoice, parent.id, archive_address
)
vals_addr_shipping = self._prepare_partner(
address_shipping, parent.id, channel.auto_archive_addresses
address_shipping, parent.id, channel.archive_address
)
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 a8618d7

Please sign in to comment.