Skip to content

Conversation

@sebastienbeau
Copy link
Collaborator

No description provided.

@chafique-delli chafique-delli force-pushed the 16.0-mig-delivery-pickup branch 3 times, most recently from 98c42b6 to 8705c0a Compare May 6, 2024 18:05
@chafique-delli
Copy link

@sebastienbeau ,can you do a review.

@chafique-delli chafique-delli force-pushed the 16.0-mig-delivery-pickup branch 3 times, most recently from 6182121 to 6170e7f Compare May 17, 2024 12:52
Comment on lines 49 to 51
pickup_site_id = data.pickup_site_id
pickup_site_obj = self.env["dropoff.site"]
pickup_site = pickup_site_obj.search([("id", "=", pickup_site_id.id)])
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pickup_site_id = data.pickup_site_id
pickup_site_obj = self.env["dropoff.site"]
pickup_site = pickup_site_obj.search([("id", "=", pickup_site_id.id)])
picking_site = self.env["dropoff.site"].search([("id", "=", data.pickup_site_id)])

pickup_site = pickup_site_obj.search([("id", "=", pickup_site_id.id)])
if not pickup_site:
raise UserError(_("Invalid code for pickup site"))
self._set_carrier(cart, pickup_site)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self._set_carrier(cart, pickup_site)
if pickup_site.carrier_id not in cart.shopinvader_available_carrier_ids:
raise UserError(_("This delivery method is not available for your order"))
self._set_carrier_and_price(cart, pickup_site.carrier_id.id)

@@ -0,0 +1,13 @@
# Copyright 2019 ACSONE SA/NV
Copy link
Collaborator Author

@sebastienbeau sebastienbeau May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed, file can be removed

Comment on lines 62 to 74
if cart and cart.shopinvader_available_carrier_ids:
available_carriers = cart.shopinvader_available_carrier_ids
domain = self._get_domain_dropoff_site(params, available_carriers)
return self.env["dropoff.site"].search(domain)
return self.env["dropoff.site"].search([])

def _get_domain_dropoff_site(self, params, available_carriers):
carrier_id = params.carrier_id
if carrier_id:
if carrier_id not in available_carriers.ids:
return FALSE_DOMAIN
return [("carrier_id", "=", carrier_id)]
return [("carrier_id", "in", available_carriers.ids)]
Copy link
Collaborator Author

@sebastienbeau sebastienbeau May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if cart and cart.shopinvader_available_carrier_ids:
available_carriers = cart.shopinvader_available_carrier_ids
domain = self._get_domain_dropoff_site(params, available_carriers)
return self.env["dropoff.site"].search(domain)
return self.env["dropoff.site"].search([])
def _get_domain_dropoff_site(self, params, available_carriers):
carrier_id = params.carrier_id
if carrier_id:
if carrier_id not in available_carriers.ids:
return FALSE_DOMAIN
return [("carrier_id", "=", carrier_id)]
return [("carrier_id", "in", available_carriers.ids)]
domain = data.to_odoo_domain()
if cart:
domain = expression.AND([domain, [("carrier_id", "in", cart.shopinvader_available_carrier_ids.ids)])
return self.env["dropoff.site"].search(domain)

@chafique-delli chafique-delli force-pushed the 16.0-mig-delivery-pickup branch 2 times, most recently from 3082d19 to ddc0dfc Compare May 24, 2024 15:42
@chafique-delli chafique-delli force-pushed the 16.0-mig-delivery-pickup branch from ddc0dfc to 046785c Compare May 29, 2024 13:29
@sebastienbeau sebastienbeau added this to the 16.0 milestone Jun 5, 2024
@chafique-delli chafique-delli force-pushed the 16.0-mig-delivery-pickup branch from 046785c to 75fff45 Compare June 6, 2024 10:56
@chafique-delli chafique-delli force-pushed the 16.0-mig-delivery-pickup branch from 75fff45 to 9073abf Compare August 29, 2024 10:16
@chafique-delli chafique-delli force-pushed the 16.0-mig-delivery-pickup branch from 9073abf to 0ca4616 Compare August 30, 2024 14:32
@sebastienbeau sebastienbeau force-pushed the 16.0-mig-delivery-pickup branch from 14fdb58 to d87684c Compare September 4, 2024 09:06
@chafique-delli chafique-delli force-pushed the 16.0-mig-delivery-pickup branch 4 times, most recently from 3b4f49d to c4065c2 Compare September 6, 2024 10:28
@sebastienbeau sebastienbeau force-pushed the 16.0-mig-delivery-pickup branch from c4065c2 to 6b93a80 Compare September 6, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants