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
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
5029
Widoki
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
2
wrz 23
|
5707 | ||
|
0
cze 22
|
2181 | ||
|
1
lip 20
|
3863 | ||
|
1
maj 20
|
8054 | ||
|
1
sty 25
|
1638 |