I have this class
name = fields.Char("Name")
sequence = fields.Integer("Sequence")
description = fields.Text("Description")
I need a search method to find the id with lower sequence
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
I have this class
name = fields.Char("Name")
sequence = fields.Integer("Sequence")
description = fields.Text("Description")
I need a search method to find the id with lower sequence
Hi Josemi
you could do it like:
lowest_id = self.env['model_name'].search([('sequence', '!=', False)], order='ASC', limit=1)Create an account today to enjoy exclusive features and engage with our awesome community!
Реєстрація| Related Posts | Відповіді | Переглядів | Дія | |
|---|---|---|---|---|
| 
             | 
        
            
                
                2
            
            
             лют. 25  
         | 
        9323 | ||
| 
             | 
        
            
                
                0
            
            
             серп. 22  
         | 
        59 | ||
| 
             | 
        
            
                
                1
            
            
             лют. 16  
         | 
        6499 | ||
| 
             | 
        
            
                
                0
            
            
             груд. 24  
         | 
        1443 | ||
| 
             | 
        
            
                
                1
            
            
             бер. 24  
         | 
        2143 |