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
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
            
                1
                
                    Balas
                
            
        
        
            
                1271
                
                    Tampilan
                
            
        
    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')
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar| Post Terkait | Replies | Tampilan | Aktivitas | |
|---|---|---|---|---|
|  | 1 Des 18  | 5636 | ||
|  | 0 Jun 21  | 6934 | ||
|  | 1 Nov 22  | 7014 | ||
|  | 1 Okt 21  | 3983 | ||
|  | 2 Nov 18  | 10818 | 
