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

Generate Product Name based on some Selection

By
GuruDev
on 8/11/13, 6:42 AM 867 views

Dear All,
I am having a requirement,
In my Multi-company environment, one of the child company(say X)---
Its Product(Name) should be, created based on the values at some fields.

For this, I created a new module, and inherited the product.product model.
In the view file, I added a new page on note book "Product Configuration". This page will be available only for "That Particular users-from my "company X". (it is controlled by a checkbox).

My new Product Configuration page, contains some new fields--whose selection determines the Name of Product. may be like... Product Name== field1+field2+field. These field1,field2,field are of types, selection,boolean,char,float,..etc.

How to achieve this ? Please help.

0
nazarii
On 8/11/13, 8:15 AM

All you need to do is to modify name_get method of product.product. There you can define product name that will be represented accordingly to your fields.

Dear Nazarri,

name_get() method is used for what?

What I want, is..at the time of Product creation.. the Product name should be taken from field1+field2+.. like that..

GuruDev
on 8/11/13, 8:50 AM

Name_get is used to represent object name in many2one relationships e.g. in sale order line. In you're issue there are few solutions you can use: you can modify product create() method (if vals.get(field1): vals[name] += vals[field1]); you can put onchange events on you field1, field2 etc. to update product name.

nazarii
on 8/11/13, 9:18 AM

Dear Nazarri, Can you please elaborate it?

GuruDev
on 8/11/13, 10:48 AM

Yes, i can elaborate it, however I gave you a hint - the rest depends on you, if you don't want to read documentation you can at any moment pay freelancer to make this functionality working.

nazarii
on 8/11/13, 11:15 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

0 follower(s)

Stats

Asked: 8/11/13, 6:42 AM
Seen: 867 times
Last updated: 3/16/15, 8:10 AM