hello all,
requirement: want to have same zone to select Rider the Customer is in. (both are in same table) --in below code, last line contains rider_id field, first condition is working fine--
it is showing error as below (searched here and google for "Invalid composed field" but no luck):
Invalid composed field user_id.zone_id in field rider_id default domain ([('category_id.name','ilike','rider'),('zone_id','=',user_id.zone_id)])
definitely i am doing wrong here, please help to correct it.
my model:
class Orders(models.Model):
_name = 'tests.testsorders'
_rec_name = 'name'
_description = "Tests Orders"
order_date = fields.Date(string="Order Date", required=True, default=datetime.today())
name = fields.Char(string="Description")
customer_id = fields.Many2one('res.partner', string="Customer",
domain="[['category_id.name','ilike','customer']]",
required=True)
status = fields.Selection([
('pending', 'Pending'),
('incomplete', 'InComplete'),
('complete', 'Complete')
], required=True, string="Order Status", default='pending')
rider_id = fields.Many2one('res.partner', string="Rider",
domain="[('category_id.name','ilike','rider'),
('zone_id','=',customer_id.zone_id)]", required=True)
regards