跳至內容
選單
此問題已被標幟
5 回覆
4176 瀏覽次數

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?

頭像
捨棄
最佳答案

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})

頭像
捨棄
最佳答案

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

頭像
捨棄
最佳答案

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.


頭像
捨棄
最佳答案

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.

頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
11月 24
1149
2
3月 24
3605
0
9月 15
4167
2
11月 15
4502
1
5月 25
1211