This question has been flagged
1 Reply
2130 Views

Button edit is not working .

my code :

def write(self, cr, uid,ids, vals, context=None):  
        vals={}
        
        for record in self.browse(cr, uid, ids,context):
            vals['p_achat_ht'] = record.t_c*record.prix_d*(1+record.fret_p)
            vals['p_achat_ttc'] = record.t_c*record.prix_d*(1+record.tva_p/100)*(1+record.fret_p/100)
            
            vals['p_achat_ht_pgd'] = record.p_vente_ht
            vals['p_vente_ttc'] = record.p_vente_ht*(1+record.tva_p/100)
            vals['p_achat_ttcd'] = record.p_vente_ht*(1+record.tva_p/100)
            
            vals['p_vente_ttcd'] = record.p_vente_htd*(1+record.tva_p/100)
                        
        return super(product_product, self).write(cr, uid,ids,vals,context=context)

Avatar
Discard
Best Answer

How are we supposed to help you with this? There is no error code, no stack trace, no reason. Just a bit of code and "not working".

Explain at least a little bit more and/or post a stack trace. Also, mention what you expected it to do.

Avatar
Discard
Author

Hi Ludo ,my problem is to store field readonly in database with method onchange ,so i use method write ,the field is stored but when i use the button edit to modify my record the button is not working. thanks