Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
17275 มุมมอง

I have a locked Sales order. But it was wrong. Accidentally locked it. Now, it is stuck at locked status. I need it to change it to Draft and make some changes. 

How can I do it?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

I had use this code in onchange method of my custom module, done is the state for locked sale

sales = self.env['sale.order']
recSale = sales.search([('state', '=', 'done')])
for x in recSale:
x.write({'state': 'draft'})
อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

If I update a query manually, will accounting and delivery will be in synced? 

How do I make sure that nothing is broken? or how do I check what transactions - Account, stock move were generated prior to locking the SO?


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You can query that in postgres , its like "update sale order table set status = 'draft'  where status = 'locked'

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hey

Currently There Is No Button in sale order After You Lock It. If You want to Change Something on sale order after Lock You have to add button and stages as per your requirement.


Thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hey,

there is one button named as 'Unlock' on Sales order itself .by using it you can unlock the Sales order.

So,

1) click on 'Unlock' button

2) click on Cancel button and then

3) click on 'Set to Quotation' button so you will get draft record easily.

Thanks

อวตาร
ละทิ้ง