Skip to content

Commit b2dcabb

Browse files
[FIX] delivery_multi_destination: Filter subdestination carriers from other companies
In the context where `carrier.child_ids` is being examined, all existing subdestinations, no matter the company they have, are shown as being in a sudo environment, so we need to filter them out those from other companies. TT43596
1 parent 1e42e12 commit b2dcabb

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

delivery_multi_destination/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
{
77
"name": "Multiple destinations for the same delivery method",
8-
"version": "15.0.1.0.1",
8+
"version": "15.0.1.0.2",
99
"category": "Delivery",
1010
"website": "https://github.com/OCA/delivery-carrier",
1111
"author": "Tecnativa, Odoo Community Association (OCA)",

delivery_multi_destination/i18n/es.po

+11-15
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ msgstr ""
1010
"Project-Id-Version: Odoo Server 10.0\n"
1111
"Report-Msgid-Bugs-To: \n"
1212
"POT-Creation-Date: 2018-03-13 03:45+0000\n"
13-
"PO-Revision-Date: 2022-04-21 16:05+0000\n"
14-
"Last-Translator: Pedro M. Baeza <pedro.baeza@gmail.com>\n"
13+
"PO-Revision-Date: 2023-10-09 07:43+0000\n"
14+
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
1515
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
1616
"Language: es\n"
1717
"MIME-Version: 1.0\n"
1818
"Content-Type: text/plain; charset=UTF-8\n"
1919
"Content-Transfer-Encoding: \n"
2020
"Plural-Forms: nplurals=2; plural=n != 1;\n"
21-
"X-Generator: Weblate 4.3.2\n"
21+
"X-Generator: Weblate 4.17\n"
2222

2323
#. module: delivery_multi_destination
2424
#: model:delivery.carrier,name:delivery_multi_destination.delivery_carrier_multi_child_1
@@ -27,14 +27,13 @@ msgstr "Bélgica"
2727

2828
#. module: delivery_multi_destination
2929
#: model:ir.model.fields,field_description:delivery_multi_destination.field_delivery_carrier__destination_type
30-
#, fuzzy
3130
msgid "Destination Type"
3231
msgstr "Tipo de destino"
3332

3433
#. module: delivery_multi_destination
3534
#: model:ir.model.fields,field_description:delivery_multi_destination.field_delivery_carrier__child_ids
3635
msgid "Destination grid"
37-
msgstr ""
36+
msgstr "Cuadrícula de destino"
3837

3938
#. module: delivery_multi_destination
4039
#: model_terms:ir.ui.view,arch_db:delivery_multi_destination.view_delivery_carrier_form
@@ -51,28 +50,25 @@ msgstr "Francia"
5150
#: model:product.product,name:delivery_multi_destination.product_product_delivery_carrier_multi
5251
#: model:product.template,name:delivery_multi_destination.product_product_delivery_carrier_multi_product_template
5352
msgid "International Carrier Inc."
54-
msgstr "Transportes Internacionales, S.A."
53+
msgstr "Transportes Internacionales Inc."
5554

5655
#. module: delivery_multi_destination
5756
#: model:product.product,name:delivery_multi_destination.product_product_delivery_carrier_multi_child_1
5857
#: model:product.template,name:delivery_multi_destination.product_product_delivery_carrier_multi_child_1_product_template
59-
#, fuzzy
6058
msgid "International Carrier Inc., Belgium"
61-
msgstr "Transportes Internacionales, S.A."
59+
msgstr "Transportes Internacionales Inc., Bélgica"
6260

6361
#. module: delivery_multi_destination
6462
#: model:product.product,name:delivery_multi_destination.product_product_delivery_carrier_multi_child_2
6563
#: model:product.template,name:delivery_multi_destination.product_product_delivery_carrier_multi_child_2_product_template
66-
#, fuzzy
6764
msgid "International Carrier Inc., France"
68-
msgstr "Transportes Internacionales, S.A."
65+
msgstr "Transportes Internacionales Inc., Francia"
6966

7067
#. module: delivery_multi_destination
7168
#: model:product.product,name:delivery_multi_destination.product_product_delivery_carrier_multi_child_3
7269
#: model:product.template,name:delivery_multi_destination.product_product_delivery_carrier_multi_child_3_product_template
73-
#, fuzzy
7470
msgid "International Carrier Inc., United Kingdom"
75-
msgstr "Transportes Internacionales, S.A."
71+
msgstr "Transporte Internacional Inc., Reino Unido"
7672

7773
#. module: delivery_multi_destination
7874
#: model:ir.model.fields.selection,name:delivery_multi_destination.selection__delivery_carrier__destination_type__multi
@@ -92,13 +88,13 @@ msgstr "Transportista matriz"
9288
#. module: delivery_multi_destination
9389
#: model:ir.model,name:delivery_multi_destination.model_delivery_carrier
9490
msgid "Shipping Methods"
95-
msgstr ""
91+
msgstr "Métodos de Envío"
9692

9793
#. module: delivery_multi_destination
9894
#: code:addons/delivery_multi_destination/models/delivery_carrier.py:0
9995
#, python-format
10096
msgid "There is no matching delivery rule."
101-
msgstr ""
97+
msgstr "No hay una regla de entrega coincidente."
10298

10399
#. module: delivery_multi_destination
104100
#: model:delivery.carrier,name:delivery_multi_destination.delivery_carrier_multi_child_3
@@ -115,4 +111,4 @@ msgstr "Reino Unido"
115111
#: model:product.template,uom_name:delivery_multi_destination.product_product_delivery_carrier_multi_child_3_product_template
116112
#: model:product.template,uom_name:delivery_multi_destination.product_product_delivery_carrier_multi_product_template
117113
msgid "Units"
118-
msgstr ""
114+
msgstr "Unidades"

delivery_multi_destination/models/delivery_carrier.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ def send_shipping(self, pickings):
9191
res = []
9292
for p in pickings:
9393
picking_res = False
94-
for subcarrier in carrier.child_ids:
94+
for subcarrier in carrier.child_ids.filtered(
95+
lambda x: not x.company_id or x.company_id == p.company_id
96+
):
9597
if subcarrier.delivery_type == "fixed":
9698
if subcarrier._match_address(p.partner_id):
9799
picking_res = [

0 commit comments

Comments
 (0)