Skip to content

Commit 7405c44

Browse files
committed
fixup! [ADD] website_sale_one_time_delivery_address
1 parent eb54900 commit 7405c44

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

website_sale_one_time_delivery_address/models/res_partner.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ class ResPartner(models.Model):
2424
)
2525

2626
def _get_delivery_address_domain(self):
27-
"""Extend the delivery address domain to also list one_time_delivery
28-
contacts alongside the standard 'delivery'/'other' addresses."""
29-
return super()._get_delivery_address_domain() | Domain(
30-
[
31-
("commercial_partner_id", "in", self.commercial_partner_id.ids),
32-
("type", "=", "one_time_delivery"),
33-
]
34-
)
27+
# Extend the delivery address domain to also list one_time_delivery
28+
# contacts alongside the standard 'delivery'/'other' addresses.
29+
res = super()._get_delivery_address_domain()
30+
if all(partner.allow_dropship for partner in self):
31+
res |= Domain(
32+
[
33+
("commercial_partner_id", "in", self.commercial_partner_id.ids),
34+
("type", "=", "one_time_delivery"),
35+
]
36+
)
37+
return res

0 commit comments

Comments
 (0)