Odoo Help

0

copy field data one to another using boolean

By
nahian
on 3/2/16, 2:33 AM 765 views

when user will give data in 'input_value' field and check the radio button which is named as  'copy' then  values of 'input_value' field will show in 'input_value_copy' field, but i didn't getting result.can anyone solve this problem please.

this way i've tried...

 In py file

class copyFieldsvalue(models.Model):

_name='copy.fieldsvalue'

_columns={

'input_value':fields.char('Input'),

'input_value_copy':fields.char('Copy of Input'),

'copy':fields.boolean('Copy'),

}

def onchange_copy(self,cr, uid, ids,copy,input_value,context=None):

if copy:

return {'value':{'input_value_copy':input_value,}}

return {'value':{}}

In XML file

<field name="input_value"/>

<field name="input_value_copy"/>

<field name="copy" on_change="onchange_copy(copy,input_value_copy)"/>

1
Axel Mendoza
On 3/2/16, 3:00 AM

You just need to change this line and it will work:

<field name="copy" on_change="onchange_copy(copy,input_value)"/>

It works! thank you so much Axel

nahian
on 3/2/16, 3:38 AM

Good to know, could you upvote it too?

Axel Mendoza
on 3/2/16, 3:47 AM

sure! why not.

nahian
on 3/2/16, 3:59 AM

Hi Axel, can you please check this Question in the link below. in odoo /forum/help-1/question/show-existing-products-of-a-customer-in-a-tab-98601

nahian
on 3/3/16, 8:50 AM

I check it but I don't understand what you need, post some code of what you are doing

Axel Mendoza
on 3/7/16, 4:24 AM

About This Community

This platform 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.

Register

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)

Stats

Asked: 3/2/16, 2:33 AM
Seen: 765 times
Last updated: 3/2/16, 8:14 AM