Ir al contenido
Menú
Se marcó esta pregunta

Dear all,


I would like to change the delivery method after a delivery order is validated.

For example when you validate the delivery order with the wrong carrier, I would like to change it afterwards that I am able to print a new label for the correct carrier.


Is this possible?

Avatar
Descartar
Mejor respuesta

Just Try to Quantity replace with ZERO that's make delivery order Cancelled, Revert Quantity in Inventory as well and Remove Line from Stock History also 

move_lines = saleorder.picking_ids.move_ids.move_line_ids
if move_lines:
for move_line in move_lines:
move_line.write({'quantity': 0.00})

Avatar
Descartar
Mejor respuesta

Hi,

In the default ODOO the field 'Carrier'(carrier_id) of delivery order is read only in state done and cancel. When the delivery order is validated, it is in the done state, so the carrier cannot be changed. In order to change the field after validation you need to remove the readonly properties of the field carrier_id. By default, it is defined as:

<field name="carrier_id" attrs="{'readonly': [('state', 'in', ('done', 'cancel'))]}" options="{'no_create': True, 'no_open': True}"/>

Inherit that view and replace it as follows

<field name="carrier_id"  options="{'no_create': True, 'no_open': True}"/> 

Alternatively, you can update the value by writing a query or using postgres

For view inheritance please refer the blog

https://www.cybrosys.com/blog/different-types-of-inheritance-in-odoo-15

Regards

Avatar
Descartar
Mejor respuesta

Yes, it is possible to change the delivery method (also known as the carrier) of a validated delivery order in Odoo. To do this, you will need to go to the "Inventory" module and find the delivery order that you want to modify. Once you have opened the delivery order, you can click the "Edit" button to access the delivery order's form view.

On the delivery order form, you will see a field called "Carrier" or "Delivery Method" that allows you to select a different carrier for the delivery order. Simply select the new carrier from the drop-down menu and click the "Save" button to update the delivery order.

Keep in mind that changing the carrier of a validated delivery order may have implications for your inventory and shipping process, so it is important to carefully consider the impact of this change before proceeding.


Avatar
Descartar
Mejor respuesta

Once the delivery order is validated its not the right approrach to change any information after that becuase most of the linking table have updated with all the validated information.

But still you wants it then you should update it via postgress query or writing any scripts but make sure these information should also updated to all its linking tables too.

Avatar
Descartar
Mejor respuesta

It is possible to export to xls the validated operations, update the carrier and reference and import it

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
nov 24
1147
2
mar 24
3597
0
sept 15
4164
2
nov 15
4498
1
may 25
1209