Merge lp:~openerp-dev/openobject-addons/trunk-bug-1133536-dharmraj into lp:openobject-addons

Proposed by Nimesh Contractor(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1133536-dharmraj
Merge into: lp:openobject-addons
Diff against target: 14 lines (+3/-1)
1 file modified
product/product.py (+3/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1133536-dharmraj
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+165830@code.launchpad.net

Description of the change

Hello,

Set sql constraint for unique product category.

Thank You.

To post a comment you must log in.

Unmerged revisions

8648. By Dharmraj Zala(OpenERP)

[IMP] Improved Constraint Message

8647. By Dharmraj Zala(OpenERP)

[FIX] added sql constraint for the category name

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product/product.py'
2--- product/product.py 2013-04-17 09:29:14 +0000
3+++ product/product.py 2013-05-27 07:29:09 +0000
4@@ -258,7 +258,9 @@
5 _defaults = {
6 'type' : lambda *a : 'normal',
7 }
8-
9+
10+ _sql_constraints = [('_unique_category_name','unique(name)','Category for the product must be unique.')]
11+
12 _parent_name = "parent_id"
13 _parent_store = True
14 _parent_order = 'sequence, name'

Subscribers

People subscribed via source and target branches

to all changes: