Merge lp:~agilebg/openerp-product-attributes/7.0-product-customer-code-extraction-improvements into lp:~product-core-editors/openerp-product-attributes/7.0

Proposed by Nicola Malcontenti - Agile BG
Status: Superseded
Proposed branch: lp:~agilebg/openerp-product-attributes/7.0-product-customer-code-extraction-improvements
Merge into: lp:~product-core-editors/openerp-product-attributes/7.0
Diff against target: 824 lines (+759/-0)
12 files modified
product_customer_code/__init__.py (+2/-0)
product_customer_code/__openerp__.py (+47/-0)
product_customer_code/i18n/es.po (+122/-0)
product_customer_code/i18n/es_MX.po (+115/-0)
product_customer_code/i18n/es_VE.po (+115/-0)
product_customer_code/i18n/product_customer_code.pot (+112/-0)
product_customer_code/product.py (+73/-0)
product_customer_code/product_customer_code.py (+67/-0)
product_customer_code/product_customer_code_view.xml (+60/-0)
product_customer_code/product_product_view.xml (+31/-0)
product_customer_code/security/ir.model.access.csv (+3/-0)
product_customer_code/security/product_customer_code_security.xml (+12/-0)
To merge this branch: bzr merge lp:~agilebg/openerp-product-attributes/7.0-product-customer-code-extraction-improvements
Reviewer Review Type Date Requested Status
Lorenzo Battistini (community) Needs Resubmitting
Product Core Editors Pending
Review via email: mp+202545@code.launchpad.net

This proposal has been superseded by a proposal from 2014-01-23.

Description of the change

Replaced every reference to 'osv' with 'orm'

To post a comment you must log in.
Revision history for this message
Lorenzo Battistini (elbati) wrote :
review: Needs Resubmitting

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'product_customer_code'
2=== added file 'product_customer_code/__init__.py'
3--- product_customer_code/__init__.py 1970-01-01 00:00:00 +0000
4+++ product_customer_code/__init__.py 2014-01-21 20:25:53 +0000
5@@ -0,0 +1,2 @@
6+import product_customer_code
7+import product
8
9=== added file 'product_customer_code/__openerp__.py'
10--- product_customer_code/__openerp__.py 1970-01-01 00:00:00 +0000
11+++ product_customer_code/__openerp__.py 2014-01-21 20:25:53 +0000
12@@ -0,0 +1,47 @@
13+# -*- encoding: utf-8 -*-
14+###########################################################################
15+# Module Writen to OpenERP, Open Source Management Solution
16+#
17+# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com/
18+# All Rights Reserved.
19+# info Vauxoo (info@vauxoo.com)
20+############################################################################
21+# Coded by: el_rodo_1 (rodo@vauxoo.com)
22+############################################################################
23+#
24+# This program is free software: you can redistribute it and/or modify
25+# it under the terms of the GNU Affero General Public License as
26+# published by the Free Software Foundation, either version 3 of the
27+# License, or (at your option) any later version.
28+#
29+# This program is distributed in the hope that it will be useful,
30+# but WITHOUT ANY WARRANTY; without even the implied warranty of
31+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32+# GNU Affero General Public License for more details.
33+#
34+# You should have received a copy of the GNU Affero General Public License
35+# along with this program. If not, see <http://www.gnu.org/licenses/>.
36+#
37+##############################################################################
38+{
39+ "name" : "Products Customer Code",
40+ "version" : "1.0",
41+ "author" : "Vauxoo",
42+ "website" : "http://www.vauxoo.com/",
43+ "license" : "AGPL-3",
44+ "category" : "Generic Modules/Product",
45+ "depends" : ["base", "product"],
46+ "init_xml" : [],
47+ "demo_xml" : [],
48+ "description": """
49+Add manies Codes of Customer's in product
50+ """,
51+ "update_xml" : ["security/product_customer_code_security.xml",
52+ "security/ir.model.access.csv",
53+ "product_customer_code_view.xml",
54+ "product_product_view.xml",
55+
56+ ],
57+ "active": False,
58+ "installable": True,
59+}
60
61=== added directory 'product_customer_code/i18n'
62=== added file 'product_customer_code/i18n/es.po'
63--- product_customer_code/i18n/es.po 1970-01-01 00:00:00 +0000
64+++ product_customer_code/i18n/es.po 2014-01-21 20:25:53 +0000
65@@ -0,0 +1,122 @@
66+# Translation of OpenERP Server.
67+# This file contains the translation of the following modules:
68+# * product_customer_code
69+#
70+msgid ""
71+msgstr ""
72+"Project-Id-Version: OpenERP Server 6.1\n"
73+"Report-Msgid-Bugs-To: \n"
74+"POT-Creation-Date: 2013-11-07 01:08+0000\n"
75+"PO-Revision-Date: 2013-11-08 17:49+0000\n"
76+"Last-Translator: hbto [Vauxoo] http://www.vauxoo.com "
77+"<humbertoarocha@gmail.com>\n"
78+"Language-Team: \n"
79+"MIME-Version: 1.0\n"
80+"Content-Type: text/plain; charset=UTF-8\n"
81+"Content-Transfer-Encoding: 8bit\n"
82+"X-Launchpad-Export-Date: 2013-12-06 06:26+0000\n"
83+"X-Generator: Launchpad (build 16863)\n"
84+
85+#. module: product_customer_code
86+#: field:product.customer.code,partner_id:0
87+msgid "Customer"
88+msgstr "Cliente"
89+
90+#. module: product_customer_code
91+#: view:product.product:0
92+msgid "Information"
93+msgstr "Información"
94+
95+#. module: product_customer_code
96+#: view:product.product:0
97+msgid "Customer Code"
98+msgstr "Código del Cliente"
99+
100+#. module: product_customer_code
101+#: sql_constraint:product.customer.code:0
102+msgid "Product Code of customer must be unique"
103+msgstr "El Codigo del Producto del Cliente Debe ser Unico"
104+
105+#. module: product_customer_code
106+#: model:res.groups,name:product_customer_code.group_product_customer_code_manager
107+msgid "Product_Customer / Manager"
108+msgstr "Product_Customer / Manager"
109+
110+#. module: product_customer_code
111+#: field:product.customer.code,product_code:0
112+msgid "Customer Product Code"
113+msgstr "Código del Producto por Cliente"
114+
115+#. module: product_customer_code
116+#: view:product.customer.code:0
117+#: field:product.customer.code,company_id:0
118+msgid "Company"
119+msgstr "Compañia"
120+
121+#. module: product_customer_code
122+#: model:ir.actions.act_window,name:product_customer_code.action_product_customer_code_tree
123+#: model:ir.ui.menu,name:product_customer_code.menu_product_customer_code
124+#: view:product.customer.code:0
125+#: view:product.product:0
126+msgid "Product Customer Code"
127+msgstr "Código del Producto por Cliente"
128+
129+#. module: product_customer_code
130+#: model:ir.model,name:product_customer_code.model_product_product
131+#: view:product.customer.code:0
132+#: field:product.customer.code,product_id:0
133+msgid "Product"
134+msgstr "Producto"
135+
136+#. module: product_customer_code
137+#: help:product.customer.code,product_code:0
138+msgid ""
139+"This customer's product code\n"
140+" will be used when searching "
141+"into\n"
142+" a request for quotation."
143+msgstr ""
144+"El código de Producto del cliente\n"
145+" se usará cuando se busque en\n"
146+" una solicitud de cotización."
147+
148+#. module: product_customer_code
149+#: field:product.product,product_customer_code_ids:0
150+msgid "Customer Codes"
151+msgstr "Código del Cliente"
152+
153+#. module: product_customer_code
154+#: view:product.customer.code:0
155+msgid "Group By..."
156+msgstr "Agrupar por ..."
157+
158+#. module: product_customer_code
159+#: model:res.groups,name:product_customer_code.group_product_customer_code_user
160+msgid "Product_Customer / User"
161+msgstr "Product_Customer / User"
162+
163+#. module: product_customer_code
164+#: field:product.customer.code,product_name:0
165+msgid "Customer Product Name"
166+msgstr "Nombre del producto"
167+
168+#. module: product_customer_code
169+#: view:product.customer.code:0
170+msgid "Partner"
171+msgstr "Partner"
172+
173+#. module: product_customer_code
174+#: model:ir.model,name:product_customer_code.model_product_customer_code
175+msgid "Add manies Code of Customer's"
176+msgstr "Agregar varios códigos de clientes"
177+
178+#. module: product_customer_code
179+#: help:product.customer.code,product_name:0
180+msgid ""
181+"This customer's product name will\n"
182+" be used when searching into a\n"
183+" request for quotation."
184+msgstr ""
185+"Este nombre de Producto del cliente\n"
186+" se usará cuando se busque en\n"
187+" una solicitud de cotización."
188
189=== added file 'product_customer_code/i18n/es_MX.po'
190--- product_customer_code/i18n/es_MX.po 1970-01-01 00:00:00 +0000
191+++ product_customer_code/i18n/es_MX.po 2014-01-21 20:25:53 +0000
192@@ -0,0 +1,115 @@
193+# Translation of OpenERP Server.
194+# This file contains the translation of the following modules:
195+# * product_customer_code
196+#
197+msgid ""
198+msgstr ""
199+"Project-Id-Version: OpenERP Server 6.1\n"
200+"Report-Msgid-Bugs-To: \n"
201+"POT-Creation-Date: 2013-11-07 01:08+0000\n"
202+"PO-Revision-Date: 2013-11-07 05:14+0000\n"
203+"Last-Translator: julio <julio@vauxoo.com>\n"
204+"Language-Team: \n"
205+"MIME-Version: 1.0\n"
206+"Content-Type: text/plain; charset=UTF-8\n"
207+"Content-Transfer-Encoding: 8bit\n"
208+"X-Launchpad-Export-Date: 2013-12-06 06:26+0000\n"
209+"X-Generator: Launchpad (build 16863)\n"
210+
211+#. module: product_customer_code
212+#: field:product.customer.code,partner_id:0
213+msgid "Customer"
214+msgstr ""
215+
216+#. module: product_customer_code
217+#: view:product.product:0
218+msgid "Information"
219+msgstr ""
220+
221+#. module: product_customer_code
222+#: view:product.product:0
223+msgid "Customer Code"
224+msgstr ""
225+
226+#. module: product_customer_code
227+#: sql_constraint:product.customer.code:0
228+msgid "Product Code of customer must be unique"
229+msgstr ""
230+
231+#. module: product_customer_code
232+#: model:res.groups,name:product_customer_code.group_product_customer_code_manager
233+msgid "Product_Customer / Manager"
234+msgstr ""
235+
236+#. module: product_customer_code
237+#: field:product.customer.code,product_code:0
238+msgid "Customer Product Code"
239+msgstr ""
240+
241+#. module: product_customer_code
242+#: view:product.customer.code:0
243+#: field:product.customer.code,company_id:0
244+msgid "Company"
245+msgstr ""
246+
247+#. module: product_customer_code
248+#: model:ir.actions.act_window,name:product_customer_code.action_product_customer_code_tree
249+#: model:ir.ui.menu,name:product_customer_code.menu_product_customer_code
250+#: view:product.customer.code:0
251+#: view:product.product:0
252+msgid "Product Customer Code"
253+msgstr ""
254+
255+#. module: product_customer_code
256+#: model:ir.model,name:product_customer_code.model_product_product
257+#: view:product.customer.code:0
258+#: field:product.customer.code,product_id:0
259+msgid "Product"
260+msgstr ""
261+
262+#. module: product_customer_code
263+#: help:product.customer.code,product_code:0
264+msgid ""
265+"This customer's product code\n"
266+" will be used when searching "
267+"into\n"
268+" a request for quotation."
269+msgstr ""
270+
271+#. module: product_customer_code
272+#: field:product.product,product_customer_code_ids:0
273+msgid "Customer Codes"
274+msgstr ""
275+
276+#. module: product_customer_code
277+#: view:product.customer.code:0
278+msgid "Group By..."
279+msgstr ""
280+
281+#. module: product_customer_code
282+#: model:res.groups,name:product_customer_code.group_product_customer_code_user
283+msgid "Product_Customer / User"
284+msgstr ""
285+
286+#. module: product_customer_code
287+#: field:product.customer.code,product_name:0
288+msgid "Customer Product Name"
289+msgstr ""
290+
291+#. module: product_customer_code
292+#: view:product.customer.code:0
293+msgid "Partner"
294+msgstr ""
295+
296+#. module: product_customer_code
297+#: model:ir.model,name:product_customer_code.model_product_customer_code
298+msgid "Add manies Code of Customer's"
299+msgstr ""
300+
301+#. module: product_customer_code
302+#: help:product.customer.code,product_name:0
303+msgid ""
304+"This customer's product name will\n"
305+" be used when searching into a\n"
306+" request for quotation."
307+msgstr ""
308
309=== added file 'product_customer_code/i18n/es_VE.po'
310--- product_customer_code/i18n/es_VE.po 1970-01-01 00:00:00 +0000
311+++ product_customer_code/i18n/es_VE.po 2014-01-21 20:25:53 +0000
312@@ -0,0 +1,115 @@
313+# Translation of OpenERP Server.
314+# This file contains the translation of the following modules:
315+# * product_customer_code
316+#
317+msgid ""
318+msgstr ""
319+"Project-Id-Version: OpenERP Server 6.1\n"
320+"Report-Msgid-Bugs-To: \n"
321+"POT-Creation-Date: 2013-11-07 01:08+0000\n"
322+"PO-Revision-Date: 2013-11-07 05:08+0000\n"
323+"Last-Translator: julio <julio@vauxoo.com>\n"
324+"Language-Team: \n"
325+"MIME-Version: 1.0\n"
326+"Content-Type: text/plain; charset=UTF-8\n"
327+"Content-Transfer-Encoding: 8bit\n"
328+"X-Launchpad-Export-Date: 2013-12-06 06:26+0000\n"
329+"X-Generator: Launchpad (build 16863)\n"
330+
331+#. module: product_customer_code
332+#: field:product.customer.code,partner_id:0
333+msgid "Customer"
334+msgstr ""
335+
336+#. module: product_customer_code
337+#: view:product.product:0
338+msgid "Information"
339+msgstr ""
340+
341+#. module: product_customer_code
342+#: view:product.product:0
343+msgid "Customer Code"
344+msgstr ""
345+
346+#. module: product_customer_code
347+#: sql_constraint:product.customer.code:0
348+msgid "Product Code of customer must be unique"
349+msgstr ""
350+
351+#. module: product_customer_code
352+#: model:res.groups,name:product_customer_code.group_product_customer_code_manager
353+msgid "Product_Customer / Manager"
354+msgstr ""
355+
356+#. module: product_customer_code
357+#: field:product.customer.code,product_code:0
358+msgid "Customer Product Code"
359+msgstr ""
360+
361+#. module: product_customer_code
362+#: view:product.customer.code:0
363+#: field:product.customer.code,company_id:0
364+msgid "Company"
365+msgstr ""
366+
367+#. module: product_customer_code
368+#: model:ir.actions.act_window,name:product_customer_code.action_product_customer_code_tree
369+#: model:ir.ui.menu,name:product_customer_code.menu_product_customer_code
370+#: view:product.customer.code:0
371+#: view:product.product:0
372+msgid "Product Customer Code"
373+msgstr ""
374+
375+#. module: product_customer_code
376+#: model:ir.model,name:product_customer_code.model_product_product
377+#: view:product.customer.code:0
378+#: field:product.customer.code,product_id:0
379+msgid "Product"
380+msgstr ""
381+
382+#. module: product_customer_code
383+#: help:product.customer.code,product_code:0
384+msgid ""
385+"This customer's product code\n"
386+" will be used when searching "
387+"into\n"
388+" a request for quotation."
389+msgstr ""
390+
391+#. module: product_customer_code
392+#: field:product.product,product_customer_code_ids:0
393+msgid "Customer Codes"
394+msgstr ""
395+
396+#. module: product_customer_code
397+#: view:product.customer.code:0
398+msgid "Group By..."
399+msgstr ""
400+
401+#. module: product_customer_code
402+#: model:res.groups,name:product_customer_code.group_product_customer_code_user
403+msgid "Product_Customer / User"
404+msgstr ""
405+
406+#. module: product_customer_code
407+#: field:product.customer.code,product_name:0
408+msgid "Customer Product Name"
409+msgstr ""
410+
411+#. module: product_customer_code
412+#: view:product.customer.code:0
413+msgid "Partner"
414+msgstr ""
415+
416+#. module: product_customer_code
417+#: model:ir.model,name:product_customer_code.model_product_customer_code
418+msgid "Add manies Code of Customer's"
419+msgstr ""
420+
421+#. module: product_customer_code
422+#: help:product.customer.code,product_name:0
423+msgid ""
424+"This customer's product name will\n"
425+" be used when searching into a\n"
426+" request for quotation."
427+msgstr ""
428
429=== added file 'product_customer_code/i18n/product_customer_code.pot'
430--- product_customer_code/i18n/product_customer_code.pot 1970-01-01 00:00:00 +0000
431+++ product_customer_code/i18n/product_customer_code.pot 2014-01-21 20:25:53 +0000
432@@ -0,0 +1,112 @@
433+# Translation of OpenERP Server.
434+# This file contains the translation of the following modules:
435+# * product_customer_code
436+#
437+msgid ""
438+msgstr ""
439+"Project-Id-Version: OpenERP Server 7.0\n"
440+"Report-Msgid-Bugs-To: \n"
441+"POT-Creation-Date: 2013-11-07 01:08+0000\n"
442+"PO-Revision-Date: 2013-11-07 01:08+0000\n"
443+"Last-Translator: <>\n"
444+"Language-Team: \n"
445+"MIME-Version: 1.0\n"
446+"Content-Type: text/plain; charset=UTF-8\n"
447+"Content-Transfer-Encoding: \n"
448+"Plural-Forms: \n"
449+
450+#. module: product_customer_code
451+#: field:product.customer.code,partner_id:0
452+msgid "Customer"
453+msgstr ""
454+
455+#. module: product_customer_code
456+#: view:product.product:0
457+msgid "Information"
458+msgstr ""
459+
460+#. module: product_customer_code
461+#: view:product.product:0
462+msgid "Customer Code"
463+msgstr ""
464+
465+#. module: product_customer_code
466+#: sql_constraint:product.customer.code:0
467+msgid "Product Code of customer must be unique"
468+msgstr ""
469+
470+#. module: product_customer_code
471+#: model:res.groups,name:product_customer_code.group_product_customer_code_manager
472+msgid "Product_Customer / Manager"
473+msgstr ""
474+
475+#. module: product_customer_code
476+#: field:product.customer.code,product_code:0
477+msgid "Customer Product Code"
478+msgstr ""
479+
480+#. module: product_customer_code
481+#: view:product.customer.code:0
482+#: field:product.customer.code,company_id:0
483+msgid "Company"
484+msgstr ""
485+
486+#. module: product_customer_code
487+#: model:ir.actions.act_window,name:product_customer_code.action_product_customer_code_tree
488+#: model:ir.ui.menu,name:product_customer_code.menu_product_customer_code
489+#: view:product.customer.code:0
490+#: view:product.product:0
491+msgid "Product Customer Code"
492+msgstr ""
493+
494+#. module: product_customer_code
495+#: model:ir.model,name:product_customer_code.model_product_product
496+#: view:product.customer.code:0
497+#: field:product.customer.code,product_id:0
498+msgid "Product"
499+msgstr ""
500+
501+#. module: product_customer_code
502+#: help:product.customer.code,product_code:0
503+msgid "This customer's product code\n"
504+" will be used when searching into\n"
505+" a request for quotation."
506+msgstr ""
507+
508+#. module: product_customer_code
509+#: field:product.product,product_customer_code_ids:0
510+msgid "Customer Codes"
511+msgstr ""
512+
513+#. module: product_customer_code
514+#: view:product.customer.code:0
515+msgid "Group By..."
516+msgstr ""
517+
518+#. module: product_customer_code
519+#: model:res.groups,name:product_customer_code.group_product_customer_code_user
520+msgid "Product_Customer / User"
521+msgstr ""
522+
523+#. module: product_customer_code
524+#: field:product.customer.code,product_name:0
525+msgid "Customer Product Name"
526+msgstr ""
527+
528+#. module: product_customer_code
529+#: view:product.customer.code:0
530+msgid "Partner"
531+msgstr ""
532+
533+#. module: product_customer_code
534+#: model:ir.model,name:product_customer_code.model_product_customer_code
535+msgid "Add manies Code of Customer's"
536+msgstr ""
537+
538+#. module: product_customer_code
539+#: help:product.customer.code,product_name:0
540+msgid "This customer's product name will\n"
541+" be used when searching into a\n"
542+" request for quotation."
543+msgstr ""
544+
545
546=== added file 'product_customer_code/product.py'
547--- product_customer_code/product.py 1970-01-01 00:00:00 +0000
548+++ product_customer_code/product.py 2014-01-21 20:25:53 +0000
549@@ -0,0 +1,73 @@
550+# -*- coding: utf-8 -*-
551+###########################################################################
552+# Module Writen to OpenERP, Open Source Management Solution
553+#
554+# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
555+# All Rights Reserved.
556+# info@vauxoo.com
557+############################################################################
558+# Coded by: Rodo (rodo@vauxoo.com),Moy (moylop260@vauxoo.com)
559+############################################################################
560+#
561+# This program is free software: you can redistribute it and/or modify
562+# it under the terms of the GNU Affero General Public License as
563+# published by the Free Software Foundation, either version 3 of the
564+# License, or (at your option) any later version.
565+#
566+# This program is distributed in the hope that it will be useful,
567+# but WITHOUT ANY WARRANTY; without even the implied warranty of
568+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
569+# GNU Affero General Public License for more details.
570+#
571+# You should have received a copy of the GNU Affero General Public License
572+# along with this program. If not, see <http://www.gnu.org/licenses/>.
573+#
574+##############################################################################
575+from openerp.osv import orm, fields
576+from openerp.tools.translate import _
577+
578+
579+class product_product(orm.Model):
580+ _inherit = "product.product"
581+
582+ _columns = {
583+ 'product_customer_code_ids': fields.one2many('product.customer.code',
584+ 'product_id',
585+ 'Customer Codes'),
586+ }
587+
588+ def copy(self, cr, uid, id, default=None, context=None):
589+ if not default:
590+ default = {}
591+ default['product_customer_code_ids'] = False
592+ res = super(product_product, self).copy(
593+ cr, uid, id, default=default, context=context)
594+ return res
595+
596+ def name_search(self, cr, user, name='', args=None, operator='ilike',
597+ context=None, limit=80):
598+ res = super(product_product, self).name_search(
599+ cr, user, name, args, operator, context, limit)
600+ if not context:
601+ context = {}
602+ product_customer_code_obj = self.pool.get('product.customer.code')
603+ if not res:
604+ ids = []
605+ partner_id = context.get('partner_id', False)
606+ if partner_id:
607+ id_prod_code = \
608+ product_customer_code_obj.search(cr, user,
609+ [('product_code',
610+ '=', name),
611+ ('partner_id', '=',
612+ partner_id)],
613+ limit=limit,
614+ context=context)
615+ # TODO: Search for product customer name
616+ id_prod = id_prod_code and product_customer_code_obj.browse(
617+ cr, user, id_prod_code, context=context) or []
618+ for ppu in id_prod:
619+ ids.append(ppu.product_id.id)
620+ if ids:
621+ res = self.name_get(cr, user, ids, context)
622+ return res
623
624=== added file 'product_customer_code/product_customer_code.py'
625--- product_customer_code/product_customer_code.py 1970-01-01 00:00:00 +0000
626+++ product_customer_code/product_customer_code.py 2014-01-21 20:25:53 +0000
627@@ -0,0 +1,67 @@
628+# -*- coding: utf-8 -*-
629+###########################################################################
630+# Module Writen to OpenERP, Open Source Management Solution
631+#
632+# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
633+# All Rights Reserved.
634+# info@vauxoo.com
635+############################################################################
636+# Coded by: Rodo (rodo@vauxoo.com),Moy (moylop260@vauxoo.com)
637+############################################################################
638+#
639+# This program is free software: you can redistribute it and/or modify
640+# it under the terms of the GNU Affero General Public License as
641+# published by the Free Software Foundation, either version 3 of the
642+# License, or (at your option) any later version.
643+#
644+# This program is distributed in the hope that it will be useful,
645+# but WITHOUT ANY WARRANTY; without even the implied warranty of
646+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
647+# GNU Affero General Public License for more details.
648+#
649+# You should have received a copy of the GNU Affero General Public License
650+# along with this program. If not, see <http://www.gnu.org/licenses/>.
651+#
652+##############################################################################
653+from openerp.osv import orm, fields
654+from openerp.tools.translate import _
655+
656+
657+class product_customer_code(orm.Model):
658+ _name = "product.customer.code"
659+ _description = "Add manies Code of Customer's"
660+
661+ _rec_name = 'product_code'
662+
663+ _columns = {
664+ 'product_code': fields.char('Customer Product Code', size=64,
665+ required=True,
666+ help="""This customer's product code
667+ will be used when searching into
668+ a request for quotation."""),
669+ 'product_name': fields.char('Customer Product Name', size=128,
670+ help="""This customer's product name will
671+ be used when searching into a
672+ request for quotation."""),
673+ 'product_id': fields.many2one('product.product', 'Product',
674+ required=True),
675+ 'partner_id': fields.many2one('res.partner', 'Customer',
676+ required=True),
677+ 'company_id': fields.many2one('res.company', 'Company',
678+ required=False),
679+ }
680+
681+ _defaults = {
682+ 'company_id': lambda s, cr,
683+ uid, c: s.pool.get('res.company').\
684+ _company_default_get(cr, uid,
685+ 'product.customer.code',
686+ context=c),
687+ }
688+
689+ _sql_constraints = [
690+ ('unique_code', 'unique(product_code,company_id,partner_id)',
691+ 'Product Code of customer must be unique'),
692+ ]
693+
694+ # TODO: Add index to product_code, partner_id
695
696=== added file 'product_customer_code/product_customer_code_view.xml'
697--- product_customer_code/product_customer_code_view.xml 1970-01-01 00:00:00 +0000
698+++ product_customer_code/product_customer_code_view.xml 2014-01-21 20:25:53 +0000
699@@ -0,0 +1,60 @@
700+<?xml version='1.0' encoding='UTF-8'?>
701+<openerp>
702+ <data>
703+
704+ <record model="ir.ui.view" id="view_product_customer_code_form">
705+ <field name="name">view.product.customer.code.form</field>
706+ <field name="model">product.customer.code</field>
707+ <field name="arch" type="xml">
708+ <form string="Product Customer Code" version="7.0">
709+ <field name="product_code"/>
710+ <field name="partner_id"/>
711+ <field name="product_id"/>
712+ <field name="company_id" widget="selection" groups="base.group_multi_company"/>
713+ </form>
714+ </field>
715+ </record>
716+ <record model="ir.ui.view" id="view_product_customer_code_tree">
717+ <field name="name">view.product.customer.code.tree</field>
718+ <field name="model">product.customer.code</field>
719+ <field name="arch" type="xml">
720+ <tree string="Product Customer Code">
721+ <field name="product_code"/>
722+ <field name="partner_id"/>
723+ <field name="company_id"/>
724+ <field name="product_id"/>
725+ </tree>
726+ </field>
727+ </record>
728+
729+ <record id="action_product_customer_code_tree" model="ir.actions.act_window">
730+ <field name="name">Product Customer Code</field>
731+ <field name="res_model">product.customer.code</field>
732+ <field name="view_type">form</field>
733+ <field name="view_id" ref="view_product_customer_code_tree"/>
734+ </record>
735+
736+ <record id="view_product_customer_code_search" model="ir.ui.view">
737+ <field name="name">view.product.customer.code.certificate.search</field>
738+ <field name="model">product.customer.code</field>
739+ <field name="arch" type="xml">
740+ <search string="Product Customer Code">
741+ <field name="product_code"/>
742+ <field name="partner_id"/>
743+ <field name="company_id"/>
744+ <field name="product_id"/>
745+ <newline/>
746+ <group expand="0" string="Group By...">
747+ <filter string="Company" icon="terp-partner" domain="[]" context="{'group_by':'company_id'}"/>
748+ <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
749+ <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
750+ <separator orientation="vertical"/>
751+ </group>
752+ </search>
753+ </field>
754+ </record>
755+
756+ <menuitem action="action_product_customer_code_tree" id="menu_product_customer_code" sequence="50" parent="product.prod_config_main" groups="group_product_customer_code_manager"/>
757+
758+ </data>
759+</openerp>
760\ No newline at end of file
761
762=== added file 'product_customer_code/product_product_view.xml'
763--- product_customer_code/product_product_view.xml 1970-01-01 00:00:00 +0000
764+++ product_customer_code/product_product_view.xml 2014-01-21 20:25:53 +0000
765@@ -0,0 +1,31 @@
766+<?xml version='1.0' encoding='UTF-8'?>
767+<openerp>
768+ <data>
769+
770+ <record model="ir.ui.view" id="product_normal_form_inh_product_customer_code_01">
771+ <field name="name">product.normal.form.inh.product.customer.code.01</field>
772+ <field name="model">product.product</field>
773+ <field name="inherit_id" ref="product.product_normal_form_view"/>
774+ <field name="arch" type="xml">
775+ <page string="Information" position="after">
776+ <page string="Customer Code">
777+ <field name="product_customer_code_ids" nolabel="1" colspan="4" widget="one2many_list">
778+ <tree string="Product Customer Code" editable="bottom">
779+ <field name="product_code"/>
780+ <field name="partner_id"/>
781+<!--
782+ <field name="company_id" widget="selection" groups="base.group_multi_company"/>
783+-->
784+ </tree>
785+ <form string="Product Customer Code" version="7.0">
786+ <field name="product_code"/>
787+ <field name="partner_id"/>
788+ </form>
789+ </field>
790+ </page>
791+ </page>
792+ </field>
793+ </record>
794+
795+ </data>
796+</openerp>
797\ No newline at end of file
798
799=== added directory 'product_customer_code/security'
800=== added file 'product_customer_code/security/ir.model.access.csv'
801--- product_customer_code/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
802+++ product_customer_code/security/ir.model.access.csv 2014-01-21 20:25:53 +0000
803@@ -0,0 +1,3 @@
804+id,name,model_id:id,group_id:id,perm_create,perm_unlink,perm_write,perm_read
805+access_product_customer_code_user,product.customer.code.user,model_product_customer_code,group_product_customer_code_user,0,0,0,1
806+access_product_customer_code_manager,product.customer.code.manager,model_product_customer_code,group_product_customer_code_manager,1,1,1,1
807
808=== added file 'product_customer_code/security/product_customer_code_security.xml'
809--- product_customer_code/security/product_customer_code_security.xml 1970-01-01 00:00:00 +0000
810+++ product_customer_code/security/product_customer_code_security.xml 2014-01-21 20:25:53 +0000
811@@ -0,0 +1,12 @@
812+<?xml version='1.0' encoding='UTF-8'?>
813+<openerp>
814+ <data noupdate="0">
815+ <record id="group_product_customer_code_manager" model="res.groups">
816+ <field name="name">Product_Customer / Manager</field>
817+ </record>
818+ <record id="group_product_customer_code_user" model="res.groups">
819+ <field name="name">Product_Customer / User</field>
820+ </record>
821+
822+ </data>
823+</openerp>
824\ No newline at end of file

Subscribers

People subscribed via source and target branches