Hi,
I would like to update stock_move.state when a field in sales_order is changing.
I have tried to solve this with @api.onchange which is not working because it runs in cache only.
What is best practice to update a database entry when a field is changing?
Thanks!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
3819
Lượt xem
Hi,
I suggest you to use related fields.
e.g.:
class StockPicking(models.Model):
_inherit = 'stock.picking'
website_id = fields.Many2one('website', related='sale_id.website_id', string='Website',
help='Website this picking belongs to.',
store=True, readonly=True)
Best regards!
Hi Sylvain,
thanks for your reply! So far so good- but what can I do to change move_state when this sales-order-field is changing? I suggest the @api.onchange-workaround won't work here as well...
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký