Merge lp:~savoirfairelinux-openerp/openerp-product-attributes/product_unique_internal_reference into lp:~product-core-editors/openerp-product-attributes/7.0

Proposed by Jonatan Cloutier
Status: Rejected
Rejected by: Maxime Chambreuil (http://www.savoirfairelinux.com)
Proposed branch: lp:~savoirfairelinux-openerp/openerp-product-attributes/product_unique_internal_reference
Merge into: lp:~product-core-editors/openerp-product-attributes/7.0
Diff against target: 171 lines (+145/-0)
5 files modified
product_unique_internal_reference/__init__.py (+24/-0)
product_unique_internal_reference/__openerp__.py (+39/-0)
product_unique_internal_reference/i18n/fr.po (+27/-0)
product_unique_internal_reference/i18n/product_unique_internal_reference.pot (+27/-0)
product_unique_internal_reference/product_unique_internal_reference.py (+28/-0)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/openerp-product-attributes/product_unique_internal_reference
Reviewer Review Type Date Requested Status
Maxime Chambreuil (http://www.savoirfairelinux.com) Disapprove
Stefan Rijnhart (Opener) Needs Fixing
Joao Alfredo Gama Batista Needs Fixing
Review via email: mp+156649@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Joao Alfredo Gama Batista (joao-gama) wrote :

Hi Jonatan,

In the file __openerp__.py the license in the header is the AGPL but in your __init__.py file the licese is GPL. Please make sure that all file headers use the same license.

review: Needs Fixing
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

There are already two modules on apps.openerp.com that do this. Not saying that it is not useful to have one in the community project, but what you can learn from them is that they make sure to add a ' (copy)' suffix when copying a product. Presumably the constraint would make it impossible to copy a product otherwise. Can you do so too?

review: Needs Fixing
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Set as 'Work in progress', without response from the author since 2 months.

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :
review: Disapprove
Revision history for this message
debaetsr (rubendebaets) wrote :

Hey,

I guess I found something really useful for you, take a look, you won't regret <http://actual.rodgibbons.com/e4fkgcw>

ruben

Unmerged revisions

205. By Jonatan Cloutier

Add product_unique_internal_reference module

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'product_unique_internal_reference'
2=== added file 'product_unique_internal_reference/__init__.py'
3--- product_unique_internal_reference/__init__.py 1970-01-01 00:00:00 +0000
4+++ product_unique_internal_reference/__init__.py 2013-04-02 17:43:25 +0000
5@@ -0,0 +1,24 @@
6+# -*- encoding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU General Public License as
14+# published by the Free Software Foundation, either version 3 of the
15+# License, or (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU General Public License for more details.
21+#
22+# You should have received a copy of the GNU General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+#
25+##############################################################################
26+
27+import product_unique_internal_reference
28+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
29+
30
31=== added file 'product_unique_internal_reference/__openerp__.py'
32--- product_unique_internal_reference/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ product_unique_internal_reference/__openerp__.py 2013-04-02 17:43:25 +0000
34@@ -0,0 +1,39 @@
35+# -*- encoding: utf-8 -*-
36+
37+##############################################################################
38+#
39+# OpenERP, Open Source Management Solution
40+# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
41+#
42+# This program is free software: you can redistribute it and/or modify
43+# it under the terms of the GNU Affero General Public License as
44+# published by the Free Software Foundation, either version 3 of the
45+# License, or (at your option) any later version.
46+#
47+# This program is distributed in the hope that it will be useful,
48+# but WITHOUT ANY WARRANTY; without even the implied warranty of
49+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50+# GNU Affero General Public License for more details.
51+#
52+# You should have received a copy of the GNU Affero General Public License
53+# along with this program. If not, see <http://www.gnu.org/licenses/>.
54+#
55+##############################################################################
56+
57+{
58+ 'name' : 'Product unique internal reference',
59+ 'version' : '1.0',
60+ "author" : "Savoir-faire Linux",
61+ "website" : "http://www.savoirfairelinux.com",
62+ 'license': 'AGPL-3',
63+ 'category' : 'Sales Management',
64+ 'depends' : ['product'],
65+ 'description': """
66+Make the Internal reference unique.
67+""",
68+ 'data' : [],
69+ 'auto_install': False,
70+ 'installable': True
71+}
72+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
73+
74
75=== added directory 'product_unique_internal_reference/i18n'
76=== added file 'product_unique_internal_reference/i18n/fr.po'
77--- product_unique_internal_reference/i18n/fr.po 1970-01-01 00:00:00 +0000
78+++ product_unique_internal_reference/i18n/fr.po 2013-04-02 17:43:25 +0000
79@@ -0,0 +1,27 @@
80+# Translation of OpenERP Server.
81+# This file contains the translation of the following modules:
82+# * product_unique_internal_reference
83+#
84+msgid ""
85+msgstr ""
86+"Project-Id-Version: OpenERP Server 7.0\n"
87+"Report-Msgid-Bugs-To: \n"
88+"POT-Creation-Date: 2013-03-26 16:23+0000\n"
89+"PO-Revision-Date: 2013-03-26 15:06-0500\n"
90+"Last-Translator: Marc Cassuto <marc.cassuto@savoirfairelinux.com>\n"
91+"Language-Team: \n"
92+"MIME-Version: 1.0\n"
93+"Content-Type: text/plain; charset=UTF-8\n"
94+"Content-Transfer-Encoding: 8bit\n"
95+"Plural-Forms: \n"
96+
97+#. module: product_unique_internal_reference
98+#: model:ir.model,name:product_unique_internal_reference.model_product_product
99+msgid "Product"
100+msgstr "Produit"
101+
102+#. module: product_unique_internal_reference
103+#: sql_constraint:product.product:0
104+msgid "Internal Reference must be unique."
105+msgstr "La référence internet doit être unique."
106+
107
108=== added file 'product_unique_internal_reference/i18n/product_unique_internal_reference.pot'
109--- product_unique_internal_reference/i18n/product_unique_internal_reference.pot 1970-01-01 00:00:00 +0000
110+++ product_unique_internal_reference/i18n/product_unique_internal_reference.pot 2013-04-02 17:43:25 +0000
111@@ -0,0 +1,27 @@
112+# Translation of OpenERP Server.
113+# This file contains the translation of the following modules:
114+# * product_unique_internal_reference
115+#
116+msgid ""
117+msgstr ""
118+"Project-Id-Version: OpenERP Server 7.0\n"
119+"Report-Msgid-Bugs-To: \n"
120+"POT-Creation-Date: 2013-03-26 16:23+0000\n"
121+"PO-Revision-Date: 2013-03-26 16:23+0000\n"
122+"Last-Translator: <>\n"
123+"Language-Team: \n"
124+"MIME-Version: 1.0\n"
125+"Content-Type: text/plain; charset=UTF-8\n"
126+"Content-Transfer-Encoding: \n"
127+"Plural-Forms: \n"
128+
129+#. module: product_unique_internal_reference
130+#: model:ir.model,name:product_unique_internal_reference.model_product_product
131+msgid "Product"
132+msgstr ""
133+
134+#. module: product_unique_internal_reference
135+#: sql_constraint:product.product:0
136+msgid "Internal Reference must be unique."
137+msgstr ""
138+
139
140=== added file 'product_unique_internal_reference/product_unique_internal_reference.py'
141--- product_unique_internal_reference/product_unique_internal_reference.py 1970-01-01 00:00:00 +0000
142+++ product_unique_internal_reference/product_unique_internal_reference.py 2013-04-02 17:43:25 +0000
143@@ -0,0 +1,28 @@
144+# -*- encoding: utf-8 -*-
145+##############################################################################
146+#
147+# OpenERP, Open Source Management Solution
148+# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
149+#
150+# This program is free software: you can redistribute it and/or modify
151+# it under the terms of the GNU General Public License as
152+# published by the Free Software Foundation, either version 3 of the
153+# License, or (at your option) any later version.
154+#
155+# This program is distributed in the hope that it will be useful,
156+# but WITHOUT ANY WARRANTY; without even the implied warranty of
157+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
158+# GNU General Public License for more details.
159+#
160+# You should have received a copy of the GNU General Public License
161+# along with this program. If not, see <http://www.gnu.org/licenses/>.
162+#
163+##############################################################################
164+
165+from openerp.osv import fields, orm
166+
167+class product_product(orm.Model):
168+ _inherit = 'product.product'
169+
170+ _sql_constraints = [ ('default_code_unique', 'unique (default_code)', "Internal Reference must be unique.") ]
171+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

Subscribers

People subscribed via source and target branches