I'm using odoo 10, I have added the many2one field "task_id" to the model sale.order
python file :
class SaleOrder(models.Model):
_inherit = "sale.order"
task_id = fields.Many2one('project.task', 'Task name')
class ProjectTask (models.Model):
_inherit = "project.task"
order_lines = fields.One2many('task.order.line','task_id',string="Products")
class TaskOrderLine(models.Model):
_name = 'task.order.line'
task_id = fields.Many2one('project.task')
product_id = fields.Many2one('product.product', string='Products')
in xml file i used :
<xpath expr="//form/sheet/notebook/page/field/tree/field[@name='product_id']" position="attributes">
<attribute name="domain">[('task_id', 'in', task_id)]</attribute>
</xpath>
I want to apply domain to the many2one field " product_id" in the sale.order to display only products that belongs to the selected "task_id"
it shows me error , any suggestions on how to apply correctly the domain in order to filter the products shown in the sale.order depending on the selected "task_id" ?