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

copy field data one to another using boolean

By
nahian
on 3/2/16, 2:33 AM 379 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

--Axel Mendoza--
10205
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

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

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: 3/2/16, 2:33 AM
Seen: 379 times
Last updated: 3/2/16, 8:14 AM