0% found this document useful (0 votes)
9 views1 page

Sale Order

The code snippet updates the first order line of a record if it contains order lines. It modifies the product ID, unit price, and quantity of that order line. This is achieved using a write command with an update operation on the specific order line's ID.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Sale Order

The code snippet updates the first order line of a record if it contains order lines. It modifies the product ID, unit price, and quantity of that order line. This is achieved using a write command with an update operation on the specific order line's ID.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

for record in self:

if record.order_line:
record.write({
'order_line': [
Command.update(record.order_line[0].id, { # Updating the
first order line
'product_id': product_id.id,
'price_unit': new_price,
'product_uom_qty': new_qty
})
]
})

You might also like