Hi community,
I tried to run a function (in odoo10) when the attribute "route_id" (in sale.order.line) is changed but nothing happens. Here my code :
file sale_order.pyI don't see the logs message, if somebody can help me ?
class saleOrder(models.Model):
_inherit = 'sale.order'
@api.multi
@api.depends("order_line")
def _compute_products(self):
_logger.error('@@@@@@@@@')
def action_change_route_id(self):
for line in self.order_line
line.route_id = 3
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
@api.onchange("route_id") #also tried with @api_depends("route_id")
def on_change_route_id(self):
_logger.error('________')
self.order_id._compute_products()
Thank you