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
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
1
Balas
5038
Tampilan
Hi,
Please check this.
@api.onchange('test_field')
def _onchange_test_field(self):
for line in self.order_line:
for move in line.move_ids:
move.state = 'new_state'
Hope it helps
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
2
Sep 23
|
5707 | ||
|
0
Jun 22
|
2186 | ||
|
1
Jul 20
|
3869 | ||
|
1
Mei 20
|
8060 | ||
|
1
Jan 25
|
1646 |