add fix if the PO already locked
This commit is contained in:
parent
961f81a806
commit
7775323294
Binary file not shown.
@ -144,10 +144,19 @@ class AccountMoveLine(models.Model):
|
||||
|
||||
# Update PO Line
|
||||
# We update both to ensure consistency
|
||||
|
||||
po = po_line.order_id
|
||||
was_locked = po.state == 'done'
|
||||
if was_locked:
|
||||
po.button_unlock()
|
||||
|
||||
po_line.write({
|
||||
'price_unit': price_unit,
|
||||
'product_qty': product_qty,
|
||||
})
|
||||
|
||||
if was_locked:
|
||||
po.button_done()
|
||||
|
||||
return res
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user