When I try to update a field before raising a UserError, the value doesn't get saved to the database. How can I ensure the field is saved even before the UserError is raised?
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- CRM
- e-Commerce
- Apskaita
- Atsarga
- PoS
- Project
- MRP
This question has been flagged
            
                1
                
                    Atsakyti
                
            
        
        
            
                1319
                
                    Rodiniai
                
            
        
    We can use
self.env.cr.commit()
just before the UserError() to save the values.
Eg:
self.env.cr.commit()
raise UserError('Some issue has been occured')
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registracija| Related Posts | Replies | Rodiniai | Veikla | |
|---|---|---|---|---|
|  | 1 gruod. 18  | 5690 | ||
|  | 0 birž. 21  | 6980 | ||
|  | 1 lapkr. 22  | 7128 | ||
|  | 1 spal. 21  | 4025 | ||
|  | 2 lapkr. 18  | 10854 | 
