Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Nov 24
1145
2
Mar 24
3594
0
Sep 15
4162
2
Nov 15
4497
1
Mei 25
1209