Hi,
how can I update a stock.move field in sale.order in an onchange method?
I have the following workaround:
@api.onchange("test_field")
def _on_change(self):
list = []
for line in self.order_line:
for move in line.move_ids:
move.update({'state': 'new_state'}) #not working! -> no error but no change on database
list.append([1, self._origin.id, line])
self.update({'order_line': list }) #not working! -> error: AttributeError: 'sale.order.line' object has no attribute 'items'
What am I doing wrong here? Is there another possibility to change the move_line state from sale_order??
Thanks!!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
4099
Views
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Sep 23
|
4493 | ||
|
0
Jun 22
|
1298 | ||
|
1
Jul 20
|
2943 | ||
|
1
May 20
|
6645 | ||
|
3
Oct 23
|
5974 |