Merge lp:~domsense/domsense-agilebg-addons/adding_partner_address_construction into lp:domsense-agilebg-addons/6.0

Proposed by Lorenzo Battistini
Status: Needs review
Proposed branch: lp:~domsense/domsense-agilebg-addons/adding_partner_address_construction
Merge into: lp:domsense-agilebg-addons/6.0
Diff against target: 211 lines (+182/-0)
5 files modified
partner_address_construction/__init__.py (+24/-0)
partner_address_construction/__openerp__.py (+44/-0)
partner_address_construction/i18n/it.po (+32/-0)
partner_address_construction/partner/__init__.py (+23/-0)
partner_address_construction/partner/partner.py (+59/-0)
To merge this branch: bzr merge lp:~domsense/domsense-agilebg-addons/adding_partner_address_construction
Reviewer Review Type Date Requested Status
Franco Tampieri Pending
Agile Business Group Pending
Review via email: mp+90055@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

125. By Lorenzo Battistini

[ADD] partner_address_construction

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'partner_address_construction'
2=== added file 'partner_address_construction/__init__.py'
3--- partner_address_construction/__init__.py 1970-01-01 00:00:00 +0000
4+++ partner_address_construction/__init__.py 2012-01-25 07:55:26 +0000
5@@ -0,0 +1,24 @@
6+# -*- encoding: utf-8 -*-
7+##############################################################################
8+#
9+# Copyright (C) 2010 OpenERP Italian Community (<http://www.openerp-italia.org>).
10+# All Rights Reserved
11+# $Id$
12+#
13+# This program is free software: you can redistribute it and/or modify
14+# it under the terms of the GNU Affero General Public License as published by
15+# the Free Software Foundation, either version 3 of the License, or
16+# (at your option) any later version.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU General Public License for more details.
22+#
23+# You should have received a copy of the GNU General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+#
26+##############################################################################
27+
28+import partner
29+
30
31=== added file 'partner_address_construction/__openerp__.py'
32--- partner_address_construction/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ partner_address_construction/__openerp__.py 2012-01-25 07:55:26 +0000
34@@ -0,0 +1,44 @@
35+# -*- encoding: utf-8 -*-
36+##############################################################################
37+#
38+# Copyright (C) 2010-2011 OpenERP Italian Community
39+# http://www.openerp-italia.org>
40+# All Rights Reserved
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 published by
44+# the Free Software Foundation, either version 3 of the License, or
45+# (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 General Public License for more details.
51+#
52+# You should have received a copy of the GNU General Public License
53+# along with this program. If not, see <http://www.gnu.org/licenses/>.
54+#
55+##############################################################################
56+{
57+ 'name': 'Address Construction',
58+ 'version': '0.1',
59+ 'category': 'Custom',
60+ 'description': """Module - Base version
61+
62+Funcionalities:
63+
64+- Aggiunta voce Cantiere alla selezione dei vari address
65+- Automatistmi su res.partner.address e sale order
66+
67+""",
68+ 'author': 'OpenERP Italian Community',
69+ 'website': 'http://www.openerp-italia.org',
70+ 'license': 'AGPL-3',
71+ "depends" : ['base','sale'],
72+ "init_xml" : [],
73+ "update_xml" : [],
74+ "demo_xml" : [],
75+ "active": False,
76+ "installable": True
77+}
78+
79
80=== added directory 'partner_address_construction/i18n'
81=== added file 'partner_address_construction/i18n/it.po'
82--- partner_address_construction/i18n/it.po 1970-01-01 00:00:00 +0000
83+++ partner_address_construction/i18n/it.po 2012-01-25 07:55:26 +0000
84@@ -0,0 +1,32 @@
85+# Translation of OpenERP Server.
86+# This file contains the translation of the following modules:
87+# * partner_address_construction
88+#
89+msgid ""
90+msgstr ""
91+"Project-Id-Version: OpenERP Server 6.0.3\n"
92+"Report-Msgid-Bugs-To: support@openerp.com\n"
93+"POT-Creation-Date: 2012-01-24 07:21+0000\n"
94+"PO-Revision-Date: 2012-01-24 07:21+0000\n"
95+"Last-Translator: <>\n"
96+"Language-Team: \n"
97+"MIME-Version: 1.0\n"
98+"Content-Type: text/plain; charset=UTF-8\n"
99+"Content-Transfer-Encoding: \n"
100+"Plural-Forms: \n"
101+
102+#. module: partner_address_construction
103+#: sql_constraint:sale.order:0
104+msgid "Order Reference must be unique !"
105+msgstr "Il riferimento ordine deve essere unico!"
106+
107+#. module: partner_address_construction
108+#: model:ir.model,name:partner_address_construction.model_sale_order
109+msgid "Sales Order"
110+msgstr "Ordine di vendita"
111+
112+#. module: partner_address_construction
113+#: model:ir.model,name:partner_address_construction.model_res_partner_address
114+msgid "Partner Addresses"
115+msgstr "Indirizzi Partner"
116+
117
118=== added directory 'partner_address_construction/partner'
119=== added file 'partner_address_construction/partner/__init__.py'
120--- partner_address_construction/partner/__init__.py 1970-01-01 00:00:00 +0000
121+++ partner_address_construction/partner/__init__.py 2012-01-25 07:55:26 +0000
122@@ -0,0 +1,23 @@
123+# -*- encoding: utf-8 -*-
124+##############################################################################
125+#
126+# Copyright (C) 2010 OpenERP Italian Community (<http://www.openerp-italia.org>).
127+# All Rights Reserved
128+# $Id$
129+#
130+# This program is free software: you can redistribute it and/or modify
131+# it under the terms of the GNU Affero General Public License as published by
132+# the Free Software Foundation, either version 3 of the License, or
133+# (at your option) any later version.
134+#
135+# This program is distributed in the hope that it will be useful,
136+# but WITHOUT ANY WARRANTY; without even the implied warranty of
137+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
138+# GNU General Public License for more details.
139+#
140+# You should have received a copy of the GNU General Public License
141+# along with this program. If not, see <http://www.gnu.org/licenses/>.
142+#
143+##############################################################################
144+
145+import partner
146\ No newline at end of file
147
148=== added file 'partner_address_construction/partner/partner.py'
149--- partner_address_construction/partner/partner.py 1970-01-01 00:00:00 +0000
150+++ partner_address_construction/partner/partner.py 2012-01-25 07:55:26 +0000
151@@ -0,0 +1,59 @@
152+# -*- encoding: utf-8 -*-
153+##############################################################################
154+#
155+# Copyright (C) 2010 OpenERP Italian Community (<http://www.openerp-italia.org>).
156+# All Rights Reserved
157+# $Id$
158+#
159+# This program is free software: you can redistribute it and/or modify
160+# it under the terms of the GNU Affero General Public License as published by
161+# the Free Software Foundation, either version 3 of the License, or
162+# (at your option) any later version.
163+#
164+# This program is distributed in the hope that it will be useful,
165+# but WITHOUT ANY WARRANTY; without even the implied warranty of
166+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
167+# GNU General Public License for more details.
168+#
169+# You should have received a copy of the GNU General Public License
170+# along with this program. If not, see <http://www.gnu.org/licenses/>.
171+#
172+##############################################################################
173+
174+from osv import osv
175+from osv import fields
176+
177+class res_partner_address(osv.osv):
178+ _inherit = 'res.partner.address'
179+ _columns = {
180+ 'type': fields.selection( [ ('default','Default'),('invoice','Invoice'), ('delivery','Delivery'), ('contact','Contact'), ('cantiere','Cantiere'), ('other','Other') ],'Address Type', help="Used to select automatically the right address according to the context in sales and purchases documents."),
181+ }
182+
183+res_partner_address()
184+
185+class sale_order(osv.osv):
186+ _inherit = 'sale.order'
187+
188+ def onchange_partner_id(self, cr, uid, ids, part):
189+ if not part:
190+ return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'partner_order_id': False, 'payment_term': False, 'fiscal_position': False}}
191+
192+ addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['delivery', 'invoice', 'contact', 'cantiere'])
193+ part = self.pool.get('res.partner').browse(cr, uid, part)
194+ pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False
195+ payment_term = part.property_payment_term and part.property_payment_term.id or False
196+ fiscal_position = part.property_account_position and part.property_account_position.id or False
197+ dedicated_salesman = part.user_id and part.user_id.id or uid
198+ val = {
199+ 'partner_invoice_id': addr['invoice'],
200+ 'partner_order_id': addr['contact'],
201+ 'partner_shipping_id': addr['cantiere'] or addr['delivery'],
202+ 'payment_term': payment_term,
203+ 'fiscal_position': fiscal_position,
204+ 'user_id': dedicated_salesman,
205+ }
206+ if pricelist:
207+ val['pricelist_id'] = pricelist
208+ return {'value': val}
209+
210+sale_order()
211\ No newline at end of file

Subscribers

People subscribed via source and target branches

to status/vote changes: