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
=== added directory 'account_invoice_delivery_address'
=== added file 'account_invoice_delivery_address/__init__.py'
--- account_invoice_delivery_address/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_delivery_address/__init__.py 2014-02-24 12:36:01 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21from . import model
22from . import report
23
024
=== added file 'account_invoice_delivery_address/__openerp__.py'
--- account_invoice_delivery_address/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_delivery_address/__openerp__.py 2014-02-24 12:36:01 +0000
@@ -0,0 +1,48 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21{
22 "name" : "Account invoice delivery address",
23 "version" : "1.0",
24 "author" : "Therp BV",
25 "complexity": "normal",
26 "description": """
27Adds delivery address to the invoice. Also makes sure delivery address is
28filled from default delivery address, or taken from sales order. Delivery
29address might also be changed untill invoice is confirmed.
30 """,
31 "category" : "",
32 "depends" : [
33 'account',
34 'sale_stock',
35 ],
36 "data" : [
37 'report/account_print_invoice.xml',
38 'view/account_invoice.xml',
39 ],
40 "js": [
41 ],
42 "css": [
43 ],
44 "qweb": [
45 ],
46 "auto_install": False,
47 "installable": True,
48}
049
=== added directory 'account_invoice_delivery_address/i18n'
=== added file 'account_invoice_delivery_address/i18n/account_invoice_delivery_address.pot'
--- account_invoice_delivery_address/i18n/account_invoice_delivery_address.pot 1970-01-01 00:00:00 +0000
+++ account_invoice_delivery_address/i18n/account_invoice_delivery_address.pot 2014-02-24 12:36:01 +0000
@@ -0,0 +1,42 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * account_invoice_delivery_address
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2014-02-24 11:00+0000\n"
10"PO-Revision-Date: 2014-02-24 11:00+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: account_invoice_delivery_address
19#: model:ir.model,name:account_invoice_delivery_address.model_sale_order
20msgid "Sales Order"
21msgstr "Sales Order"
22
23#. module: account_invoice_delivery_address
24#: model:ir.model,name:account_invoice_delivery_address.model_account_invoice
25msgid "Invoice"
26msgstr "Invoice"
27
28#. module: account_invoice_delivery_address
29#: model:ir.model,name:account_invoice_delivery_address.model_stock_picking
30msgid "Picking List"
31msgstr "Picking List"
32
33#. module: account
34#: field:account.invoice,partner_shipping_id:0
35msgid "Delivery address"
36msgstr ""
37
38#. module: account
39#: report:account.invoice:0
40msgid "Shipping address :"
41msgstr ""
42
043
=== added file 'account_invoice_delivery_address/i18n/nl.po'
--- account_invoice_delivery_address/i18n/nl.po 1970-01-01 00:00:00 +0000
+++ account_invoice_delivery_address/i18n/nl.po 2014-02-24 12:36:01 +0000
@@ -0,0 +1,42 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * account_invoice_delivery_address
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2014-02-24 11:00+0000\n"
10"PO-Revision-Date: 2014-02-24 11:00+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: account_invoice_delivery_address
19#: model:ir.model,name:account_invoice_delivery_address.model_account_invoice
20msgid "Invoice"
21msgstr "Factuur"
22
23#. module: account_invoice_delivery_address
24#: model:ir.model,name:account_invoice_delivery_address.model_stock_picking
25msgid "Picking List"
26msgstr "Pakbon"
27
28#. module: account_invoice_delivery_address
29#: model:ir.model,name:account_invoice_delivery_address.model_sale_order
30msgid "Sales Order"
31msgstr "Verkooporder"
32
33#. module: account
34#: field:account.invoice,partner_shipping_id:0
35msgid "Delivery address"
36msgstr "Afleveradres"
37
38#. module: account
39#: report:account.invoice:0
40msgid "Shipping address :"
41msgstr "Afleveradres :"
42
043
=== added directory 'account_invoice_delivery_address/model'
=== added file 'account_invoice_delivery_address/model/__init__.py'
--- account_invoice_delivery_address/model/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_delivery_address/model/__init__.py 2014-02-24 12:36:01 +0000
@@ -0,0 +1,24 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21from . import account_invoice
22from . import sale_order
23from . import stock_picking
24
025
=== added file 'account_invoice_delivery_address/model/account_invoice.py'
--- account_invoice_delivery_address/model/account_invoice.py 1970-01-01 00:00:00 +0000
+++ account_invoice_delivery_address/model/account_invoice.py 2014-02-24 12:36:01 +0000
@@ -0,0 +1,81 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module Copyright (C) 2014 Therp BV (<http://therp.nl>).
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22'''Extend model account.invoice'''
23from openerp.osv import orm, fields
24
25
26class AccountInvoice(orm.Model):
27 '''Modify account invoice to add delivery address'''
28 _inherit = 'account.invoice'
29
30 def _modify_vals(self, cr, uid, vals, browse_obj=None, context=None):
31 '''Utility function called on create and write to deliver consistent
32 values. In this case fill delivery address when possible.'''
33 if 'partner_shipping_id' in vals:
34 return # do not overwrite when explicitly filled
35 partner_id = False
36 if browse_obj:
37 # Do nothing when invoice no longer in draft or sent state
38 # or when shipping id already set:
39 if (not browse_obj.state in ['draft', 'sent']
40 or browse_obj.partner_shipping_id):
41 return
42 partner_id = (
43 browse_obj.partner_id and browse_obj.partner_id.id or False)
44 else:
45 partner_id = vals.get('partner_id') or False
46 if not partner_id:
47 return
48 # We have a partner, find delivery address
49 partner_model = self.pool.get('res.partner')
50 addr = partner_model.address_get(
51 cr, uid, [partner_id], ['delivery'])
52 vals['partner_shipping_id'] = addr['delivery']
53
54 def create(self, cr, uid, vals, context=None):
55 '''get delivery address, when not already in vals'''
56 self._modify_vals(cr, uid, vals, browse_obj=None, context=context)
57 return super(AccountInvoice, self).create(
58 cr, uid, vals, context)
59
60 def write(self, cr, uid, ids, vals, context=None):
61 '''get delivery address, when not already in vals, or filled'''
62 for item_id in ids:
63 browse_records = self.browse(cr, uid, [item_id], context=context)
64 browse_obj = browse_records[0]
65 self._modify_vals(
66 cr, uid, vals, browse_obj=browse_obj, context=context)
67 super(AccountInvoice, self).write(
68 cr, uid, [item_id], vals, context=context)
69 return True
70
71 _columns = {
72 'partner_shipping_id': fields.many2one(
73 'res.partner', 'Delivery Address',
74 readonly=True,
75 states={
76 'draft': [('readonly', False)],
77 'sent': [('readonly', False)]
78 },
79 help="Delivery address for current invoice."),
80 }
81
082
=== added file 'account_invoice_delivery_address/model/sale_order.py'
--- account_invoice_delivery_address/model/sale_order.py 1970-01-01 00:00:00 +0000
+++ account_invoice_delivery_address/model/sale_order.py 2014-02-24 12:36:01 +0000
@@ -0,0 +1,41 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module Copyright (C) 2014 Therp BV (<http://therp.nl>).
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22'''Extend model sale.order'''
23from openerp.osv import orm
24
25
26class SaleOrder(orm.Model):
27 '''Modify sale order to fill delivery address'''
28 _inherit = 'sale.order'
29
30 def _prepare_invoice(
31 self, cr, uid, order, lines, context=None):
32 """\
33Inherit the original function of the 'sale' module in order to fill delivery
34address when present in sales order.
35"""
36 invoice_vals = super(SaleOrder, self)._prepare_invoice(
37 cr, uid, order, lines, context=context)
38 if order.partner_shipping_id:
39 invoice_vals['partner_shipping_id'] = order.partner_shipping_id.id
40 return invoice_vals
41
042
=== added file 'account_invoice_delivery_address/model/stock_picking.py'
--- account_invoice_delivery_address/model/stock_picking.py 1970-01-01 00:00:00 +0000
+++ account_invoice_delivery_address/model/stock_picking.py 2014-02-24 12:36:01 +0000
@@ -0,0 +1,42 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module Copyright (C) 2014 Therp BV (<http://therp.nl>).
6# All Rights Reserved
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22'''Extend model stock.picking'''
23from openerp.osv import orm
24
25
26class StockPicking(orm.Model):
27 '''Modify stock picking to fill delivery address'''
28 _inherit = 'stock.picking'
29
30 def _prepare_invoice(
31 self, cr, uid, picking, partner, inv_type, journal_id, context=None):
32 """\
33Inherit the original function of the 'stock' module in order to fill delivery
34address when present in sales order.
35"""
36 invoice_vals = super(StockPicking, self)._prepare_invoice(
37 cr, uid, picking, partner, inv_type, journal_id, context=context)
38 if picking.sale_id and picking.sale_id.partner_shipping_id:
39 invoice_vals['partner_shipping_id'] = (
40 picking.sale_id.partner_shipping_id.id)
41 return invoice_vals
42
043
=== added directory 'account_invoice_delivery_address/report'
=== added file 'account_invoice_delivery_address/report/__init__.py'
--- account_invoice_delivery_address/report/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_delivery_address/report/__init__.py 2014-02-24 12:36:01 +0000
@@ -0,0 +1,21 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
022
=== added file 'account_invoice_delivery_address/report/account_print_invoice.rml'
--- account_invoice_delivery_address/report/account_print_invoice.rml 1970-01-01 00:00:00 +0000
+++ account_invoice_delivery_address/report/account_print_invoice.rml 2014-02-24 12:36:01 +0000
@@ -0,0 +1,383 @@
1<?xml version="1.0"?>
2<document filename="Invoices.pdf">
3 <template title="Invoices" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
4 <pageTemplate id="first">
5 <frame id="first" x1="34.0" y1="28.0" width="530" height="786"/>
6 </pageTemplate>
7 </template>
8 <stylesheet>
9 <blockTableStyle id="Standard_Outline">
10 <blockAlignment value="LEFT"/>
11 <blockValign value="TOP"/>
12 </blockTableStyle>
13 <blockTableStyle id="Table_Partner_Address">
14 <blockAlignment value="LEFT"/>
15 <blockValign value="TOP"/>
16 </blockTableStyle>
17 <blockTableStyle id="Table_Invoice_General_Header">
18 <blockAlignment value="LEFT"/>
19 <blockValign value="TOP"/>
20 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
21 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
22 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
23 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
24 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
25 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
26 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
27 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
28 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
29 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
30 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
31 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
32 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
33 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
34 </blockTableStyle>
35 <blockTableStyle id="Table_General_Detail_Content">
36 <blockAlignment value="LEFT"/>
37 <blockValign value="TOP"/>
38 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
39 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
40 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
41 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
42 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
43 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
44 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
45 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
46 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
47 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
48 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
49 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
50 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
51 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
52 </blockTableStyle>
53 <blockTableStyle id="Table7">
54 <blockAlignment value="LEFT"/>
55 <blockValign value="TOP"/>
56 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
57 <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
58 <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
59 <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
60 <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
61 <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
62 </blockTableStyle>
63 <blockTableStyle id="Table8">
64 <blockAlignment value="LEFT"/>
65 <blockValign value="TOP"/>
66 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
67 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
68 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
69 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
70 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
71 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
72 </blockTableStyle>
73 <blockTableStyle id="Table10">
74 <blockAlignment value="LEFT"/>
75 <blockValign value="TOP"/>
76 <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
77 <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
78 <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
79 <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
80 </blockTableStyle>
81 <blockTableStyle id="Table9">
82 <blockAlignment value="LEFT"/>
83 <blockValign value="TOP"/>
84 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
85 <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
86 <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
87 </blockTableStyle>
88 <blockTableStyle id="Table2">
89 <blockAlignment value="LEFT"/>
90 <blockValign value="TOP"/>
91 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
92 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
93 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
94 </blockTableStyle>
95 <blockTableStyle id="Table1">
96 <blockAlignment value="LEFT"/>
97 <blockValign value="TOP"/>
98 </blockTableStyle>
99 <initialize>
100 <paraStyle name="all" alignment="justify"/>
101 </initialize>
102 <paraStyle name="Standard"/>
103 <paraStyle name="Text body" spaceBefore="0.0" spaceAfter="6.0"/>
104 <paraStyle name="List" spaceBefore="0.0" spaceAfter="6.0"/>
105 <paraStyle name="Table Contents" spaceBefore="0.0" spaceAfter="6.0"/>
106 <paraStyle name="Caption" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
107 <paraStyle name="Index"/>
108
109 <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
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"/>
111 <paraStyle name="Footer"/>
112 <paraStyle name="Horizontal Line" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
113
114 <paraStyle name="terp_tblheader_General" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
115 <paraStyle name="terp_tblheader_Details" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
116 <paraStyle name="terp_tblheader_General_Centre" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
117 <paraStyle name="terp_tblheader_General_Right" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
118 <paraStyle name="terp_tblheader_Details_Centre" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
119 <paraStyle name="terp_tblheader_Details_Right" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
120
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"/>
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"/>
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"/>
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"/>
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"/>
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"/>
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"/>
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"/>
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"/>
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"/>
131
132 <paraStyle name="Table" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
133 <paraStyle name="User Index 10" rightIndent="0.0" leftIndent="127.0"/>
134 <paraStyle name="Preformatted Text" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
135 <images/>
136 </stylesheet>
137 <story>
138 <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
139 <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
140
141<!-- START of modification for delivery address -->
142 <blockTable colWidths="233.0,64.0,233.0" style="Table_Partner_Address">
143 <tr>
144 <td>
145 <para style="terp_default_Bold_9"
146 ><b>Shipping address : [[ (o.partner_shipping_id and ' ') or removeParentNode('para') ]] </b></para>
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>
148 <para style="terp_default_9">[[ o.partner_shipping_id and display_address(o.partner_shipping_id) ]]</para>
149 </td>
150<!-- END of modification for delivery address -->
151
152 <td>
153 <para style="terp_default_8">
154 <font color="white"> </font>
155 </para>
156 </td>
157 <td>
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>
159 <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
160 <para style="terp_default_8">
161 <font color="white"> </font>
162 </para>
163 <para style="terp_default_8">Tel. : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para>
164 <para style="terp_default_8">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para>
165 <para style="terp_default_8">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>
166 </td>
167 </tr>
168 </blockTable>
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>
170 <para style="terp_header"><b>PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma2') or removeParentNode('para')) and '' ]]</b></para>
171 <para style="terp_header"><b>Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</b></para>
172 <para style="terp_header"><b>Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
173 <para style="terp_header"><b>Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
174 <para style="terp_header"><b>Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
175 <para style="terp_header"><b>Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
176 <para style="terp_default_8">
177 <font color="white"> </font>
178 </para>
179 <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
180 <tr>
181 <td>
182 <para style="terp_tblheader_General_Centre"><b>Description</b></para>
183 </td>
184 <td>
185 <para style="terp_tblheader_General_Centre"><b>Invoice Date</b></para>
186 </td>
187 <td>
188 <para style="terp_tblheader_General_Centre"><b>Source</b></para>
189 </td>
190 <td>
191 <para style="terp_tblheader_General_Centre"><b>Customer Code</b></para>
192 </td>
193 </tr>
194 </blockTable>
195 <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
196 <tr>
197 <td>
198 <para style="terp_default_Centre_9">[[ o.name or ' ' ]]</para>
199 </td>
200 <td>
201 <para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
202 </td>
203 <td>
204 <para style="terp_default_Centre_9">[[ o.origin or '' ]]</para>
205 </td>
206 <td>
207 <para style="terp_default_Centre_9">[[ (o.partner_id.ref) or ' ' ]]</para>
208 </td>
209 </tr>
210 </blockTable>
211 <para style="terp_default_8">
212 <font color="white"> </font>
213 </para>
214 <pto>
215 <pto_header>
216 <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7">
217 <tr>
218 <td> <para style="terp_tblheader_Details">Description</para> </td>
219 <td> <para style="terp_tblheader_Details_Centre">Taxes</para> </td>
220 <td> <para style="terp_tblheader_Details_Centre">Quantity</para> </td>
221 <td> <para style="terp_tblheader_Details_Right">Unit Price </para> </td>
222 <td> <para style="terp_tblheader_Details_Right">Disc.(%)</para> </td>
223 <td> <para style="terp_tblheader_Details_Right">Price</para> </td>
224 </tr>
225 </blockTable>
226 </pto_header>
227 <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7">
228 <tr>
229 <td>
230 <para style="terp_tblheader_General"><b>Description</b></para>
231 </td>
232 <td>
233 <para style="terp_tblheader_General_Centre"><b>Taxes</b></para>
234 </td>
235 <td>
236 <para style="terp_tblheader_General_Right"><b>Quantity</b></para>
237 </td>
238 <td>
239 <para style="terp_tblheader_General_Right"><b>Unit Price</b></para>
240 </td>
241 <td>
242 <para style="terp_tblheader_General_Right"><b>Disc.(%)</b></para>
243 </td>
244 <td>
245 <para style="terp_tblheader_General_Right"><b>Price</b></para>
246 </td>
247 </tr>
248 </blockTable>
249 <section>
250 <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
251 <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table8">
252 <tr>
253 <td>
254 <para style="terp_default_9">[[ format(l.name) ]]</para>
255 </td>
256 <td>
257 <para style="terp_default_Centre_9">[[ ', '.join([ lt.name or '' for lt in l.invoice_line_tax_id ]) ]]</para>
258 </td>
259 <td>
260 <para style="terp_default_Right_9">[[ formatLang(l.quantity)]] [[ (l.uos_id and l.uos_id.name) or '' ]]</para>
261 </td>
262 <td>
263 <para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]]</para>
264 </td>
265 <td>
266 <para style="terp_default_Centre_9">[[ formatLang(l.discount, dp='Account') ]] </para>
267 </td>
268 <td>
269 <para style="terp_default_Right_9">[[ formatLang(l.price_subtotal, dp='Account', currency_obj=o.currency_id) ]]</para>
270 </td>
271 </tr>
272 </blockTable>
273 </section>
274 </pto>
275 <blockTable colWidths="385.0,60.0,85.0" style="Table10">
276 <tr>
277 <td>
278 <para style="terp_default_8">
279 <font color="white"> </font>
280 </para>
281 </td>
282 <td>
283 <para style="terp_default_9">Net Total:</para>
284 </td>
285 <td>
286 <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
287 </td>
288 </tr>
289 <tr>
290 <td>
291 <para style="terp_default_8">
292 <font color="white"> </font>
293 </para>
294 </td>
295 <td>
296 <para style="terp_default_9">Taxes:</para>
297 </td>
298 <td>
299 <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, dp='Account', currency_obj=o.currency_id) ]]</para>
300 </td>
301 </tr>
302 <tr>
303 <td>
304 <para style="terp_default_8">
305 <font color="white"> </font>
306 </para>
307 </td>
308 <td>
309 <para style="terp_default_9"><b>Total:</b></para>
310 </td>
311 <td>
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>
313 </td>
314 </tr>
315 </blockTable>
316 <para style="Text body">
317 <font color="white"> </font>
318 </para>
319 <blockTable colWidths="205.0,71.0,71.0,183.0" style="Table9">
320 <tr>
321 <td>
322 <para style="terp_tblheader_Details"><b>Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]</b></para>
323 </td>
324 <td>
325 <para style="terp_tblheader_Details_Right"><b>Base </b></para>
326 </td>
327 <td>
328 <para style="terp_tblheader_Details_Right"><b>Amount </b></para>
329 </td>
330 <td>
331 <para style="terp_default_8">
332 <font color="white"> </font>
333 </para>
334 </td>
335 </tr>
336 </blockTable>
337 <section>
338 <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
339 <blockTable colWidths="205.0,71.0,71.0,184.0" style="Table2">
340 <tr>
341 <td>
342 <para style="terp_default_8">[[ t.name ]]</para>
343 </td>
344 <td>
345 <para style="terp_default_Right_8">[[ formatLang(t.base, dp='Account', currency_obj=o.currency_id) ]]</para>
346 </td>
347 <td>
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>
349 </td>
350 <td>
351 <para style="terp_default_8">
352 <font color="white"> </font>
353 </para>
354 </td>
355 </tr>
356 </blockTable>
357 </section>
358 <para style="terp_default_9">
359 <font color="white"> </font>
360 </para>
361 <para style="terp_default_9">[[ (o.comment and format(o.comment )) or removeParentNode('para') ]]</para>
362 <para style="terp_default_8">
363 <font color="white"> </font>
364 </para>
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>
366 <para style="terp_default_9">
367 <font color="white"> </font>
368 </para>
369 <blockTable colWidths="120.0,410.0" style="Table1">
370 <tr>
371 <td>
372 <para style="terp_default_Bold_9"><b>Fiscal Position Remark : </b></para>
373 </td>
374 <td>
375 <para style="terp_default_9">[[ (o.fiscal_position and o.fiscal_position.note and format(o.fiscal_position.note)) or removeParentNode('blockTable') ]]</para>
376 </td>
377 </tr>
378 </blockTable>
379 <para style="terp_default_2">
380 <font color="white"> </font>
381 </para>
382 </story>
383</document>
0384
=== added file 'account_invoice_delivery_address/report/account_print_invoice.xml'
--- account_invoice_delivery_address/report/account_print_invoice.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_delivery_address/report/account_print_invoice.xml 2014-02-24 12:36:01 +0000
@@ -0,0 +1,13 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <!-- Unfortunately only a full replace of the rml is possible at this time -->
6 <record
7 id="account.account_invoices"
8 model="ir.actions.report.xml">
9 <field name="report_rml"
10 >account_invoice_delivery_address/report/account_print_invoice.rml</field>
11 </record>
12 </data>
13</openerp>
014
=== added directory 'account_invoice_delivery_address/view'
=== added file 'account_invoice_delivery_address/view/account_invoice.xml'
--- account_invoice_delivery_address/view/account_invoice.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_delivery_address/view/account_invoice.xml 2014-02-24 12:36:01 +0000
@@ -0,0 +1,26 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4 <!-- Add delivery address to invoice form -->
5 <record id="form_invoice_delivery_address" model="ir.ui.view">
6 <field name="name">account.invoice.delivery.address</field>
7 <field name="model">account.invoice</field>
8 <field name="inherit_id" ref="account.invoice_form"/>
9 <field name="arch" type="xml">
10 <field
11 name="account_id"
12 position="after">
13 <field
14 name="commercial_partner_id"
15 invisible="1"
16 />
17 <field
18 name="partner_shipping_id"
19 domain="[('parent_id','=',commercial_partner_id),]"
20 context="{'default_type':'delivery'}"/>
21 </field>
22 </field>
23 </record>
24 </data>
25</openerp>
26

Subscribers

People subscribed via source and target branches