Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

button edit is not working

By
oussama
on 10/20/14, 3:42 AM 279 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)

0

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 10/20/14, 5:32 AM

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.

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

oussama
on 10/20/14, 6:03 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/20/14, 3:42 AM
Seen: 279 times
Last updated: 3/16/15, 8:10 AM