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