I'm getting the following error when executing an Automated Action in Odoo: ValueError: : "can't adapt type 'product.template'" while evaluating
I'm trying to update the 'sequence' value in model 'product.supplierinfo' so that when the supplier's price are updated from a purchase order, that supplier is prioritized to calculate the replenishment cost. To achive that, it must set the lowest 'sequence' value for that product.
I'm getting an error on a module I'm not calling in my code. Any ideas why?
product = record.product_tmpl_id record['sequence'] = 1 val = 1 registros = env['product.supplierinfo'].search([('product_tmpl_id','=',product)],order="sequence asc") for line in registros: valor = val + 1 line['sequence'] = valor
Automated Action Settings:
- Model: product.supplierinfo
- Action: Execute Python code
- Condition: Creat and update