Merge lp:~scigghia/account-invoicing/adding_account_invoice_shipping_address_7 into lp:~account-core-editors/account-invoicing/7.0

Proposed by Andrea Cometa
Status: Merged
Merged at revision: 22
Proposed branch: lp:~scigghia/account-invoicing/adding_account_invoice_shipping_address_7
Merge into: lp:~account-core-editors/account-invoicing/7.0
Diff against target: 250 lines (+209/-0)
8 files modified
account_invoice_shipping_address/AUTHORS.txt (+2/-0)
account_invoice_shipping_address/__init__.py (+24/-0)
account_invoice_shipping_address/__openerp__.py (+39/-0)
account_invoice_shipping_address/i18n/account_invoice_shipping_address.pot (+27/-0)
account_invoice_shipping_address/i18n/it.po (+27/-0)
account_invoice_shipping_address/invoice.py (+39/-0)
account_invoice_shipping_address/invoice_view.xml (+15/-0)
account_invoice_shipping_address/sale.py (+36/-0)
To merge this branch: bzr merge lp:~scigghia/account-invoicing/adding_account_invoice_shipping_address_7
Reviewer Review Type Date Requested Status
Francesco Apruzzese (community) Approve
Lorenzo Battistini (community) code review Approve
Pedro Manuel Baeza code review and test Approve
Andrea Cometa (community) Approve
Leonardo Pistone Needs Fixing
Review via email: mp+183872@code.launchpad.net

Description of the change

This Addon adds a shipping address field to the invoice, also fill it in sale invoicing

To post a comment you must log in.
Revision history for this message
Lorenzo Battistini (elbati) wrote :
review: Needs Information
Revision history for this message
Andrea Cometa (scigghia) wrote :

ok, but sale.py now use the _prepare_invoice instead of _make_invoice

21. By Andrea Cometa

account_invoice_shipping_address (C)

22. By Andrea Cometa

[add] language files

Revision history for this message
Andrea Cometa (scigghia) :
review: Approve
Revision history for this message
Lorenzo Battistini (elbati) wrote :

line 70: replace 'Andrea Cometa' with 'Andrea Cometa, Agile Business Group'
line 71: description should be ENG only. ITA translation should be done by it.po
line 74: remove init_xml
line 75: replace update_xml with data
line 78: replace demo_xml with demo
line 177 and 238: replace osv.osv with orm.Model
line 182: too long
line 185 and 249: remove
line 199: <field name="type">form</field>

Thanks!

review: Needs Fixing
23. By Andrea Cometa

[fix] as proposed by eLBati

Revision history for this message
Leonardo Pistone (lepistone) wrote :

Andrea,
I would fix refactor a bit to make flake8 pass. I think everything except the first two lines in __init__.py can be fixed (those two are actually correct).

Thanks!

Here is the output:

./__init__.py:23:1: F401 'invoice' imported but unused
./__init__.py:24:1: F401 'sale' imported but unused
./__openerp__.py:30:80: E501 line too long (102 > 79 characters)
./invoice.py:23:1: F401 'osv' imported but unused
./invoice.py:23:23: E231 missing whitespace after ','
./invoice.py:24:1: F401 '_' imported but unused
./invoice.py:26:1: E302 expected 2 blank lines, found 1
./invoice.py:26:1: F821 undefined name 'orm'
./invoice.py:27:1: W191 indentation contains tabs
./invoice.py:29:1: W191 indentation contains tabs
./invoice.py:30:1: W191 indentation contains tabs
./invoice.py:30:3: E126 continuation line over-indented for hanging indent
./invoice.py:30:76: W291 trailing whitespace
./invoice.py:31:1: W191 indentation contains tabs
./invoice.py:31:4: E128 continuation line under-indented for visual indent
./invoice.py:31:80: E501 line too long (89 > 79 characters)
./invoice.py:32:1: W191 indentation contains tabs
./invoice.py:32:4: E126 continuation line over-indented for hanging indent
./invoice.py:33:1: W191 indentation contains tabs
./sale.py:23:1: F401 'fields' imported but unused
./sale.py:23:1: F401 'osv' imported but unused
./sale.py:23:23: E231 missing whitespace after ','
./sale.py:24:1: F401 '_' imported but unused
./sale.py:26:1: E302 expected 2 blank lines, found 1
./sale.py:26:1: F821 undefined name 'orm'
./sale.py:27:1: W191 indentation contains tabs
./sale.py:28:1: E101 indentation contains mixed spaces and tabs
./sale.py:28:1: W293 blank line contains whitespace
./sale.py:29:1: W191 indentation contains tabs
./sale.py:31:1: W191 indentation contains tabs
./sale.py:31:80: E501 line too long (88 > 79 characters)
./sale.py:32:1: W191 indentation contains tabs
./sale.py:33:1: W191 indentation contains tabs
./sale.py:33:6: E126 continuation line over-indented for hanging indent
./sale.py:34:1: W191 indentation contains tabs
./sale.py:34:6: E126 continuation line over-indented for hanging indent
./sale.py:35:1: W191 indentation contains tabs

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

Another little change. Where it puts:

from osv import fields,osv
from tools.translate import _

please change it to the new OpenERP standard for v7:

from openerp.osv import fields, orm
from openerp.tools.translate import _

Regards.

review: Needs Fixing
24. By Andrea Cometa

[fix] pep8 style

25. By Andrea Cometa

[fix] pep8 style

Revision history for this message
Andrea Cometa (scigghia) wrote :

for me its ok, i've fixed every suggestion

review: Approve
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) :
review: Approve (code review and test)
Revision history for this message
Lorenzo Battistini (elbati) :
review: Approve (code review)
Revision history for this message
Francesco Apruzzese (opencode) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'account_invoice_shipping_address'
=== added file 'account_invoice_shipping_address/AUTHORS.txt'
--- account_invoice_shipping_address/AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ account_invoice_shipping_address/AUTHORS.txt 2013-09-11 14:16:29 +0000
@@ -0,0 +1,2 @@
1Leonardo Pistone <leonardo.pistone@domsense.com>
2Andrea Cometa <info@andreacometa.it>
03
=== added file 'account_invoice_shipping_address/__init__.py'
--- account_invoice_shipping_address/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_shipping_address/__init__.py 2013-09-11 14:16:29 +0000
@@ -0,0 +1,24 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>).
6# Copyright (C) 2013 Andrea Cometa Perito Informatico (www.andreacometa.it)
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (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 Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23import invoice
24import sale
025
=== added file 'account_invoice_shipping_address/__openerp__.py'
--- account_invoice_shipping_address/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_shipping_address/__openerp__.py 2013-09-11 14:16:29 +0000
@@ -0,0 +1,39 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>).
6# Copyright (C) 2013 Andrea Cometa Perito Informatico (www.andreacometa.it)
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (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 Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23
24{
25 "name": "Invoice Shipping Address",
26 "version": "0.1",
27 'category': 'Generic Modules/Accounting',
28 "depends": ["account", "sale"],
29 "author": "Andrea Cometa, Agile Business Group",
30 "description": """Adds a shipping address field to the invoice, also fill
31it in sale invoicing""",
32 'website': 'http://www.andreacometa.it',
33 'data': [
34 'invoice_view.xml',
35 ],
36 'demo': [],
37 'installable': True,
38 'active': False,
39}
040
=== added directory 'account_invoice_shipping_address/i18n'
=== added file 'account_invoice_shipping_address/i18n/account_invoice_shipping_address.pot'
--- account_invoice_shipping_address/i18n/account_invoice_shipping_address.pot 1970-01-01 00:00:00 +0000
+++ account_invoice_shipping_address/i18n/account_invoice_shipping_address.pot 2013-09-11 14:16:29 +0000
@@ -0,0 +1,27 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * account_invoice_shipping_address
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-04 14:39+0000\n"
10"PO-Revision-Date: 2013-09-04 14:39+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_shipping_address
19#: field:account.invoice,address_shipping_id:0
20msgid "Shipping Address"
21msgstr ""
22
23#. module: account_invoice_shipping_address
24#: help:account.invoice,address_shipping_id:0
25msgid "Delivery address for current invoice."
26msgstr ""
27
028
=== added file 'account_invoice_shipping_address/i18n/it.po'
--- account_invoice_shipping_address/i18n/it.po 1970-01-01 00:00:00 +0000
+++ account_invoice_shipping_address/i18n/it.po 2013-09-11 14:16:29 +0000
@@ -0,0 +1,27 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * account_invoice_shipping_address
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-04 14:39+0000\n"
10"PO-Revision-Date: 2013-09-04 14:39+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_shipping_address
19#: field:account.invoice,address_shipping_id:0
20msgid "Shipping Address"
21msgstr "Indirizzo di consegna"
22
23#. module: account_invoice_shipping_address
24#: help:account.invoice,address_shipping_id:0
25msgid "Delivery address for current invoice."
26msgstr "Indirizzo di consegna per la presente fattura"
27
028
=== added file 'account_invoice_shipping_address/invoice.py'
--- account_invoice_shipping_address/invoice.py 1970-01-01 00:00:00 +0000
+++ account_invoice_shipping_address/invoice.py 2013-09-11 14:16:29 +0000
@@ -0,0 +1,39 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>).
6# Copyright (C) 2013 Andrea Cometa Perito Informatico (www.andreacometa.it)
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (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 Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from openerp.osv import fields, orm
24
25
26class account_invoice(orm.Model):
27 _inherit = "account.invoice"
28
29 _columns = {
30 'address_shipping_id': fields.many2one(
31 'res.partner',
32 'Shipping Address',
33 readonly=True,
34 states={
35 'draft': [('readonly', False)],
36 'sent': [('readonly', False)]
37 },
38 help="Delivery address for current invoice."),
39 }
040
=== added file 'account_invoice_shipping_address/invoice_view.xml'
--- account_invoice_shipping_address/invoice_view.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_shipping_address/invoice_view.xml 2013-09-11 14:16:29 +0000
@@ -0,0 +1,15 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4 <record model="ir.ui.view" id="invoice_form_shipping_address">
5 <field name="name">account.invoice.form.shipping.address</field>
6 <field name="model">account.invoice</field>
7 <field name="inherit_id" ref="account.invoice_form"/>
8 <field name="arch" type="xml">
9 <field name="fiscal_position" position="before">
10 <field name="address_shipping_id" />
11 </field>
12 </field>
13 </record>
14 </data>
15</openerp>
016
=== added file 'account_invoice_shipping_address/sale.py'
--- account_invoice_shipping_address/sale.py 1970-01-01 00:00:00 +0000
+++ account_invoice_shipping_address/sale.py 2013-09-11 14:16:29 +0000
@@ -0,0 +1,36 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>).
6# Copyright (C) 2013 Andrea Cometa Perito Informatico (www.andreacometa.it)
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (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 Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from openerp.osv import orm
24
25
26class sale_order(orm.Model):
27 _inherit = 'sale.order'
28
29 def _prepare_invoice(self, cr, uid, order, lines, context=None):
30
31 res = super(sale_order, self)._prepare_invoice(
32 cr, uid, order, lines, context=context
33 )
34 res.update({
35 'address_shipping_id': order.partner_shipping_id.id, })
36 return res

Subscribers

People subscribed via source and target branches