Merge lp:~savoirfairelinux-openerp/account-invoicing/account_invoice_line_merge into lp:~account-core-editors/account-invoicing/7.0

Status: Needs review
Proposed branch: lp:~savoirfairelinux-openerp/account-invoicing/account_invoice_line_merge
Merge into: lp:~account-core-editors/account-invoicing/7.0
Diff against target: 423 lines (+361/-0)
12 files modified
account_invoice_purchase_origin/__init__.py (+22/-0)
account_invoice_purchase_origin/__openerp__.py (+42/-0)
account_invoice_purchase_origin/account_invoice_view.xml (+14/-0)
account_invoice_purchase_origin/purchase.py (+42/-0)
account_invoice_sale_origin/__init__.py (+22/-0)
account_invoice_sale_origin/__openerp__.py (+43/-0)
account_invoice_sale_origin/account_invoice_purchase_origin/__init__.py (+22/-0)
account_invoice_sale_origin/account_invoice_purchase_origin/__openerp__.py (+42/-0)
account_invoice_sale_origin/account_invoice_purchase_origin/account_invoice_view.xml (+14/-0)
account_invoice_sale_origin/account_invoice_purchase_origin/purchase.py (+42/-0)
account_invoice_sale_origin/account_invoice_view.xml (+14/-0)
account_invoice_sale_origin/purchase.py (+42/-0)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/account-invoicing/account_invoice_line_merge
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza Needs Resubmitting
Holger Brunn (Therp) Needs Fixing
Joël Grand-Guillaume @ camptocamp code review, no tests Needs Fixing
Review via email: mp+216327@code.launchpad.net

Commit message

[ADD] account_invoice_purchase_origin module

Description of the change

[ADD] account_invoice_purchase_origin module

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. It seems to me that you have a strange diff here, like if files or folder have been here more than once ? Can you check and clean the MP ?

Otherwise, the code is looking good to me.

Regards,

Joël

review: Needs Fixing (code review, no tests)
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

I think the problem Joël means is that the sale_origin addon simply contains the code for purchase_origin.

Then for #344ff: I think it's a bad idea to copy the original function and break inheritance. Better call super and set the origin field in the dictionary you get back.

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

This project is now hosted on https://github.com/OCA/account-invoicing. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

review: Needs Resubmitting

Unmerged revisions

27. By David Cormier

[NEW] Add account invoice sale origin

26. By David Cormier

[FIX] Apply community conventions

25. By David Cormier

[FIX] After account_analytic_id rather than replace

24. By David Cormier

[NEW] Add account_invoice_purchase_origin module

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'account_invoice_purchase_origin'
=== added file 'account_invoice_purchase_origin/__init__.py'
--- account_invoice_purchase_origin/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_purchase_origin/__init__.py 2014-04-17 13:55:12 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
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
22import purchase
023
=== added file 'account_invoice_purchase_origin/__openerp__.py'
--- account_invoice_purchase_origin/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_purchase_origin/__openerp__.py 2014-04-17 13:55:12 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
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{
23 'name': 'Account Invoice Purchase Origin',
24 'version': '1.1',
25 'category': 'Finance',
26 'description': """
27 This module displays the origin field of account invoice lines and populate
28 them when an invoice is created from a purchase order
29 """,
30 'author': 'Savoir-faire Linux',
31 'website': 'http://www.savoirfairelinux.com/',
32 'depends': ['account', 'purchase'],
33 'data': [
34 'account_invoice_view.xml',
35 ],
36 'test': [
37 ],
38 'demo': [],
39 'installable': True,
40 'active': False,
41 'certificate': False,
42}
043
=== added file 'account_invoice_purchase_origin/account_invoice_view.xml'
--- account_invoice_purchase_origin/account_invoice_view.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_purchase_origin/account_invoice_view.xml 2014-04-17 13:55:12 +0000
@@ -0,0 +1,14 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_invoice_line_tree" model="ir.ui.view">
5 <field name="model">account.invoice</field>
6 <field name="inherit_id" ref="account.invoice_supplier_form" />
7 <field name="arch" type="xml">
8 <xpath expr="//tree//field[@name='account_analytic_id']" position="after">
9 <field name="origin" readonly="1" />
10 </xpath>
11 </field>
12 </record>
13 </data>
14</openerp>
015
=== added file 'account_invoice_purchase_origin/purchase.py'
--- account_invoice_purchase_origin/purchase.py 1970-01-01 00:00:00 +0000
+++ account_invoice_purchase_origin/purchase.py 2014-04-17 13:55:12 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
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
22from openerp.osv import orm
23
24
25class purchase_order(orm.Model):
26
27 _inherit = 'purchase.order'
28
29 def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
30
31 return {
32 'name': order_line.name,
33 'account_id': account_id,
34 'price_unit': order_line.price_unit or 0.0,
35 'origin': order_line.order_id.name,
36 'quantity': order_line.product_qty,
37 'product_id': order_line.product_id.id or False,
38 'uos_id': order_line.product_uom.id or False,
39 'invoice_line_tax_id': [(6, 0, [x.id\
40 for x in order_line.taxes_id])],
41 'account_analytic_id': order_line.account_analytic_id.id or False,
42 }
043
=== added directory 'account_invoice_sale_origin'
=== added file 'account_invoice_sale_origin/__init__.py'
--- account_invoice_sale_origin/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/__init__.py 2014-04-17 13:55:12 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
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
22import sale
023
=== added file 'account_invoice_sale_origin/__openerp__.py'
--- account_invoice_sale_origin/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/__openerp__.py 2014-04-17 13:55:12 +0000
@@ -0,0 +1,43 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
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{
23 'name': 'Account Invoice Sale Origin',
24 'version': '1.1',
25 'category': 'Finance',
26 'description': """
27
28 This module displays the origin field of account invoice lines and populate
29 them when a customer invoice is create from a delivery order
30 """,
31 'author': 'Savoir-faire Linux',
32 'website': 'http://www.savoirfairelinux.com/',
33 'depends': ['account', 'sale'],
34 'data': [
35 'account_invoice_view.xml',
36 ],
37 'test': [
38 ],
39 'demo': [],
40 'installable': True,
41 'active': False,
42 'certificate': False,
43}
044
=== added directory 'account_invoice_sale_origin/account_invoice_purchase_origin'
=== added file 'account_invoice_sale_origin/account_invoice_purchase_origin/__init__.py'
--- account_invoice_sale_origin/account_invoice_purchase_origin/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/account_invoice_purchase_origin/__init__.py 2014-04-17 13:55:12 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
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
22import purchase
023
=== added file 'account_invoice_sale_origin/account_invoice_purchase_origin/__openerp__.py'
--- account_invoice_sale_origin/account_invoice_purchase_origin/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/account_invoice_purchase_origin/__openerp__.py 2014-04-17 13:55:12 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
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{
23 'name': 'Account Invoice Purchase Origin',
24 'version': '1.1',
25 'category': 'Finance',
26 'description': """
27 This module displays the origin field of account invoice lines and populate
28 them when an invoice is created from a purchase order
29 """,
30 'author': 'Savoir-faire Linux',
31 'website': 'http://www.savoirfairelinux.com/',
32 'depends': ['account', 'purchase'],
33 'data': [
34 'account_invoice_view.xml',
35 ],
36 'test': [
37 ],
38 'demo': [],
39 'installable': True,
40 'active': False,
41 'certificate': False,
42}
043
=== added file 'account_invoice_sale_origin/account_invoice_purchase_origin/account_invoice_view.xml'
--- account_invoice_sale_origin/account_invoice_purchase_origin/account_invoice_view.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/account_invoice_purchase_origin/account_invoice_view.xml 2014-04-17 13:55:12 +0000
@@ -0,0 +1,14 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_invoice_line_tree" model="ir.ui.view">
5 <field name="model">account.invoice</field>
6 <field name="inherit_id" ref="account.invoice_supplier_form" />
7 <field name="arch" type="xml">
8 <xpath expr="//tree//field[@name='account_analytic_id']" position="after">
9 <field name="origin" readonly="1" />
10 </xpath>
11 </field>
12 </record>
13 </data>
14</openerp>
015
=== added file 'account_invoice_sale_origin/account_invoice_purchase_origin/purchase.py'
--- account_invoice_sale_origin/account_invoice_purchase_origin/purchase.py 1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/account_invoice_purchase_origin/purchase.py 2014-04-17 13:55:12 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
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
22from openerp.osv import orm
23
24
25class purchase_order(orm.Model):
26
27 _inherit = 'purchase.order'
28
29 def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
30
31 return {
32 'name': order_line.name,
33 'account_id': account_id,
34 'price_unit': order_line.price_unit or 0.0,
35 'origin': order_line.order_id.name,
36 'quantity': order_line.product_qty,
37 'product_id': order_line.product_id.id or False,
38 'uos_id': order_line.product_uom.id or False,
39 'invoice_line_tax_id': [(6, 0, [x.id\
40 for x in order_line.taxes_id])],
41 'account_analytic_id': order_line.account_analytic_id.id or False,
42 }
043
=== added file 'account_invoice_sale_origin/account_invoice_view.xml'
--- account_invoice_sale_origin/account_invoice_view.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/account_invoice_view.xml 2014-04-17 13:55:12 +0000
@@ -0,0 +1,14 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_invoice_line_tree" model="ir.ui.view">
5 <field name="model">account.invoice</field>
6 <field name="inherit_id" ref="account.invoice_supplier_form" />
7 <field name="arch" type="xml">
8 <xpath expr="//tree//field[@name='account_analytic_id']" position="after">
9 <field name="origin" readonly="1" />
10 </xpath>
11 </field>
12 </record>
13 </data>
14</openerp>
015
=== added file 'account_invoice_sale_origin/purchase.py'
--- account_invoice_sale_origin/purchase.py 1970-01-01 00:00:00 +0000
+++ account_invoice_sale_origin/purchase.py 2014-04-17 13:55:12 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
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
22from openerp.osv import orm
23
24
25class purchase_order(orm.Model):
26
27 _inherit = 'purchase.order'
28
29 def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
30
31 return {
32 'name': order_line.name,
33 'account_id': account_id,
34 'price_unit': order_line.price_unit or 0.0,
35 'origin': order_line.order_id.name,
36 'quantity': order_line.product_qty,
37 'product_id': order_line.product_id.id or False,
38 'uos_id': order_line.product_uom.id or False,
39 'invoice_line_tax_id': [(6, 0, [x.id\
40 for x in order_line.taxes_id])],
41 'account_analytic_id': order_line.account_analytic_id.id or False,
42 }

Subscribers

People subscribed via source and target branches