Odoo Help

ayman mohammed adam
On 9/7/16, 3:09 AM

dear Prihadi Ramadhany,

i think you must replace this code :


def  set_buff_qty(self):

    self.buff_qty = self.qty 




def  set_buff_qty(self):

    self.buff_qty = self.qty 

I hope I helped you...

Hi Ayman,

Please forgive me the type...the original code its @api.onchange('qty') , I solved the problem....please see my own reply

Thank you for you reply and attention :D

Prihadi Ramadhany
on 9/8/16, 1:07 AM
Prihadi Ramadhany
On 9/8/16, 1:10 AM


its works now....the code modified as follow:

    def on_change_qty(self, cr, uid, ids, qty, buff_qty, context=None):

        return {'value': {'buff_qty': qty}}

and on view

     <field name="arch" type="xml">

             <field name="qty" on_change="on_change_qty(qty,buff_qty)" />

and its works ..... :D  still wonder why I need to sent both parameter and cant use self.buff_qty to refer to buff_qty on the view.

About This Community

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

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/6/16, 2:09 PM
Seen: 935 times
Last updated: 10/17/16, 9:35 AM