Odoo Help


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.


form not saving edited data

Billiard R Made
on 1/15/16, 11:06 AM 400 views

I have a form with:

    <field name="qty" on_change="onchange_transaction(tr_id, qty)"/>

relevant code:


    def onchange_transaction(self, cr, uid, ids, tr_id, qty, context=None):

    # some code here which is calculating my receipt

    res = { 'value': {'amount':locamount , 'subtotal':locsubtotal , 'vat': locvat , 'total':loctotal} }

    return res

fields declarations :

'amount':fields.float('Amount', store=True, readonly=True),


'subtotal':fields.float('Sub Total', store=True, readonly=True ),

'vat':fields.float('VAT', store=True, readonly=True),

'total':fields.float('Total', store=True, readonly=True),

On editing my form and logic is behaving fine up to the point of saving. If I alter the quantity my form is picking the newly calculated amount BUT when I save figures revert to old amount. This problem only happens on editing a record. It does not happen on a new record.

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)


Asked: 1/15/16, 11:06 AM
Seen: 400 times
Last updated: 1/15/16, 12:24 PM