openerp-community-reviewer team mailing list archive
-
openerp-community-reviewer team
-
Mailing list archive
-
Message #04019
[Merge] lp:~therp-nl/account-invoice-report/account-invoice-report-7.0_delivery_address into lp:account-invoice-report
Ronald Portier (Therp) has proposed merging lp:~therp-nl/account-invoice-report/account-invoice-report-7.0_delivery_address into lp:account-invoice-report.
Requested reviews:
Account Core Editors (account-core-editors)
For more details, see:
https://code.launchpad.net/~therp-nl/account-invoice-report/account-invoice-report-7.0_delivery_address/+merge/207915
Adds delivery address / shipping address to invoice.
Delivery address can be entered directly, or will be taken from partner or sales order.
--
https://code.launchpad.net/~therp-nl/account-invoice-report/account-invoice-report-7.0_delivery_address/+merge/207915
Your team OpenERP Community Reviewer/Maintainer is subscribed to branch lp:account-invoice-report.
=== 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 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import model
+from . import report
+
=== 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 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+{
+ "name" : "Account invoice delivery address",
+ "version" : "1.0",
+ "author" : "Therp BV",
+ "complexity": "normal",
+ "description": """
+Adds delivery address to the invoice. Also makes sure delivery address is
+filled from default delivery address, or taken from sales order. Delivery
+address might also be changed untill invoice is confirmed.
+ """,
+ "category" : "",
+ "depends" : [
+ 'account',
+ 'sale_stock',
+ ],
+ "data" : [
+ 'report/account_print_invoice.xml',
+ 'view/account_invoice.xml',
+ ],
+ "js": [
+ ],
+ "css": [
+ ],
+ "qweb": [
+ ],
+ "auto_install": False,
+ "installable": True,
+}
=== 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 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_invoice_delivery_address
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-02-24 11:00+0000\n"
+"PO-Revision-Date: 2014-02-24 11:00+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_invoice_delivery_address
+#: model:ir.model,name:account_invoice_delivery_address.model_sale_order
+msgid "Sales Order"
+msgstr "Sales Order"
+
+#. module: account_invoice_delivery_address
+#: model:ir.model,name:account_invoice_delivery_address.model_account_invoice
+msgid "Invoice"
+msgstr "Invoice"
+
+#. module: account_invoice_delivery_address
+#: model:ir.model,name:account_invoice_delivery_address.model_stock_picking
+msgid "Picking List"
+msgstr "Picking List"
+
+#. module: account
+#: field:account.invoice,partner_shipping_id:0
+msgid "Delivery address"
+msgstr ""
+
+#. module: account
+#: report:account.invoice:0
+msgid "Shipping address :"
+msgstr ""
+
=== 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 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_invoice_delivery_address
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-02-24 11:00+0000\n"
+"PO-Revision-Date: 2014-02-24 11:00+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_invoice_delivery_address
+#: model:ir.model,name:account_invoice_delivery_address.model_account_invoice
+msgid "Invoice"
+msgstr "Factuur"
+
+#. module: account_invoice_delivery_address
+#: model:ir.model,name:account_invoice_delivery_address.model_stock_picking
+msgid "Picking List"
+msgstr "Pakbon"
+
+#. module: account_invoice_delivery_address
+#: model:ir.model,name:account_invoice_delivery_address.model_sale_order
+msgid "Sales Order"
+msgstr "Verkooporder"
+
+#. module: account
+#: field:account.invoice,partner_shipping_id:0
+msgid "Delivery address"
+msgstr "Afleveradres"
+
+#. module: account
+#: report:account.invoice:0
+msgid "Shipping address :"
+msgstr "Afleveradres :"
+
=== 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 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import account_invoice
+from . import sale_order
+from . import stock_picking
+
=== 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 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module Copyright (C) 2014 Therp BV (<http://therp.nl>).
+# All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+'''Extend model account.invoice'''
+from openerp.osv import orm, fields
+
+
+class AccountInvoice(orm.Model):
+ '''Modify account invoice to add delivery address'''
+ _inherit = 'account.invoice'
+
+ def _modify_vals(self, cr, uid, vals, browse_obj=None, context=None):
+ '''Utility function called on create and write to deliver consistent
+ values. In this case fill delivery address when possible.'''
+ if 'partner_shipping_id' in vals:
+ return # do not overwrite when explicitly filled
+ partner_id = False
+ if browse_obj:
+ # Do nothing when invoice no longer in draft or sent state
+ # or when shipping id already set:
+ if (not browse_obj.state in ['draft', 'sent']
+ or browse_obj.partner_shipping_id):
+ return
+ partner_id = (
+ browse_obj.partner_id and browse_obj.partner_id.id or False)
+ else:
+ partner_id = vals.get('partner_id') or False
+ if not partner_id:
+ return
+ # We have a partner, find delivery address
+ partner_model = self.pool.get('res.partner')
+ addr = partner_model.address_get(
+ cr, uid, [partner_id], ['delivery'])
+ vals['partner_shipping_id'] = addr['delivery']
+
+ def create(self, cr, uid, vals, context=None):
+ '''get delivery address, when not already in vals'''
+ self._modify_vals(cr, uid, vals, browse_obj=None, context=context)
+ return super(AccountInvoice, self).create(
+ cr, uid, vals, context)
+
+ def write(self, cr, uid, ids, vals, context=None):
+ '''get delivery address, when not already in vals, or filled'''
+ for item_id in ids:
+ browse_records = self.browse(cr, uid, [item_id], context=context)
+ browse_obj = browse_records[0]
+ self._modify_vals(
+ cr, uid, vals, browse_obj=browse_obj, context=context)
+ super(AccountInvoice, self).write(
+ cr, uid, [item_id], vals, context=context)
+ return True
+
+ _columns = {
+ 'partner_shipping_id': fields.many2one(
+ 'res.partner', 'Delivery Address',
+ readonly=True,
+ states={
+ 'draft': [('readonly', False)],
+ 'sent': [('readonly', False)]
+ },
+ help="Delivery address for current invoice."),
+ }
+
=== 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 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module Copyright (C) 2014 Therp BV (<http://therp.nl>).
+# All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+'''Extend model sale.order'''
+from openerp.osv import orm
+
+
+class SaleOrder(orm.Model):
+ '''Modify sale order to fill delivery address'''
+ _inherit = 'sale.order'
+
+ def _prepare_invoice(
+ self, cr, uid, order, lines, context=None):
+ """\
+Inherit the original function of the 'sale' module in order to fill delivery
+address when present in sales order.
+"""
+ invoice_vals = super(SaleOrder, self)._prepare_invoice(
+ cr, uid, order, lines, context=context)
+ if order.partner_shipping_id:
+ invoice_vals['partner_shipping_id'] = order.partner_shipping_id.id
+ return invoice_vals
+
=== 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 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module Copyright (C) 2014 Therp BV (<http://therp.nl>).
+# All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+'''Extend model stock.picking'''
+from openerp.osv import orm
+
+
+class StockPicking(orm.Model):
+ '''Modify stock picking to fill delivery address'''
+ _inherit = 'stock.picking'
+
+ def _prepare_invoice(
+ self, cr, uid, picking, partner, inv_type, journal_id, context=None):
+ """\
+Inherit the original function of the 'stock' module in order to fill delivery
+address when present in sales order.
+"""
+ invoice_vals = super(StockPicking, self)._prepare_invoice(
+ cr, uid, picking, partner, inv_type, journal_id, context=context)
+ if picking.sale_id and picking.sale_id.partner_shipping_id:
+ invoice_vals['partner_shipping_id'] = (
+ picking.sale_id.partner_shipping_id.id)
+ return invoice_vals
+
=== 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 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
=== 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 @@
+<?xml version="1.0"?>
+<document filename="Invoices.pdf">
+ <template title="Invoices" author="OpenERP S.A.(sales@xxxxxxxxxxx)" allowSplitting="20">
+ <pageTemplate id="first">
+ <frame id="first" x1="34.0" y1="28.0" width="530" height="786"/>
+ </pageTemplate>
+ </template>
+ <stylesheet>
+ <blockTableStyle id="Standard_Outline">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table_Partner_Address">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table_Invoice_General_Header">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table_General_Detail_Content">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table7">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table8">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table10">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table9">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table2">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+ </blockTableStyle>
+ <blockTableStyle id="Table1">
+ <blockAlignment value="LEFT"/>
+ <blockValign value="TOP"/>
+ </blockTableStyle>
+ <initialize>
+ <paraStyle name="all" alignment="justify"/>
+ </initialize>
+ <paraStyle name="Standard"/>
+ <paraStyle name="Text body" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="List" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="Table Contents" spaceBefore="0.0" spaceAfter="6.0"/>
+ <paraStyle name="Caption" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="Index"/>
+
+ <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="Footer"/>
+ <paraStyle name="Horizontal Line" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
+
+ <paraStyle name="terp_tblheader_General" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_Details" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_General_Centre" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_General_Right" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_Details_Centre" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="terp_tblheader_Details_Right" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
+
+ <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"/>
+ <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"/>
+ <paraStyle name="terp_default_address" rightIndent="0.0" leftIndent="0.0" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <paraStyle name="terp_default_9" rightIndent="0.0" leftIndent="0.0" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <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"/>
+ <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"/>
+ <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"/>
+ <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"/>
+ <paraStyle name="terp_default_2" rightIndent="0.0" leftIndent="0.0" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+ <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"/>
+
+ <paraStyle name="Table" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
+ <paraStyle name="User Index 10" rightIndent="0.0" leftIndent="127.0"/>
+ <paraStyle name="Preformatted Text" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
+ <images/>
+ </stylesheet>
+ <story>
+ <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
+ <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
+
+<!-- START of modification for delivery address -->
+ <blockTable colWidths="233.0,64.0,233.0" style="Table_Partner_Address">
+ <tr>
+ <td>
+ <para style="terp_default_Bold_9"
+ ><b>Shipping address : [[ (o.partner_shipping_id and ' ') or removeParentNode('para') ]] </b></para>
+ <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>
+ <para style="terp_default_9">[[ o.partner_shipping_id and display_address(o.partner_shipping_id) ]]</para>
+ </td>
+<!-- END of modification for delivery address -->
+
+ <td>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <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>
+ <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ <para style="terp_default_8">Tel. : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para>
+ <para style="terp_default_8">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para>
+ <para style="terp_default_8">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <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>
+ <para style="terp_header"><b>PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma2') or removeParentNode('para')) and '' ]]</b></para>
+ <para style="terp_header"><b>Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</b></para>
+ <para style="terp_header"><b>Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
+ <para style="terp_header"><b>Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
+ <para style="terp_header"><b>Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
+ <para style="terp_header"><b>Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
+ <tr>
+ <td>
+ <para style="terp_tblheader_General_Centre"><b>Description</b></para>
+ </td>
+ <td>
+ <para style="terp_tblheader_General_Centre"><b>Invoice Date</b></para>
+ </td>
+ <td>
+ <para style="terp_tblheader_General_Centre"><b>Source</b></para>
+ </td>
+ <td>
+ <para style="terp_tblheader_General_Centre"><b>Customer Code</b></para>
+ </td>
+ </tr>
+ </blockTable>
+ <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
+ <tr>
+ <td>
+ <para style="terp_default_Centre_9">[[ o.name or ' ' ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Centre_9">[[ o.origin or '' ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Centre_9">[[ (o.partner_id.ref) or ' ' ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ <pto>
+ <pto_header>
+ <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7">
+ <tr>
+ <td> <para style="terp_tblheader_Details">Description</para> </td>
+ <td> <para style="terp_tblheader_Details_Centre">Taxes</para> </td>
+ <td> <para style="terp_tblheader_Details_Centre">Quantity</para> </td>
+ <td> <para style="terp_tblheader_Details_Right">Unit Price </para> </td>
+ <td> <para style="terp_tblheader_Details_Right">Disc.(%)</para> </td>
+ <td> <para style="terp_tblheader_Details_Right">Price</para> </td>
+ </tr>
+ </blockTable>
+ </pto_header>
+ <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7">
+ <tr>
+ <td>
+ <para style="terp_tblheader_General"><b>Description</b></para>
+ </td>
+ <td>
+ <para style="terp_tblheader_General_Centre"><b>Taxes</b></para>
+ </td>
+ <td>
+ <para style="terp_tblheader_General_Right"><b>Quantity</b></para>
+ </td>
+ <td>
+ <para style="terp_tblheader_General_Right"><b>Unit Price</b></para>
+ </td>
+ <td>
+ <para style="terp_tblheader_General_Right"><b>Disc.(%)</b></para>
+ </td>
+ <td>
+ <para style="terp_tblheader_General_Right"><b>Price</b></para>
+ </td>
+ </tr>
+ </blockTable>
+ <section>
+ <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
+ <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table8">
+ <tr>
+ <td>
+ <para style="terp_default_9">[[ format(l.name) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Centre_9">[[ ', '.join([ lt.name or '' for lt in l.invoice_line_tax_id ]) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[ formatLang(l.quantity)]] [[ (l.uos_id and l.uos_id.name) or '' ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Centre_9">[[ formatLang(l.discount, dp='Account') ]] </para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[ formatLang(l.price_subtotal, dp='Account', currency_obj=o.currency_id) ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ </section>
+ </pto>
+ <blockTable colWidths="385.0,60.0,85.0" style="Table10">
+ <tr>
+ <td>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_9">Net Total:</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_9">Taxes:</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, dp='Account', currency_obj=o.currency_id) ]]</para>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ </td>
+ <td>
+ <para style="terp_default_9"><b>Total:</b></para>
+ </td>
+ <td>
+ <para style="terp_default_Bold_Right_9"><b>[[ formatLang(o.amount_total, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</b></para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="Text body">
+ <font color="white"> </font>
+ </para>
+ <blockTable colWidths="205.0,71.0,71.0,183.0" style="Table9">
+ <tr>
+ <td>
+ <para style="terp_tblheader_Details"><b>Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]</b></para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right"><b>Base </b></para>
+ </td>
+ <td>
+ <para style="terp_tblheader_Details_Right"><b>Amount </b></para>
+ </td>
+ <td>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ </td>
+ </tr>
+ </blockTable>
+ <section>
+ <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
+ <blockTable colWidths="205.0,71.0,71.0,184.0" style="Table2">
+ <tr>
+ <td>
+ <para style="terp_default_8">[[ t.name ]]</para>
+ </td>
+ <td>
+ <para style="terp_default_Right_8">[[ formatLang(t.base, dp='Account', currency_obj=o.currency_id) ]]</para>
+ </td>
+ <td>
+ <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>
+ </td>
+ <td>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ </td>
+ </tr>
+ </blockTable>
+ </section>
+ <para style="terp_default_9">
+ <font color="white"> </font>
+ </para>
+ <para style="terp_default_9">[[ (o.comment and format(o.comment )) or removeParentNode('para') ]]</para>
+ <para style="terp_default_8">
+ <font color="white"> </font>
+ </para>
+ <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>
+ <para style="terp_default_9">
+ <font color="white"> </font>
+ </para>
+ <blockTable colWidths="120.0,410.0" style="Table1">
+ <tr>
+ <td>
+ <para style="terp_default_Bold_9"><b>Fiscal Position Remark : </b></para>
+ </td>
+ <td>
+ <para style="terp_default_9">[[ (o.fiscal_position and o.fiscal_position.note and format(o.fiscal_position.note)) or removeParentNode('blockTable') ]]</para>
+ </td>
+ </tr>
+ </blockTable>
+ <para style="terp_default_2">
+ <font color="white"> </font>
+ </para>
+ </story>
+</document>
=== 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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Unfortunately only a full replace of the rml is possible at this time -->
+ <record
+ id="account.account_invoices"
+ model="ir.actions.report.xml">
+ <field name="report_rml"
+ >account_invoice_delivery_address/report/account_print_invoice.rml</field>
+ </record>
+ </data>
+</openerp>
=== 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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+ <data>
+ <!-- Add delivery address to invoice form -->
+ <record id="form_invoice_delivery_address" model="ir.ui.view">
+ <field name="name">account.invoice.delivery.address</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_form"/>
+ <field name="arch" type="xml">
+ <field
+ name="account_id"
+ position="after">
+ <field
+ name="commercial_partner_id"
+ invisible="1"
+ />
+ <field
+ name="partner_shipping_id"
+ domain="[('parent_id','=',commercial_partner_id),]"
+ context="{'default_type':'delivery'}"/>
+ </field>
+ </field>
+ </record>
+ </data>
+</openerp>
+
Follow ups