Skip to content

Commit

Permalink
[MIG] delivery_correos_express: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-cort-s73 committed Nov 22, 2024
1 parent 7d69cc2 commit 2b42409
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 47 deletions.
2 changes: 1 addition & 1 deletion delivery_correos_express/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Delivery Correos Express",
"summary": "Delivery Carrier implementation for Correos Express using their API",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Stock",
"website": "https://github.com/OCA/delivery-carrier",
"author": "Studio73, Odoo Community Association (OCA)",
Expand Down
6 changes: 3 additions & 3 deletions delivery_correos_express/models/correos_express_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ def _check_for_error(self, result):
return_code = 999
message = "Webservice ERROR."
# shipment
if type(result.get("codigoRetorno", "false")) != str:
if type(result.get("codigoRetorno", "false")) != isinstance(str):
return_code = result.get("codigoRetorno")
message = result.get("mensajeRetorno") or ""
# label
if type(result.get("codErr", "false")) != str:
if type(result.get("codErr", "false")) != isinstance(str):
return_code = result.get("codErr")
message = result.get("desErr") or ""
# tracking
if type(result.get("error", "false")) != str:
if type(result.get("error", "false")) != isinstance(str):
return_code = result.get("error")
message = result.get("mensajeError") or ""
return return_code, message
Expand Down
44 changes: 8 additions & 36 deletions delivery_correos_express/views/delivery_carrier_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,66 +7,38 @@
<xpath expr="//notebook/page[1]" position='before'>
<page
string="Correos Express Configuration"
attrs="{'invisible': [('delivery_type', '!=', 'correos_express')]}"
invisible="delivery_type != 'correos_express'"
>
<group>
<group>
<field
name="correos_express_username"
attrs="{
'required': [
('delivery_type', '=', 'correos_express')
]
}"
required="delivery_type == 'correos_express'"
/>
<field
name="correos_express_password"
password="True"
attrs="{
'required': [
('delivery_type', '=', 'correos_express')
]
}"
required="delivery_type == 'correos_express'"
/>
<field
name="correos_express_customer_code"
attrs="{
'required': [
('delivery_type', '=', 'correos_express')
]
}"
required="delivery_type == 'correos_express'"
/>
<field
name="correos_express_sender_code"
attrs="{
'required': [
('delivery_type', '=', 'correos_express')
]
}"
required="delivery_type == 'correos_express'"
/>
<field
name="correos_express_label_type"
attrs="{
'required': [
('delivery_type', '=', 'correos_express')
]
}"
required="delivery_type == 'correos_express'"
/>
<field
name="correos_express_product"
attrs="{
'required': [
('delivery_type', '=', 'correos_express')
]
}"
required="delivery_type == 'correos_express'"
/>
<field
name="correos_express_transport"
attrs="{
'required': [
('delivery_type', '=', 'correos_express')
]
}"
required="delivery_type == 'correos_express'"
/>
</group>
</group>
Expand Down
8 changes: 1 addition & 7 deletions delivery_correos_express/views/stock_picking_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@
name="correos_express_get_label"
string="Print Correos Express Label"
type="object"
attrs="{'invisible':[
'|',
'|',
('carrier_tracking_ref', '=', False),
('delivery_type', '!=', 'correos_express'),
('state', '!=', 'done')
]}"
invisible="(carrier_tracking_ref != True) or (delivery_type != 'correos_express') or (state != 'done')"
/>
</xpath>
</field>
Expand Down

0 comments on commit 2b42409

Please sign in to comment.