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

Proposed by Raphaël Valyi - http://www.akretion.com
Status: Merged
Merged at revision: 247
Proposed branch: lp:~akretion-team/openerp-product-attributes/7.0-product-customer-code-extraction
Merge into: lp:~product-core-editors/openerp-product-attributes/7.0
Diff against target: 844 lines (+775/-0)
12 files modified
product_customer_code/__init__.py (+2/-0)
product_customer_code/__openerp__.py (+60/-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 (+61/-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 (+14/-0)
To merge this branch: bzr merge lp:~akretion-team/openerp-product-attributes/7.0-product-customer-code-extraction
Reviewer Review Type Date Requested Status
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Lorenzo Battistini (community) code review Approve
David BEAL (ak) (community) Needs Information
Nhomar - Vauxoo Needs Fixing
Review via email: mp+198296@code.launchpad.net

Description of the change

Hello,

This branch is the extraction from the product_customer_code module from the https://code.launchpad.net/~vauxoo/addons-vauxoo/7.0 branch using https://code.launchpad.net/bazaar-extractor (with Nhomar approval for the extraction)

product_customer_code is a simple module adding extra information on products. It does just like the product.supplierinfo but for customers instead. For instance it allows to have different references for the same product according to the customer.

We are starting to use the module in some project at Akretion. Vauxoo is using it too. Can we merge it?

Regards.

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

Thanks, very useful module.

Some little remarks:

'summary' could be added to __openerp__ with something like "Add many Customers' Codes in product"

Module description could be replaced by something like "This module does just like the product.supplierinfo but for customers instead. For instance it allows to have different references for the same product according to the customer"

Every reference to 'osv' should be replaced by 'orm'

A bit of PEP8 changes are needed

review: Needs Fixing
Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

@Raph.

I will fix all the @v7 part to merge in your branch before this merge.

THis is the group of modules that we didn't migrate yet complete to v7 ;-)

Be in touch.

Thanks for the extraction job.

PS: I will mark as need fixing until we make the job.

review: Needs Fixing
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

@Nhomar,

please take my branch and ask a merge in my branch (you don't have the
right, you are not good enough to be accepted in akretion-team ;-), this is
a simplest because the extraction is a boring task.

On Fri, Dec 13, 2013 at 10:25 AM, Nhomar - Vauxoo <email address hidden> wrote:

> Review: Needs Fixing
>
> @Raph.
>
> I will fix all the @v7 part to merge in your branch before this merge.
>
> THis is the group of modules that we didn't migrate yet complete to v7 ;-)
>
> Be in touch.
>
> Thanks for the extraction job.
>
> PS: I will mark as need fixing until we make the job.
> --
>
> https://code.launchpad.net/~akretion-team/openerp-product-attributes/7.0-product-customer-code-extraction/+merge/198296
> Your team OpenERP Community is subscribed to branch
> lp:openerp-product-attributes.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~openerp-community
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
David BEAL (ak) (davidbeal) wrote :

I've done a module with very close features

http://bazaar.launchpad.net/~davidbeal/+junk/product_info/files/head:/product_info_partner/

The name is more generic (partner -> customer)

It is partner oriented (o2m) rather than product

The fields (code + description) are usable in sale.order and invoice

Perhaps some features must be merged.

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :
Revision history for this message
Lorenzo Battistini (elbati) wrote :

On 12/13/2013 04:55 PM, Raphaël Valyi - http://www.akretion.com wrote:
> Hello, the merge is now including fixes by Nhomar https://code.launchpad.net/~vauxoo/openerp-product-attributes/7.0-product-customer-code-extractionFIX/+merge/198939

Thanks.

Just one missing thing: every reference to 'osv' should be replaced by 'orm'

BTW, I can't find any remark about this on
https://doc.openerp.com/contribute/15_guidelines/
and
https://doc.openerp.com/trunk/server/03_module_dev_02/

If this requirement is still valid, we should update the documentation.

Revision history for this message
David BEAL (ak) (davidbeal) wrote :

Why not unify supplier code and customer code (or begin to unify, i know there is a similar concept for supplier) ?

A customer may be a supplier too. => partner

review: Needs Information
Revision history for this message
Lorenzo Battistini (elbati) wrote :

On 01/07/2014 05:20 PM, David BEAL wrote:
> Review: Needs Information
>
> Why not unify supplier code and customer code (or begin to unify, i know there is a similar concept for supplier) ?

Do you mean using 'product.supplierinfo' for customers too?

I prefer to keep them distinct, because supplierinfo entails behaviours
related to procurements. Thus, fields names and descriptions of
'product.supplierinfo' contain references to suppliers and purchase
orders, then, even trying to unify them, it would create confusion I think.

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

I set this MP as Work in progress as it is in "Needs Fixing" since weeks. Please set it back to "Need Review" once you think you are done.

Revision history for this message
Lorenzo Battistini (elbati) wrote :
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello I merged Lorenzo Battistini changed into this MP, how does it look now?

Revision history for this message
Lorenzo Battistini (elbati) :
review: Approve (code review)
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi,

This looks good to me, thanks for the contrib.

@Raphaël : Would have be good to set up this MP from "Work in progress" to "Needs reivew" once you've made the last corrections, otherwise it doesn't appear in review list.. => I correct that now.

Regards,

Joël

review: Approve (code review, no tests)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'product_customer_code'
=== added file 'product_customer_code/__init__.py'
--- product_customer_code/__init__.py 1970-01-01 00:00:00 +0000
+++ product_customer_code/__init__.py 2014-03-14 15:29:41 +0000
@@ -0,0 +1,2 @@
1import product_customer_code
2import product
03
=== added file 'product_customer_code/__openerp__.py'
--- product_customer_code/__openerp__.py 1970-01-01 00:00:00 +0000
+++ product_customer_code/__openerp__.py 2014-03-14 15:29:41 +0000
@@ -0,0 +1,60 @@
1# -*- encoding: utf-8 -*-
2###########################################################################
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8############################################################################
9# Coded by: el_rodo_1 (rodo@vauxoo.com)
10############################################################################
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero 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 Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25##############################################################################
26{
27 "name": "Products Customer Code",
28 "version": "1.0",
29 "author": "Vauxoo",
30 "website": "http://www.vauxoo.com/",
31 "license": "AGPL-3",
32 "category": "Generic Modules/Product",
33 "summary": "Add many Customers' Codes in product",
34 "depends": [
35 "base",
36 "product",
37 ],
38 "description": """
39Customer' codes in product
40==========================
41
42This module does just like the product.supplierinfo but for customers instead. For instance it
43allows to have different references for the same product according to the customer.
44
45.. image:: product_customer_code/static/src/img/screenshot1.png
46
47.. tip::
48
49 You will need install some of the Apps which enable the product menu to see this module in
50 action, like Sales, Purchase or Warehouse Management
51 """,
52 "data": [
53 "security/product_customer_code_security.xml",
54 "security/ir.model.access.csv",
55 "product_customer_code_view.xml",
56 "product_product_view.xml",
57 ],
58 "active": False,
59 "installable": True,
60}
061
=== added directory 'product_customer_code/i18n'
=== added file 'product_customer_code/i18n/es.po'
--- product_customer_code/i18n/es.po 1970-01-01 00:00:00 +0000
+++ product_customer_code/i18n/es.po 2014-03-14 15:29:41 +0000
@@ -0,0 +1,122 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * product_customer_code
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.1\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-11-07 01:08+0000\n"
10"PO-Revision-Date: 2013-11-08 17:49+0000\n"
11"Last-Translator: hbto [Vauxoo] http://www.vauxoo.com "
12"<humbertoarocha@gmail.com>\n"
13"Language-Team: \n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
17"X-Launchpad-Export-Date: 2013-12-06 06:26+0000\n"
18"X-Generator: Launchpad (build 16863)\n"
19
20#. module: product_customer_code
21#: field:product.customer.code,partner_id:0
22msgid "Customer"
23msgstr "Cliente"
24
25#. module: product_customer_code
26#: view:product.product:0
27msgid "Information"
28msgstr "Información"
29
30#. module: product_customer_code
31#: view:product.product:0
32msgid "Customer Code"
33msgstr "Código del Cliente"
34
35#. module: product_customer_code
36#: sql_constraint:product.customer.code:0
37msgid "Product Code of customer must be unique"
38msgstr "El Codigo del Producto del Cliente Debe ser Unico"
39
40#. module: product_customer_code
41#: model:res.groups,name:product_customer_code.group_product_customer_code_manager
42msgid "Product_Customer / Manager"
43msgstr "Product_Customer / Manager"
44
45#. module: product_customer_code
46#: field:product.customer.code,product_code:0
47msgid "Customer Product Code"
48msgstr "Código del Producto por Cliente"
49
50#. module: product_customer_code
51#: view:product.customer.code:0
52#: field:product.customer.code,company_id:0
53msgid "Company"
54msgstr "Compañia"
55
56#. module: product_customer_code
57#: model:ir.actions.act_window,name:product_customer_code.action_product_customer_code_tree
58#: model:ir.ui.menu,name:product_customer_code.menu_product_customer_code
59#: view:product.customer.code:0
60#: view:product.product:0
61msgid "Product Customer Code"
62msgstr "Código del Producto por Cliente"
63
64#. module: product_customer_code
65#: model:ir.model,name:product_customer_code.model_product_product
66#: view:product.customer.code:0
67#: field:product.customer.code,product_id:0
68msgid "Product"
69msgstr "Producto"
70
71#. module: product_customer_code
72#: help:product.customer.code,product_code:0
73msgid ""
74"This customer's product code\n"
75" will be used when searching "
76"into\n"
77" a request for quotation."
78msgstr ""
79"El código de Producto del cliente\n"
80" se usará cuando se busque en\n"
81" una solicitud de cotización."
82
83#. module: product_customer_code
84#: field:product.product,product_customer_code_ids:0
85msgid "Customer Codes"
86msgstr "Código del Cliente"
87
88#. module: product_customer_code
89#: view:product.customer.code:0
90msgid "Group By..."
91msgstr "Agrupar por ..."
92
93#. module: product_customer_code
94#: model:res.groups,name:product_customer_code.group_product_customer_code_user
95msgid "Product_Customer / User"
96msgstr "Product_Customer / User"
97
98#. module: product_customer_code
99#: field:product.customer.code,product_name:0
100msgid "Customer Product Name"
101msgstr "Nombre del producto"
102
103#. module: product_customer_code
104#: view:product.customer.code:0
105msgid "Partner"
106msgstr "Partner"
107
108#. module: product_customer_code
109#: model:ir.model,name:product_customer_code.model_product_customer_code
110msgid "Add manies Code of Customer's"
111msgstr "Agregar varios códigos de clientes"
112
113#. module: product_customer_code
114#: help:product.customer.code,product_name:0
115msgid ""
116"This customer's product name will\n"
117" be used when searching into a\n"
118" request for quotation."
119msgstr ""
120"Este nombre de Producto del cliente\n"
121" se usará cuando se busque en\n"
122" una solicitud de cotización."
0123
=== added file 'product_customer_code/i18n/es_MX.po'
--- product_customer_code/i18n/es_MX.po 1970-01-01 00:00:00 +0000
+++ product_customer_code/i18n/es_MX.po 2014-03-14 15:29:41 +0000
@@ -0,0 +1,115 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * product_customer_code
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.1\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-11-07 01:08+0000\n"
10"PO-Revision-Date: 2013-11-07 05:14+0000\n"
11"Last-Translator: julio <julio@vauxoo.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"X-Launchpad-Export-Date: 2013-12-06 06:26+0000\n"
17"X-Generator: Launchpad (build 16863)\n"
18
19#. module: product_customer_code
20#: field:product.customer.code,partner_id:0
21msgid "Customer"
22msgstr ""
23
24#. module: product_customer_code
25#: view:product.product:0
26msgid "Information"
27msgstr ""
28
29#. module: product_customer_code
30#: view:product.product:0
31msgid "Customer Code"
32msgstr ""
33
34#. module: product_customer_code
35#: sql_constraint:product.customer.code:0
36msgid "Product Code of customer must be unique"
37msgstr ""
38
39#. module: product_customer_code
40#: model:res.groups,name:product_customer_code.group_product_customer_code_manager
41msgid "Product_Customer / Manager"
42msgstr ""
43
44#. module: product_customer_code
45#: field:product.customer.code,product_code:0
46msgid "Customer Product Code"
47msgstr ""
48
49#. module: product_customer_code
50#: view:product.customer.code:0
51#: field:product.customer.code,company_id:0
52msgid "Company"
53msgstr ""
54
55#. module: product_customer_code
56#: model:ir.actions.act_window,name:product_customer_code.action_product_customer_code_tree
57#: model:ir.ui.menu,name:product_customer_code.menu_product_customer_code
58#: view:product.customer.code:0
59#: view:product.product:0
60msgid "Product Customer Code"
61msgstr ""
62
63#. module: product_customer_code
64#: model:ir.model,name:product_customer_code.model_product_product
65#: view:product.customer.code:0
66#: field:product.customer.code,product_id:0
67msgid "Product"
68msgstr ""
69
70#. module: product_customer_code
71#: help:product.customer.code,product_code:0
72msgid ""
73"This customer's product code\n"
74" will be used when searching "
75"into\n"
76" a request for quotation."
77msgstr ""
78
79#. module: product_customer_code
80#: field:product.product,product_customer_code_ids:0
81msgid "Customer Codes"
82msgstr ""
83
84#. module: product_customer_code
85#: view:product.customer.code:0
86msgid "Group By..."
87msgstr ""
88
89#. module: product_customer_code
90#: model:res.groups,name:product_customer_code.group_product_customer_code_user
91msgid "Product_Customer / User"
92msgstr ""
93
94#. module: product_customer_code
95#: field:product.customer.code,product_name:0
96msgid "Customer Product Name"
97msgstr ""
98
99#. module: product_customer_code
100#: view:product.customer.code:0
101msgid "Partner"
102msgstr ""
103
104#. module: product_customer_code
105#: model:ir.model,name:product_customer_code.model_product_customer_code
106msgid "Add manies Code of Customer's"
107msgstr ""
108
109#. module: product_customer_code
110#: help:product.customer.code,product_name:0
111msgid ""
112"This customer's product name will\n"
113" be used when searching into a\n"
114" request for quotation."
115msgstr ""
0116
=== added file 'product_customer_code/i18n/es_VE.po'
--- product_customer_code/i18n/es_VE.po 1970-01-01 00:00:00 +0000
+++ product_customer_code/i18n/es_VE.po 2014-03-14 15:29:41 +0000
@@ -0,0 +1,115 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * product_customer_code
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.1\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-11-07 01:08+0000\n"
10"PO-Revision-Date: 2013-11-07 05:08+0000\n"
11"Last-Translator: julio <julio@vauxoo.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"X-Launchpad-Export-Date: 2013-12-06 06:26+0000\n"
17"X-Generator: Launchpad (build 16863)\n"
18
19#. module: product_customer_code
20#: field:product.customer.code,partner_id:0
21msgid "Customer"
22msgstr ""
23
24#. module: product_customer_code
25#: view:product.product:0
26msgid "Information"
27msgstr ""
28
29#. module: product_customer_code
30#: view:product.product:0
31msgid "Customer Code"
32msgstr ""
33
34#. module: product_customer_code
35#: sql_constraint:product.customer.code:0
36msgid "Product Code of customer must be unique"
37msgstr ""
38
39#. module: product_customer_code
40#: model:res.groups,name:product_customer_code.group_product_customer_code_manager
41msgid "Product_Customer / Manager"
42msgstr ""
43
44#. module: product_customer_code
45#: field:product.customer.code,product_code:0
46msgid "Customer Product Code"
47msgstr ""
48
49#. module: product_customer_code
50#: view:product.customer.code:0
51#: field:product.customer.code,company_id:0
52msgid "Company"
53msgstr ""
54
55#. module: product_customer_code
56#: model:ir.actions.act_window,name:product_customer_code.action_product_customer_code_tree
57#: model:ir.ui.menu,name:product_customer_code.menu_product_customer_code
58#: view:product.customer.code:0
59#: view:product.product:0
60msgid "Product Customer Code"
61msgstr ""
62
63#. module: product_customer_code
64#: model:ir.model,name:product_customer_code.model_product_product
65#: view:product.customer.code:0
66#: field:product.customer.code,product_id:0
67msgid "Product"
68msgstr ""
69
70#. module: product_customer_code
71#: help:product.customer.code,product_code:0
72msgid ""
73"This customer's product code\n"
74" will be used when searching "
75"into\n"
76" a request for quotation."
77msgstr ""
78
79#. module: product_customer_code
80#: field:product.product,product_customer_code_ids:0
81msgid "Customer Codes"
82msgstr ""
83
84#. module: product_customer_code
85#: view:product.customer.code:0
86msgid "Group By..."
87msgstr ""
88
89#. module: product_customer_code
90#: model:res.groups,name:product_customer_code.group_product_customer_code_user
91msgid "Product_Customer / User"
92msgstr ""
93
94#. module: product_customer_code
95#: field:product.customer.code,product_name:0
96msgid "Customer Product Name"
97msgstr ""
98
99#. module: product_customer_code
100#: view:product.customer.code:0
101msgid "Partner"
102msgstr ""
103
104#. module: product_customer_code
105#: model:ir.model,name:product_customer_code.model_product_customer_code
106msgid "Add manies Code of Customer's"
107msgstr ""
108
109#. module: product_customer_code
110#: help:product.customer.code,product_name:0
111msgid ""
112"This customer's product name will\n"
113" be used when searching into a\n"
114" request for quotation."
115msgstr ""
0116
=== added file 'product_customer_code/i18n/product_customer_code.pot'
--- product_customer_code/i18n/product_customer_code.pot 1970-01-01 00:00:00 +0000
+++ product_customer_code/i18n/product_customer_code.pot 2014-03-14 15:29:41 +0000
@@ -0,0 +1,112 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * product_customer_code
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-11-07 01:08+0000\n"
10"PO-Revision-Date: 2013-11-07 01:08+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: product_customer_code
19#: field:product.customer.code,partner_id:0
20msgid "Customer"
21msgstr ""
22
23#. module: product_customer_code
24#: view:product.product:0
25msgid "Information"
26msgstr ""
27
28#. module: product_customer_code
29#: view:product.product:0
30msgid "Customer Code"
31msgstr ""
32
33#. module: product_customer_code
34#: sql_constraint:product.customer.code:0
35msgid "Product Code of customer must be unique"
36msgstr ""
37
38#. module: product_customer_code
39#: model:res.groups,name:product_customer_code.group_product_customer_code_manager
40msgid "Product_Customer / Manager"
41msgstr ""
42
43#. module: product_customer_code
44#: field:product.customer.code,product_code:0
45msgid "Customer Product Code"
46msgstr ""
47
48#. module: product_customer_code
49#: view:product.customer.code:0
50#: field:product.customer.code,company_id:0
51msgid "Company"
52msgstr ""
53
54#. module: product_customer_code
55#: model:ir.actions.act_window,name:product_customer_code.action_product_customer_code_tree
56#: model:ir.ui.menu,name:product_customer_code.menu_product_customer_code
57#: view:product.customer.code:0
58#: view:product.product:0
59msgid "Product Customer Code"
60msgstr ""
61
62#. module: product_customer_code
63#: model:ir.model,name:product_customer_code.model_product_product
64#: view:product.customer.code:0
65#: field:product.customer.code,product_id:0
66msgid "Product"
67msgstr ""
68
69#. module: product_customer_code
70#: help:product.customer.code,product_code:0
71msgid "This customer's product code\n"
72" will be used when searching into\n"
73" a request for quotation."
74msgstr ""
75
76#. module: product_customer_code
77#: field:product.product,product_customer_code_ids:0
78msgid "Customer Codes"
79msgstr ""
80
81#. module: product_customer_code
82#: view:product.customer.code:0
83msgid "Group By..."
84msgstr ""
85
86#. module: product_customer_code
87#: model:res.groups,name:product_customer_code.group_product_customer_code_user
88msgid "Product_Customer / User"
89msgstr ""
90
91#. module: product_customer_code
92#: field:product.customer.code,product_name:0
93msgid "Customer Product Name"
94msgstr ""
95
96#. module: product_customer_code
97#: view:product.customer.code:0
98msgid "Partner"
99msgstr ""
100
101#. module: product_customer_code
102#: model:ir.model,name:product_customer_code.model_product_customer_code
103msgid "Add manies Code of Customer's"
104msgstr ""
105
106#. module: product_customer_code
107#: help:product.customer.code,product_name:0
108msgid "This customer's product name will\n"
109" be used when searching into a\n"
110" request for quotation."
111msgstr ""
112
0113
=== added file 'product_customer_code/product.py'
--- product_customer_code/product.py 1970-01-01 00:00:00 +0000
+++ product_customer_code/product.py 2014-03-14 15:29:41 +0000
@@ -0,0 +1,73 @@
1# -*- coding: utf-8 -*-
2###########################################################################
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
6# All Rights Reserved.
7# info@vauxoo.com
8############################################################################
9# Coded by: Rodo (rodo@vauxoo.com),Moy (moylop260@vauxoo.com)
10############################################################################
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero 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 Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25##############################################################################
26from openerp.osv import orm, fields
27from openerp.tools.translate import _
28
29
30class product_product(orm.Model):
31 _inherit = "product.product"
32
33 _columns = {
34 'product_customer_code_ids': fields.one2many('product.customer.code',
35 'product_id',
36 'Customer Codes'),
37 }
38
39 def copy(self, cr, uid, id, default=None, context=None):
40 if not default:
41 default = {}
42 default['product_customer_code_ids'] = False
43 res = super(product_product, self).copy(
44 cr, uid, id, default=default, context=context)
45 return res
46
47 def name_search(self, cr, user, name='', args=None, operator='ilike',
48 context=None, limit=80):
49 res = super(product_product, self).name_search(
50 cr, user, name, args, operator, context, limit)
51 if not context:
52 context = {}
53 product_customer_code_obj = self.pool.get('product.customer.code')
54 if not res:
55 ids = []
56 partner_id = context.get('partner_id', False)
57 if partner_id:
58 id_prod_code = \
59 product_customer_code_obj.search(cr, user,
60 [('product_code',
61 '=', name),
62 ('partner_id', '=',
63 partner_id)],
64 limit=limit,
65 context=context)
66 # TODO: Search for product customer name
67 id_prod = id_prod_code and product_customer_code_obj.browse(
68 cr, user, id_prod_code, context=context) or []
69 for ppu in id_prod:
70 ids.append(ppu.product_id.id)
71 if ids:
72 res = self.name_get(cr, user, ids, context)
73 return res
074
=== added file 'product_customer_code/product_customer_code.py'
--- product_customer_code/product_customer_code.py 1970-01-01 00:00:00 +0000
+++ product_customer_code/product_customer_code.py 2014-03-14 15:29:41 +0000
@@ -0,0 +1,67 @@
1# -*- coding: utf-8 -*-
2###########################################################################
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
6# All Rights Reserved.
7# info@vauxoo.com
8############################################################################
9# Coded by: Rodo (rodo@vauxoo.com),Moy (moylop260@vauxoo.com)
10############################################################################
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero 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 Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25##############################################################################
26from openerp.osv import orm, fields
27from openerp.tools.translate import _
28
29
30class product_customer_code(orm.Model):
31 _name = "product.customer.code"
32 _description = "Add manies Code of Customer's"
33
34 _rec_name = 'product_code'
35
36 _columns = {
37 'product_code': fields.char('Customer Product Code', size=64,
38 required=True,
39 help="""This customer's product code
40 will be used when searching into
41 a request for quotation."""),
42 'product_name': fields.char('Customer Product Name', size=128,
43 help="""This customer's product name will
44 be used when searching into a
45 request for quotation."""),
46 'product_id': fields.many2one('product.product', 'Product',
47 required=True),
48 'partner_id': fields.many2one('res.partner', 'Customer',
49 required=True),
50 'company_id': fields.many2one('res.company', 'Company',
51 required=False),
52 }
53
54 _defaults = {
55 'company_id': lambda s, cr,
56 uid, c: s.pool.get('res.company').
57 _company_default_get(cr, uid,
58 'product.customer.code',
59 context=c),
60 }
61
62 _sql_constraints = [
63 ('unique_code', 'unique(product_code,company_id,partner_id)',
64 'Product Code of customer must be unique'),
65 ]
66
67 # TODO: Add index to product_code, partner_id
068
=== added file 'product_customer_code/product_customer_code_view.xml'
--- product_customer_code/product_customer_code_view.xml 1970-01-01 00:00:00 +0000
+++ product_customer_code/product_customer_code_view.xml 2014-03-14 15:29:41 +0000
@@ -0,0 +1,61 @@
1<?xml version='1.0' encoding='UTF-8'?>
2<openerp>
3 <data>
4
5 <record model="ir.ui.view" id="view_product_customer_code_form">
6 <field name="name">view.product.customer.code.form</field>
7 <field name="model">product.customer.code</field>
8 <field name="arch" type="xml">
9 <form string="Product Customer Code" version="7.0">
10 <field name="product_code"/>
11 <field name="partner_id"/>
12 <field name="product_id"/>
13 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
14 </form>
15 </field>
16 </record>
17
18 <record model="ir.ui.view" id="view_product_customer_code_tree">
19 <field name="name">view.product.customer.code.tree</field>
20 <field name="model">product.customer.code</field>
21 <field name="arch" type="xml">
22 <tree string="Product Customer Code">
23 <field name="product_code"/>
24 <field name="partner_id"/>
25 <field name="company_id"/>
26 <field name="product_id"/>
27 </tree>
28 </field>
29 </record>
30
31 <record id="action_product_customer_code_tree" model="ir.actions.act_window">
32 <field name="name">Product Customer Code</field>
33 <field name="res_model">product.customer.code</field>
34 <field name="view_type">form</field>
35 <field name="view_id" ref="view_product_customer_code_tree"/>
36 </record>
37
38 <record id="view_product_customer_code_search" model="ir.ui.view">
39 <field name="name">view.product.customer.code.certificate.search</field>
40 <field name="model">product.customer.code</field>
41 <field name="arch" type="xml">
42 <search string="Product Customer Code">
43 <field name="product_code"/>
44 <field name="partner_id"/>
45 <field name="company_id"/>
46 <field name="product_id"/>
47 <newline/>
48 <group expand="0" string="Group By...">
49 <filter string="Company" icon="terp-partner" domain="[]" context="{'group_by':'company_id'}"/>
50 <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
51 <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
52 <separator orientation="vertical"/>
53 </group>
54 </search>
55 </field>
56 </record>
57
58 <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"/>
59
60 </data>
61</openerp>
062
=== added file 'product_customer_code/product_product_view.xml'
--- product_customer_code/product_product_view.xml 1970-01-01 00:00:00 +0000
+++ product_customer_code/product_product_view.xml 2014-03-14 15:29:41 +0000
@@ -0,0 +1,31 @@
1<?xml version='1.0' encoding='UTF-8'?>
2<openerp>
3 <data>
4
5 <record model="ir.ui.view" id="product_normal_form_inh_product_customer_code_01">
6 <field name="name">product.normal.form.inh.product.customer.code.01</field>
7 <field name="model">product.product</field>
8 <field name="inherit_id" ref="product.product_normal_form_view"/>
9 <field name="arch" type="xml">
10 <page string="Information" position="after">
11 <page string="Customer Code">
12 <field name="product_customer_code_ids" nolabel="1" colspan="4" widget="one2many_list">
13 <tree string="Product Customer Code" editable="bottom">
14 <field name="product_code"/>
15 <field name="partner_id"/>
16<!--
17 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
18-->
19 </tree>
20 <form string="Product Customer Code" version="7.0">
21 <field name="product_code"/>
22 <field name="partner_id"/>
23 </form>
24 </field>
25 </page>
26 </page>
27 </field>
28 </record>
29
30 </data>
31</openerp>
0\ No newline at end of file32\ No newline at end of file
133
=== added directory 'product_customer_code/security'
=== added file 'product_customer_code/security/ir.model.access.csv'
--- product_customer_code/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ product_customer_code/security/ir.model.access.csv 2014-03-14 15:29:41 +0000
@@ -0,0 +1,3 @@
1id,name,model_id:id,group_id:id,perm_create,perm_unlink,perm_write,perm_read
2access_product_customer_code_user,product.customer.code.user,model_product_customer_code,group_product_customer_code_user,0,0,0,1
3access_product_customer_code_manager,product.customer.code.manager,model_product_customer_code,group_product_customer_code_manager,1,1,1,1
04
=== added file 'product_customer_code/security/product_customer_code_security.xml'
--- product_customer_code/security/product_customer_code_security.xml 1970-01-01 00:00:00 +0000
+++ product_customer_code/security/product_customer_code_security.xml 2014-03-14 15:29:41 +0000
@@ -0,0 +1,14 @@
1<?xml version='1.0' encoding='UTF-8'?>
2<openerp>
3 <data noupdate="1">
4
5 <record id="group_product_customer_code_manager" model="res.groups">
6 <field name="name">Product_Customer / Manager</field>
7 </record>
8
9 <record id="group_product_customer_code_user" model="res.groups">
10 <field name="name">Product_Customer / User</field>
11 </record>
12
13 </data>
14</openerp>
015
=== added directory 'product_customer_code/static'
=== added directory 'product_customer_code/static/src'
=== added directory 'product_customer_code/static/src/img'
=== added file 'product_customer_code/static/src/img/screenshot1.png'
1Binary files product_customer_code/static/src/img/screenshot1.png 1970-01-01 00:00:00 +0000 and product_customer_code/static/src/img/screenshot1.png 2014-03-14 15:29:41 +0000 differ16Binary files product_customer_code/static/src/img/screenshot1.png 1970-01-01 00:00:00 +0000 and product_customer_code/static/src/img/screenshot1.png 2014-03-14 15:29:41 +0000 differ

Subscribers

People subscribed via source and target branches