Merge lp:~therp-nl/account-invoice-report/account-invoice-report-7.0_delivery_address into lp:~account-core-editors/account-invoice-report/7.0

Proposed by Ronald Portier (Therp)
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp
Approved revision: 50
Merged at revision: 65
Proposed branch: lp:~therp-nl/account-invoice-report/account-invoice-report-7.0_delivery_address
Merge into: lp:~account-core-editors/account-invoice-report/7.0
Diff against target: 850 lines (+786/-0)
12 files modified
account_invoice_delivery_address/__init__.py (+23/-0)
account_invoice_delivery_address/__openerp__.py (+48/-0)
account_invoice_delivery_address/i18n/account_invoice_delivery_address.pot (+42/-0)
account_invoice_delivery_address/i18n/nl.po (+42/-0)
account_invoice_delivery_address/model/__init__.py (+24/-0)
account_invoice_delivery_address/model/account_invoice.py (+81/-0)
account_invoice_delivery_address/model/sale_order.py (+41/-0)
account_invoice_delivery_address/model/stock_picking.py (+42/-0)
account_invoice_delivery_address/report/__init__.py (+21/-0)
account_invoice_delivery_address/report/account_print_invoice.rml (+383/-0)
account_invoice_delivery_address/report/account_print_invoice.xml (+13/-0)
account_invoice_delivery_address/view/account_invoice.xml (+26/-0)
To merge this branch: bzr merge lp:~therp-nl/account-invoice-report/account-invoice-report-7.0_delivery_address
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza code review Approve
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Review via email: mp+207915@code.launchpad.net

Description of the change

Adds delivery address / shipping address to invoice.

Delivery address can be entered directly, or will be taken from partner or sales order.

To post a comment you must log in.
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi,

Thanks for the contrib ! LGTM,

Regards,

Joël

review: Approve (code review, no tests)
Revision history for this message
Ana Juaristi Olalde (ajuaristio) wrote :

Just a doubt:

Tested in runbot, system allows changing picking partner before proccesing delivery.
If selection of invoice delivery address is only taken from sales order or partner itself, will patch work if user changes partner on picking?

Example:
Sale order delivery address: ASUSTeK, Tang Tsui
Picking initial partner: ASUSTeK, Tang Tsui

then change picking partner by: ASUSTeK, Joseph Walters

What happens? (not tested) probably invoice delivery address would be ASUSTeK, Tang Tsui so it would be not correct.

Could it be?

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Ronald,

Can you tell us what is the purpose of the delivery address on invoices? Delivery address for the invoice document?

Regards.

review: Needs Information
Revision history for this message
Ronald Portier (Therp) (rportier1962) wrote :

Hello Pedro,

No, nothing to do with the invoice document.

The delivery address added to invoice is basically the same as on sales order.

It is usefull for customers with a lot of locations/addresses, where the person receiving the invoice needs to know to which location / address an invoice applies.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

OK, then. Do you think any extended explanation on module description can clear more doubts?

Regards.

review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Description edition will be easier on github. I'll merge this one as it has 2 approval

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_invoice_delivery_address'
2=== added file 'account_invoice_delivery_address/__init__.py'
3--- account_invoice_delivery_address/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_invoice_delivery_address/__init__.py 2014-02-24 12:36:01 +0000
5@@ -0,0 +1,23 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
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+from . import model
27+from . import report
28+
29
30=== added file 'account_invoice_delivery_address/__openerp__.py'
31--- account_invoice_delivery_address/__openerp__.py 1970-01-01 00:00:00 +0000
32+++ account_invoice_delivery_address/__openerp__.py 2014-02-24 12:36:01 +0000
33@@ -0,0 +1,48 @@
34+# -*- coding: utf-8 -*-
35+##############################################################################
36+#
37+# OpenERP, Open Source Management Solution
38+# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
39+#
40+# This program is free software: you can redistribute it and/or modify
41+# it under the terms of the GNU Affero General Public License as
42+# published by the Free Software Foundation, either version 3 of the
43+# License, or (at your option) any later version.
44+#
45+# This program is distributed in the hope that it will be useful,
46+# but WITHOUT ANY WARRANTY; without even the implied warranty of
47+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48+# GNU Affero General Public License for more details.
49+#
50+# You should have received a copy of the GNU Affero General Public License
51+# along with this program. If not, see <http://www.gnu.org/licenses/>.
52+#
53+##############################################################################
54+{
55+ "name" : "Account invoice delivery address",
56+ "version" : "1.0",
57+ "author" : "Therp BV",
58+ "complexity": "normal",
59+ "description": """
60+Adds delivery address to the invoice. Also makes sure delivery address is
61+filled from default delivery address, or taken from sales order. Delivery
62+address might also be changed untill invoice is confirmed.
63+ """,
64+ "category" : "",
65+ "depends" : [
66+ 'account',
67+ 'sale_stock',
68+ ],
69+ "data" : [
70+ 'report/account_print_invoice.xml',
71+ 'view/account_invoice.xml',
72+ ],
73+ "js": [
74+ ],
75+ "css": [
76+ ],
77+ "qweb": [
78+ ],
79+ "auto_install": False,
80+ "installable": True,
81+}
82
83=== added directory 'account_invoice_delivery_address/i18n'
84=== added file 'account_invoice_delivery_address/i18n/account_invoice_delivery_address.pot'
85--- account_invoice_delivery_address/i18n/account_invoice_delivery_address.pot 1970-01-01 00:00:00 +0000
86+++ account_invoice_delivery_address/i18n/account_invoice_delivery_address.pot 2014-02-24 12:36:01 +0000
87@@ -0,0 +1,42 @@
88+# Translation of OpenERP Server.
89+# This file contains the translation of the following modules:
90+# * account_invoice_delivery_address
91+#
92+msgid ""
93+msgstr ""
94+"Project-Id-Version: OpenERP Server 7.0\n"
95+"Report-Msgid-Bugs-To: \n"
96+"POT-Creation-Date: 2014-02-24 11:00+0000\n"
97+"PO-Revision-Date: 2014-02-24 11:00+0000\n"
98+"Last-Translator: <>\n"
99+"Language-Team: \n"
100+"MIME-Version: 1.0\n"
101+"Content-Type: text/plain; charset=UTF-8\n"
102+"Content-Transfer-Encoding: \n"
103+"Plural-Forms: \n"
104+
105+#. module: account_invoice_delivery_address
106+#: model:ir.model,name:account_invoice_delivery_address.model_sale_order
107+msgid "Sales Order"
108+msgstr "Sales Order"
109+
110+#. module: account_invoice_delivery_address
111+#: model:ir.model,name:account_invoice_delivery_address.model_account_invoice
112+msgid "Invoice"
113+msgstr "Invoice"
114+
115+#. module: account_invoice_delivery_address
116+#: model:ir.model,name:account_invoice_delivery_address.model_stock_picking
117+msgid "Picking List"
118+msgstr "Picking List"
119+
120+#. module: account
121+#: field:account.invoice,partner_shipping_id:0
122+msgid "Delivery address"
123+msgstr ""
124+
125+#. module: account
126+#: report:account.invoice:0
127+msgid "Shipping address :"
128+msgstr ""
129+
130
131=== added file 'account_invoice_delivery_address/i18n/nl.po'
132--- account_invoice_delivery_address/i18n/nl.po 1970-01-01 00:00:00 +0000
133+++ account_invoice_delivery_address/i18n/nl.po 2014-02-24 12:36:01 +0000
134@@ -0,0 +1,42 @@
135+# Translation of OpenERP Server.
136+# This file contains the translation of the following modules:
137+# * account_invoice_delivery_address
138+#
139+msgid ""
140+msgstr ""
141+"Project-Id-Version: OpenERP Server 7.0\n"
142+"Report-Msgid-Bugs-To: \n"
143+"POT-Creation-Date: 2014-02-24 11:00+0000\n"
144+"PO-Revision-Date: 2014-02-24 11:00+0000\n"
145+"Last-Translator: <>\n"
146+"Language-Team: \n"
147+"MIME-Version: 1.0\n"
148+"Content-Type: text/plain; charset=UTF-8\n"
149+"Content-Transfer-Encoding: \n"
150+"Plural-Forms: \n"
151+
152+#. module: account_invoice_delivery_address
153+#: model:ir.model,name:account_invoice_delivery_address.model_account_invoice
154+msgid "Invoice"
155+msgstr "Factuur"
156+
157+#. module: account_invoice_delivery_address
158+#: model:ir.model,name:account_invoice_delivery_address.model_stock_picking
159+msgid "Picking List"
160+msgstr "Pakbon"
161+
162+#. module: account_invoice_delivery_address
163+#: model:ir.model,name:account_invoice_delivery_address.model_sale_order
164+msgid "Sales Order"
165+msgstr "Verkooporder"
166+
167+#. module: account
168+#: field:account.invoice,partner_shipping_id:0
169+msgid "Delivery address"
170+msgstr "Afleveradres"
171+
172+#. module: account
173+#: report:account.invoice:0
174+msgid "Shipping address :"
175+msgstr "Afleveradres :"
176+
177
178=== added directory 'account_invoice_delivery_address/model'
179=== added file 'account_invoice_delivery_address/model/__init__.py'
180--- account_invoice_delivery_address/model/__init__.py 1970-01-01 00:00:00 +0000
181+++ account_invoice_delivery_address/model/__init__.py 2014-02-24 12:36:01 +0000
182@@ -0,0 +1,24 @@
183+# -*- coding: utf-8 -*-
184+##############################################################################
185+#
186+# OpenERP, Open Source Management Solution
187+# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
188+#
189+# This program is free software: you can redistribute it and/or modify
190+# it under the terms of the GNU Affero General Public License as
191+# published by the Free Software Foundation, either version 3 of the
192+# License, or (at your option) any later version.
193+#
194+# This program is distributed in the hope that it will be useful,
195+# but WITHOUT ANY WARRANTY; without even the implied warranty of
196+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
197+# GNU Affero General Public License for more details.
198+#
199+# You should have received a copy of the GNU Affero General Public License
200+# along with this program. If not, see <http://www.gnu.org/licenses/>.
201+#
202+##############################################################################
203+from . import account_invoice
204+from . import sale_order
205+from . import stock_picking
206+
207
208=== added file 'account_invoice_delivery_address/model/account_invoice.py'
209--- account_invoice_delivery_address/model/account_invoice.py 1970-01-01 00:00:00 +0000
210+++ account_invoice_delivery_address/model/account_invoice.py 2014-02-24 12:36:01 +0000
211@@ -0,0 +1,81 @@
212+# -*- encoding: utf-8 -*-
213+##############################################################################
214+#
215+# OpenERP, Open Source Management Solution
216+# This module Copyright (C) 2014 Therp BV (<http://therp.nl>).
217+# All Rights Reserved
218+#
219+# This program is free software: you can redistribute it and/or modify
220+# it under the terms of the GNU General Public License as published by
221+# the Free Software Foundation, either version 3 of the License, or
222+# (at your option) any later version.
223+#
224+# This program is distributed in the hope that it will be useful,
225+# but WITHOUT ANY WARRANTY; without even the implied warranty of
226+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
227+# GNU General Public License for more details.
228+#
229+# You should have received a copy of the GNU General Public License
230+# along with this program. If not, see <http://www.gnu.org/licenses/>.
231+#
232+##############################################################################
233+'''Extend model account.invoice'''
234+from openerp.osv import orm, fields
235+
236+
237+class AccountInvoice(orm.Model):
238+ '''Modify account invoice to add delivery address'''
239+ _inherit = 'account.invoice'
240+
241+ def _modify_vals(self, cr, uid, vals, browse_obj=None, context=None):
242+ '''Utility function called on create and write to deliver consistent
243+ values. In this case fill delivery address when possible.'''
244+ if 'partner_shipping_id' in vals:
245+ return # do not overwrite when explicitly filled
246+ partner_id = False
247+ if browse_obj:
248+ # Do nothing when invoice no longer in draft or sent state
249+ # or when shipping id already set:
250+ if (not browse_obj.state in ['draft', 'sent']
251+ or browse_obj.partner_shipping_id):
252+ return
253+ partner_id = (
254+ browse_obj.partner_id and browse_obj.partner_id.id or False)
255+ else:
256+ partner_id = vals.get('partner_id') or False
257+ if not partner_id:
258+ return
259+ # We have a partner, find delivery address
260+ partner_model = self.pool.get('res.partner')
261+ addr = partner_model.address_get(
262+ cr, uid, [partner_id], ['delivery'])
263+ vals['partner_shipping_id'] = addr['delivery']
264+
265+ def create(self, cr, uid, vals, context=None):
266+ '''get delivery address, when not already in vals'''
267+ self._modify_vals(cr, uid, vals, browse_obj=None, context=context)
268+ return super(AccountInvoice, self).create(
269+ cr, uid, vals, context)
270+
271+ def write(self, cr, uid, ids, vals, context=None):
272+ '''get delivery address, when not already in vals, or filled'''
273+ for item_id in ids:
274+ browse_records = self.browse(cr, uid, [item_id], context=context)
275+ browse_obj = browse_records[0]
276+ self._modify_vals(
277+ cr, uid, vals, browse_obj=browse_obj, context=context)
278+ super(AccountInvoice, self).write(
279+ cr, uid, [item_id], vals, context=context)
280+ return True
281+
282+ _columns = {
283+ 'partner_shipping_id': fields.many2one(
284+ 'res.partner', 'Delivery Address',
285+ readonly=True,
286+ states={
287+ 'draft': [('readonly', False)],
288+ 'sent': [('readonly', False)]
289+ },
290+ help="Delivery address for current invoice."),
291+ }
292+
293
294=== added file 'account_invoice_delivery_address/model/sale_order.py'
295--- account_invoice_delivery_address/model/sale_order.py 1970-01-01 00:00:00 +0000
296+++ account_invoice_delivery_address/model/sale_order.py 2014-02-24 12:36:01 +0000
297@@ -0,0 +1,41 @@
298+# -*- encoding: utf-8 -*-
299+##############################################################################
300+#
301+# OpenERP, Open Source Management Solution
302+# This module Copyright (C) 2014 Therp BV (<http://therp.nl>).
303+# All Rights Reserved
304+#
305+# This program is free software: you can redistribute it and/or modify
306+# it under the terms of the GNU General Public License as published by
307+# the Free Software Foundation, either version 3 of the License, or
308+# (at your option) any later version.
309+#
310+# This program is distributed in the hope that it will be useful,
311+# but WITHOUT ANY WARRANTY; without even the implied warranty of
312+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
313+# GNU General Public License for more details.
314+#
315+# You should have received a copy of the GNU General Public License
316+# along with this program. If not, see <http://www.gnu.org/licenses/>.
317+#
318+##############################################################################
319+'''Extend model sale.order'''
320+from openerp.osv import orm
321+
322+
323+class SaleOrder(orm.Model):
324+ '''Modify sale order to fill delivery address'''
325+ _inherit = 'sale.order'
326+
327+ def _prepare_invoice(
328+ self, cr, uid, order, lines, context=None):
329+ """\
330+Inherit the original function of the 'sale' module in order to fill delivery
331+address when present in sales order.
332+"""
333+ invoice_vals = super(SaleOrder, self)._prepare_invoice(
334+ cr, uid, order, lines, context=context)
335+ if order.partner_shipping_id:
336+ invoice_vals['partner_shipping_id'] = order.partner_shipping_id.id
337+ return invoice_vals
338+
339
340=== added file 'account_invoice_delivery_address/model/stock_picking.py'
341--- account_invoice_delivery_address/model/stock_picking.py 1970-01-01 00:00:00 +0000
342+++ account_invoice_delivery_address/model/stock_picking.py 2014-02-24 12:36:01 +0000
343@@ -0,0 +1,42 @@
344+# -*- encoding: utf-8 -*-
345+##############################################################################
346+#
347+# OpenERP, Open Source Management Solution
348+# This module Copyright (C) 2014 Therp BV (<http://therp.nl>).
349+# All Rights Reserved
350+#
351+# This program is free software: you can redistribute it and/or modify
352+# it under the terms of the GNU General Public License as published by
353+# the Free Software Foundation, either version 3 of the License, or
354+# (at your option) any later version.
355+#
356+# This program is distributed in the hope that it will be useful,
357+# but WITHOUT ANY WARRANTY; without even the implied warranty of
358+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
359+# GNU General Public License for more details.
360+#
361+# You should have received a copy of the GNU General Public License
362+# along with this program. If not, see <http://www.gnu.org/licenses/>.
363+#
364+##############################################################################
365+'''Extend model stock.picking'''
366+from openerp.osv import orm
367+
368+
369+class StockPicking(orm.Model):
370+ '''Modify stock picking to fill delivery address'''
371+ _inherit = 'stock.picking'
372+
373+ def _prepare_invoice(
374+ self, cr, uid, picking, partner, inv_type, journal_id, context=None):
375+ """\
376+Inherit the original function of the 'stock' module in order to fill delivery
377+address when present in sales order.
378+"""
379+ invoice_vals = super(StockPicking, self)._prepare_invoice(
380+ cr, uid, picking, partner, inv_type, journal_id, context=context)
381+ if picking.sale_id and picking.sale_id.partner_shipping_id:
382+ invoice_vals['partner_shipping_id'] = (
383+ picking.sale_id.partner_shipping_id.id)
384+ return invoice_vals
385+
386
387=== added directory 'account_invoice_delivery_address/report'
388=== added file 'account_invoice_delivery_address/report/__init__.py'
389--- account_invoice_delivery_address/report/__init__.py 1970-01-01 00:00:00 +0000
390+++ account_invoice_delivery_address/report/__init__.py 2014-02-24 12:36:01 +0000
391@@ -0,0 +1,21 @@
392+# -*- coding: utf-8 -*-
393+##############################################################################
394+#
395+# OpenERP, Open Source Management Solution
396+# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
397+#
398+# This program is free software: you can redistribute it and/or modify
399+# it under the terms of the GNU Affero General Public License as
400+# published by the Free Software Foundation, either version 3 of the
401+# License, or (at your option) any later version.
402+#
403+# This program is distributed in the hope that it will be useful,
404+# but WITHOUT ANY WARRANTY; without even the implied warranty of
405+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
406+# GNU Affero General Public License for more details.
407+#
408+# You should have received a copy of the GNU Affero General Public License
409+# along with this program. If not, see <http://www.gnu.org/licenses/>.
410+#
411+##############################################################################
412+
413
414=== added file 'account_invoice_delivery_address/report/account_print_invoice.rml'
415--- account_invoice_delivery_address/report/account_print_invoice.rml 1970-01-01 00:00:00 +0000
416+++ account_invoice_delivery_address/report/account_print_invoice.rml 2014-02-24 12:36:01 +0000
417@@ -0,0 +1,383 @@
418+<?xml version="1.0"?>
419+<document filename="Invoices.pdf">
420+ <template title="Invoices" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
421+ <pageTemplate id="first">
422+ <frame id="first" x1="34.0" y1="28.0" width="530" height="786"/>
423+ </pageTemplate>
424+ </template>
425+ <stylesheet>
426+ <blockTableStyle id="Standard_Outline">
427+ <blockAlignment value="LEFT"/>
428+ <blockValign value="TOP"/>
429+ </blockTableStyle>
430+ <blockTableStyle id="Table_Partner_Address">
431+ <blockAlignment value="LEFT"/>
432+ <blockValign value="TOP"/>
433+ </blockTableStyle>
434+ <blockTableStyle id="Table_Invoice_General_Header">
435+ <blockAlignment value="LEFT"/>
436+ <blockValign value="TOP"/>
437+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
438+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
439+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
440+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
441+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
442+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
443+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
444+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
445+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
446+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
447+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
448+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
449+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
450+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
451+ </blockTableStyle>
452+ <blockTableStyle id="Table_General_Detail_Content">
453+ <blockAlignment value="LEFT"/>
454+ <blockValign value="TOP"/>
455+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
456+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
457+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
458+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
459+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
460+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
461+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
462+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
463+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
464+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
465+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
466+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
467+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
468+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
469+ </blockTableStyle>
470+ <blockTableStyle id="Table7">
471+ <blockAlignment value="LEFT"/>
472+ <blockValign value="TOP"/>
473+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
474+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
475+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
476+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
477+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
478+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
479+ </blockTableStyle>
480+ <blockTableStyle id="Table8">
481+ <blockAlignment value="LEFT"/>
482+ <blockValign value="TOP"/>
483+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
484+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
485+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
486+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
487+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
488+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
489+ </blockTableStyle>
490+ <blockTableStyle id="Table10">
491+ <blockAlignment value="LEFT"/>
492+ <blockValign value="TOP"/>
493+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
494+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
495+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
496+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
497+ </blockTableStyle>
498+ <blockTableStyle id="Table9">
499+ <blockAlignment value="LEFT"/>
500+ <blockValign value="TOP"/>
501+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
502+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
503+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
504+ </blockTableStyle>
505+ <blockTableStyle id="Table2">
506+ <blockAlignment value="LEFT"/>
507+ <blockValign value="TOP"/>
508+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
509+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
510+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
511+ </blockTableStyle>
512+ <blockTableStyle id="Table1">
513+ <blockAlignment value="LEFT"/>
514+ <blockValign value="TOP"/>
515+ </blockTableStyle>
516+ <initialize>
517+ <paraStyle name="all" alignment="justify"/>
518+ </initialize>
519+ <paraStyle name="Standard"/>
520+ <paraStyle name="Text body" spaceBefore="0.0" spaceAfter="6.0"/>
521+ <paraStyle name="List" spaceBefore="0.0" spaceAfter="6.0"/>
522+ <paraStyle name="Table Contents" spaceBefore="0.0" spaceAfter="6.0"/>
523+ <paraStyle name="Caption" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
524+ <paraStyle name="Index"/>
525+
526+ <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
527+ <paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
528+ <paraStyle name="Footer"/>
529+ <paraStyle name="Horizontal Line" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
530+
531+ <paraStyle name="terp_tblheader_General" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
532+ <paraStyle name="terp_tblheader_Details" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
533+ <paraStyle name="terp_tblheader_General_Centre" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
534+ <paraStyle name="terp_tblheader_General_Right" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
535+ <paraStyle name="terp_tblheader_Details_Centre" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
536+ <paraStyle name="terp_tblheader_Details_Right" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
537+
538+ <paraStyle name="terp_default_Right_8" rightIndent="0.0" leftIndent="0.0" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
539+ <paraStyle name="terp_default_Centre_8" rightIndent="0.0" leftIndent="0.0" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
540+ <paraStyle name="terp_default_address" rightIndent="0.0" leftIndent="0.0" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
541+ <paraStyle name="terp_default_9" rightIndent="0.0" leftIndent="0.0" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
542+ <paraStyle name="terp_default_Bold_9" rightIndent="0.0" leftIndent="-3.0" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
543+ <paraStyle name="terp_default_Centre_9" rightIndent="0.0" leftIndent="0.0" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
544+ <paraStyle name="terp_default_Right_9" rightIndent="0.0" leftIndent="0.0" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
545+ <paraStyle name="terp_default_Bold_Right_9" rightIndent="0.0" leftIndent="-3.0" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
546+ <paraStyle name="terp_default_2" rightIndent="0.0" leftIndent="0.0" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
547+ <paraStyle name="terp_default_White_2" rightIndent="0.0" leftIndent="0.0" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#ffffff"/>
548+
549+ <paraStyle name="Table" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
550+ <paraStyle name="User Index 10" rightIndent="0.0" leftIndent="127.0"/>
551+ <paraStyle name="Preformatted Text" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
552+ <images/>
553+ </stylesheet>
554+ <story>
555+ <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
556+ <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
557+
558+<!-- START of modification for delivery address -->
559+ <blockTable colWidths="233.0,64.0,233.0" style="Table_Partner_Address">
560+ <tr>
561+ <td>
562+ <para style="terp_default_Bold_9"
563+ ><b>Shipping address : [[ (o.partner_shipping_id and ' ') or removeParentNode('para') ]] </b></para>
564+ <para style="terp_default_9">[[ (o.partner_shipping_id and o.partner_id.title and o.partner_shipping_id.title.name) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.name) or '' ]]</para>
565+ <para style="terp_default_9">[[ o.partner_shipping_id and display_address(o.partner_shipping_id) ]]</para>
566+ </td>
567+<!-- END of modification for delivery address -->
568+
569+ <td>
570+ <para style="terp_default_8">
571+ <font color="white"> </font>
572+ </para>
573+ </td>
574+ <td>
575+ <para style="terp_default_8">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
576+ <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
577+ <para style="terp_default_8">
578+ <font color="white"> </font>
579+ </para>
580+ <para style="terp_default_8">Tel. : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para>
581+ <para style="terp_default_8">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para>
582+ <para style="terp_default_8">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>
583+ </td>
584+ </tr>
585+ </blockTable>
586+ <para style="terp_header"><b>Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
587+ <para style="terp_header"><b>PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma2') or removeParentNode('para')) and '' ]]</b></para>
588+ <para style="terp_header"><b>Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</b></para>
589+ <para style="terp_header"><b>Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
590+ <para style="terp_header"><b>Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
591+ <para style="terp_header"><b>Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
592+ <para style="terp_header"><b>Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
593+ <para style="terp_default_8">
594+ <font color="white"> </font>
595+ </para>
596+ <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
597+ <tr>
598+ <td>
599+ <para style="terp_tblheader_General_Centre"><b>Description</b></para>
600+ </td>
601+ <td>
602+ <para style="terp_tblheader_General_Centre"><b>Invoice Date</b></para>
603+ </td>
604+ <td>
605+ <para style="terp_tblheader_General_Centre"><b>Source</b></para>
606+ </td>
607+ <td>
608+ <para style="terp_tblheader_General_Centre"><b>Customer Code</b></para>
609+ </td>
610+ </tr>
611+ </blockTable>
612+ <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
613+ <tr>
614+ <td>
615+ <para style="terp_default_Centre_9">[[ o.name or ' ' ]]</para>
616+ </td>
617+ <td>
618+ <para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
619+ </td>
620+ <td>
621+ <para style="terp_default_Centre_9">[[ o.origin or '' ]]</para>
622+ </td>
623+ <td>
624+ <para style="terp_default_Centre_9">[[ (o.partner_id.ref) or ' ' ]]</para>
625+ </td>
626+ </tr>
627+ </blockTable>
628+ <para style="terp_default_8">
629+ <font color="white"> </font>
630+ </para>
631+ <pto>
632+ <pto_header>
633+ <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7">
634+ <tr>
635+ <td> <para style="terp_tblheader_Details">Description</para> </td>
636+ <td> <para style="terp_tblheader_Details_Centre">Taxes</para> </td>
637+ <td> <para style="terp_tblheader_Details_Centre">Quantity</para> </td>
638+ <td> <para style="terp_tblheader_Details_Right">Unit Price </para> </td>
639+ <td> <para style="terp_tblheader_Details_Right">Disc.(%)</para> </td>
640+ <td> <para style="terp_tblheader_Details_Right">Price</para> </td>
641+ </tr>
642+ </blockTable>
643+ </pto_header>
644+ <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7">
645+ <tr>
646+ <td>
647+ <para style="terp_tblheader_General"><b>Description</b></para>
648+ </td>
649+ <td>
650+ <para style="terp_tblheader_General_Centre"><b>Taxes</b></para>
651+ </td>
652+ <td>
653+ <para style="terp_tblheader_General_Right"><b>Quantity</b></para>
654+ </td>
655+ <td>
656+ <para style="terp_tblheader_General_Right"><b>Unit Price</b></para>
657+ </td>
658+ <td>
659+ <para style="terp_tblheader_General_Right"><b>Disc.(%)</b></para>
660+ </td>
661+ <td>
662+ <para style="terp_tblheader_General_Right"><b>Price</b></para>
663+ </td>
664+ </tr>
665+ </blockTable>
666+ <section>
667+ <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
668+ <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table8">
669+ <tr>
670+ <td>
671+ <para style="terp_default_9">[[ format(l.name) ]]</para>
672+ </td>
673+ <td>
674+ <para style="terp_default_Centre_9">[[ ', '.join([ lt.name or '' for lt in l.invoice_line_tax_id ]) ]]</para>
675+ </td>
676+ <td>
677+ <para style="terp_default_Right_9">[[ formatLang(l.quantity)]] [[ (l.uos_id and l.uos_id.name) or '' ]]</para>
678+ </td>
679+ <td>
680+ <para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]]</para>
681+ </td>
682+ <td>
683+ <para style="terp_default_Centre_9">[[ formatLang(l.discount, dp='Account') ]] </para>
684+ </td>
685+ <td>
686+ <para style="terp_default_Right_9">[[ formatLang(l.price_subtotal, dp='Account', currency_obj=o.currency_id) ]]</para>
687+ </td>
688+ </tr>
689+ </blockTable>
690+ </section>
691+ </pto>
692+ <blockTable colWidths="385.0,60.0,85.0" style="Table10">
693+ <tr>
694+ <td>
695+ <para style="terp_default_8">
696+ <font color="white"> </font>
697+ </para>
698+ </td>
699+ <td>
700+ <para style="terp_default_9">Net Total:</para>
701+ </td>
702+ <td>
703+ <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
704+ </td>
705+ </tr>
706+ <tr>
707+ <td>
708+ <para style="terp_default_8">
709+ <font color="white"> </font>
710+ </para>
711+ </td>
712+ <td>
713+ <para style="terp_default_9">Taxes:</para>
714+ </td>
715+ <td>
716+ <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, dp='Account', currency_obj=o.currency_id) ]]</para>
717+ </td>
718+ </tr>
719+ <tr>
720+ <td>
721+ <para style="terp_default_8">
722+ <font color="white"> </font>
723+ </para>
724+ </td>
725+ <td>
726+ <para style="terp_default_9"><b>Total:</b></para>
727+ </td>
728+ <td>
729+ <para style="terp_default_Bold_Right_9"><b>[[ formatLang(o.amount_total, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</b></para>
730+ </td>
731+ </tr>
732+ </blockTable>
733+ <para style="Text body">
734+ <font color="white"> </font>
735+ </para>
736+ <blockTable colWidths="205.0,71.0,71.0,183.0" style="Table9">
737+ <tr>
738+ <td>
739+ <para style="terp_tblheader_Details"><b>Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]</b></para>
740+ </td>
741+ <td>
742+ <para style="terp_tblheader_Details_Right"><b>Base </b></para>
743+ </td>
744+ <td>
745+ <para style="terp_tblheader_Details_Right"><b>Amount </b></para>
746+ </td>
747+ <td>
748+ <para style="terp_default_8">
749+ <font color="white"> </font>
750+ </para>
751+ </td>
752+ </tr>
753+ </blockTable>
754+ <section>
755+ <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
756+ <blockTable colWidths="205.0,71.0,71.0,184.0" style="Table2">
757+ <tr>
758+ <td>
759+ <para style="terp_default_8">[[ t.name ]]</para>
760+ </td>
761+ <td>
762+ <para style="terp_default_Right_8">[[ formatLang(t.base, dp='Account', currency_obj=o.currency_id) ]]</para>
763+ </td>
764+ <td>
765+ <para style="terp_default_Right_8">[[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
766+ </td>
767+ <td>
768+ <para style="terp_default_8">
769+ <font color="white"> </font>
770+ </para>
771+ </td>
772+ </tr>
773+ </blockTable>
774+ </section>
775+ <para style="terp_default_9">
776+ <font color="white"> </font>
777+ </para>
778+ <para style="terp_default_9">[[ (o.comment and format(o.comment )) or removeParentNode('para') ]]</para>
779+ <para style="terp_default_8">
780+ <font color="white"> </font>
781+ </para>
782+ <para style="terp_default_9">[[ (o.payment_term and o.payment_term.note and format(o.payment_term and o.payment_term.note)) or removeParentNode('para') ]]</para>
783+ <para style="terp_default_9">
784+ <font color="white"> </font>
785+ </para>
786+ <blockTable colWidths="120.0,410.0" style="Table1">
787+ <tr>
788+ <td>
789+ <para style="terp_default_Bold_9"><b>Fiscal Position Remark : </b></para>
790+ </td>
791+ <td>
792+ <para style="terp_default_9">[[ (o.fiscal_position and o.fiscal_position.note and format(o.fiscal_position.note)) or removeParentNode('blockTable') ]]</para>
793+ </td>
794+ </tr>
795+ </blockTable>
796+ <para style="terp_default_2">
797+ <font color="white"> </font>
798+ </para>
799+ </story>
800+</document>
801
802=== added file 'account_invoice_delivery_address/report/account_print_invoice.xml'
803--- account_invoice_delivery_address/report/account_print_invoice.xml 1970-01-01 00:00:00 +0000
804+++ account_invoice_delivery_address/report/account_print_invoice.xml 2014-02-24 12:36:01 +0000
805@@ -0,0 +1,13 @@
806+<?xml version="1.0" encoding="utf-8"?>
807+<openerp>
808+ <data>
809+
810+ <!-- Unfortunately only a full replace of the rml is possible at this time -->
811+ <record
812+ id="account.account_invoices"
813+ model="ir.actions.report.xml">
814+ <field name="report_rml"
815+ >account_invoice_delivery_address/report/account_print_invoice.rml</field>
816+ </record>
817+ </data>
818+</openerp>
819
820=== added directory 'account_invoice_delivery_address/view'
821=== added file 'account_invoice_delivery_address/view/account_invoice.xml'
822--- account_invoice_delivery_address/view/account_invoice.xml 1970-01-01 00:00:00 +0000
823+++ account_invoice_delivery_address/view/account_invoice.xml 2014-02-24 12:36:01 +0000
824@@ -0,0 +1,26 @@
825+<?xml version="1.0" encoding="UTF-8"?>
826+<openerp>
827+ <data>
828+ <!-- Add delivery address to invoice form -->
829+ <record id="form_invoice_delivery_address" model="ir.ui.view">
830+ <field name="name">account.invoice.delivery.address</field>
831+ <field name="model">account.invoice</field>
832+ <field name="inherit_id" ref="account.invoice_form"/>
833+ <field name="arch" type="xml">
834+ <field
835+ name="account_id"
836+ position="after">
837+ <field
838+ name="commercial_partner_id"
839+ invisible="1"
840+ />
841+ <field
842+ name="partner_shipping_id"
843+ domain="[('parent_id','=',commercial_partner_id),]"
844+ context="{'default_type':'delivery'}"/>
845+ </field>
846+ </field>
847+ </record>
848+ </data>
849+</openerp>
850+

Subscribers

People subscribed via source and target branches