# appointment count section
def visitor_appointment(self):
return {
'name': _('Appointment'),
'domain': [('v_name', '=', self.id)],
'view_type': 'form',
'res_model': 'visitor.data',
'view_id': False,
'view_mode': 'tree,form',
'type': 'ir.actions.act_window',
}
def get_appoint_count(self):
count = self.env['visitor.data'].search_count([('v_name', '=', self.id)])
self.appoint_count = count
appoint_count = fields.Integer(string='Appointment', computed='get_appoint_count')
here counted value not show
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Dear Arjun,
def get_appoint_count(self):
count = self.env['visitor.data'].search_count([('v_name', '=', self.id)])
self.appoint_count = count
check this domain condition ('v_name', '=', self.id), is it based on a name or id.
def get_appoint_count(self):
count = self.env['visitor.data'].search_count([('v_name', '=', self.id)])
self.appoint_count = count
I tried this but not working
there is a problem with this domain
count = self.env['visitor.data'].search_count([('v_name', '=', self.id)])
ex 1:
count = self.env['visitor.data'].search_count([('v_name', '=', 'arjun')])
or
count = self.env['visitor.data'].search_count([('id', '=', self.id)])
can i give the code?
here is my field
I_AM = fields.Selection([('visitor', 'Visitor'), ('guest', 'Guest'), ('labour', 'Labour')], required=True)
v_name = fields.Char(string="Name", required=True, track_visibility="always")
v_company = fields.Char(string="Company", required=True, track_visibility="always")
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
Data for relations table
Solved
|
|
1
Apr 24
|
920 | |
|
1
Aug 22
|
1687 | ||
|
0
May 17
|
6331 | ||
|
1
Mar 15
|
3096 | ||
|
2
Mar 15
|
3382 |
print the variable count and see what the search count is returned? Might be count is 0 as there is no matching records ? Add a print and see
not working now what can i do, kindly help me
Are you trying to compare string and integer type?