Odoo Help

4

1
2 Answers
1
Avatar

Francesco OpenCode Italy

--Francesco OpenCode--

3949
| 7 8 11
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo Developer. Python lover. Beer addicted.

LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode Italy
4/12/13, 8:22 AM

Your code must be:

class product_product(osv.osv):
    _inherit = "product.product"
    _name = "product.product"
    _sql_constraints = [
        ('default_code', 'unique(default_code)', 'Product Reference must be unique!'),
    ]
product_product()

The right field for Internal Reference is default_code

1
Avatar

Sudhir Arya (ERP Harbor Consulting Services) India

--Sudhir Arya (ERP Harbor Consulting Services)--
26842
| 8 9 10
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 

LinkedIn

Blog

Stackoverflow

ERP Harbor Consulting Services

Skype:sudhir@erpharbor.com
Website: http://www.erpharbor.com
Sudhir Arya (ERP Harbor Consulting Services) India
4/11/13, 3:58 PM

You can use _sql_constraints:

Try this:

_sql_constraints = [
    ('default_code_uniq', 'unique(default_code)', 'Product Reference must be unique!'),
]
Ask a Question
Writer
Keep Informed
0 follower(s)
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