Merge lp:~sbi/account-invoicing/6.1-account_invoice_total into lp:~account-core-editors/account-invoicing/6.1

Proposed by Stéphane Bidoul (Acsone)
Status: Merged
Approved by: Stefan Rijnhart (Opener)
Approved revision: 13
Merged at revision: 12
Proposed branch: lp:~sbi/account-invoicing/6.1-account_invoice_total
Merge into: lp:~account-core-editors/account-invoicing/6.1
Diff against target: 168 lines (+143/-0)
5 files modified
account_invoice_total/README.md (+21/-0)
account_invoice_total/__init__.py (+25/-0)
account_invoice_total/__openerp__.py (+43/-0)
account_invoice_total/account_invoice_total.py (+38/-0)
account_invoice_total/account_invoice_total_view.xml (+16/-0)
To merge this branch: bzr merge lp:~sbi/account-invoicing/6.1-account_invoice_total
Reviewer Review Type Date Requested Status
Joël Grand-Guillaume @ camptocamp Approve
Review via email: mp+134970@code.launchpad.net

Description of the change

Until OpenERP 6.0.3 when creating a supplier invoice one first had to enter the grand total, this had to match with the computed total before the invoice could be verified.

In OpenERP 6.1 this feature has silently been removed.

This merge proposal provides the account_invoice_total module which brings back the field and the extra verification check.

Discussion : https://bugs.launchpad.net/openobject-addons/+bug/998008
Code Revision : http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/revision/6254

This module was originally created at https://github.com/arnebrasseur/openerp-account_invoice_total by arne brasseur and simplified by myself.

To post a comment you must log in.
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Ok for me. Code looks ok, good place to be committed IMHO.

review: Approve
13. By Stéphane Bidoul (Acsone)

[IMP] account_invoice_total has 2 authors

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

What's the next step for merging this one?

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi,

merged with an additional comment about this option in 7.0

Cheers,
Stefan.

Revision history for this message
Niels Huylebroeck (red15) wrote :

What is the purpose of the README.md file ? Is this some form of markup ? If so we should as community gather around a central format which everyone can agree upon so we can make such files a requirement when committing new modules.

Also a bit strange why required="2" on the check_total field ? Why is value 2 not 1 or True, I prefer the latter personally.

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

md is for markdown. That said, README.md is redundant to __openerp__.py and could be removed.

The required="2" comes from the 6.0 account_invoice_view.xml. I have no idea if it means something different than 1 or True.

-sbi

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_invoice_total'
2=== added file 'account_invoice_total/README.md'
3--- account_invoice_total/README.md 1970-01-01 00:00:00 +0000
4+++ account_invoice_total/README.md 2012-11-21 10:31:19 +0000
5@@ -0,0 +1,21 @@
6+# Account_invoice_total for OpenERP 6.1
7+
8+Until OpenERP 6.0.3 when creating a supplier invoice one first had to enter the grand total, this had to match with the computed total before the invoice could be verified.
9+
10+In OpenERP 6.1 this feature has silently been removed. This module brings back the field and the extra verification check.
11+
12+## Links
13+
14+Discussion : https://bugs.launchpad.net/openobject-addons/+bug/998008
15+Code Revision : http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/revision/6254
16+
17+## License
18+
19+Copyright (c) 2012 Ren Dao Solutions bvba
20+Copyright (c) 2012 ACSONE SA/NV
21+
22+This module 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.
23+
24+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.
25+
26+For a full text of the license see <http://www.gnu.org/licenses/agpl-3.0.html>
27
28=== added file 'account_invoice_total/__init__.py'
29--- account_invoice_total/__init__.py 1970-01-01 00:00:00 +0000
30+++ account_invoice_total/__init__.py 2012-11-21 10:31:19 +0000
31@@ -0,0 +1,25 @@
32+# -*- coding: utf-8 -*-
33+##############################################################################
34+#
35+# account_invoice_total module for OpenERP
36+# Copyright (C) 2012 Ren Dao Solutions (<http://rendaosolutions.com>).
37+# Copyright (C) 2012 Acsone (<http://acsone.eu>).
38+#
39+# This program is free software: you can redistribute it and/or modify
40+# it under the terms of the GNU Affero General Public License as
41+# published by the Free Software Foundation, either version 3 of the
42+# License, or (at your option) any later version.
43+#
44+# This program is distributed in the hope that it will be useful,
45+# but WITHOUT ANY WARRANTY; without even the implied warranty of
46+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47+# GNU Affero General Public License for more details.
48+#
49+# You should have received a copy of the GNU Affero General Public License
50+# along with this program. If not, see <http://www.gnu.org/licenses/>.
51+#
52+##############################################################################
53+
54+import account_invoice_total
55+
56+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
57
58=== added file 'account_invoice_total/__openerp__.py'
59--- account_invoice_total/__openerp__.py 1970-01-01 00:00:00 +0000
60+++ account_invoice_total/__openerp__.py 2012-11-21 10:31:19 +0000
61@@ -0,0 +1,43 @@
62+# -*- coding: utf-8 -*-
63+##############################################################################
64+#
65+# account_invoice_total module for OpenERP
66+# Copyright (C) 2012 Ren Dao Solutions (<http://rendaosolutions.com>).
67+# Copyright (C) 2012 Acsone (<http://acsone.eu>).
68+#
69+# This program is free software: you can redistribute it and/or modify
70+# it under the terms of the GNU Affero General Public License as
71+# published by the Free Software Foundation, either version 3 of the
72+# License, or (at your option) any later version.
73+#
74+# This program is distributed in the hope that it will be useful,
75+# but WITHOUT ANY WARRANTY; without even the implied warranty of
76+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
77+# GNU Affero General Public License for more details.
78+#
79+# You should have received a copy of the GNU Affero General Public License
80+# along with this program. If not, see <http://www.gnu.org/licenses/>.
81+#
82+##############################################################################
83+{ 'name': 'Total Field on Supplier Invoice',
84+ 'version': '0.1',
85+ 'category': 'Accounting',
86+ 'description': """
87+Since OpenERP 6.1 the check_total field in the supplier invoice form, and the corresponding
88+check, has been removed. This module brings back the functionality from 6.0 and before.
89+
90+See discussion : https://bugs.launchpad.net/openobject-addons/+bug/998008
91+See revision : http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/revision/6254
92+ """,
93+ 'author': 'Ren Dao Solutions bvba, ACSONE SA/NV',
94+ 'depends': [
95+ 'account',
96+ ],
97+ 'init_xml': [
98+ 'account_invoice_total_view.xml'
99+ ],
100+ 'update_xml': [],
101+ 'demo_xml': [],
102+ 'installable': True,
103+}
104+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
105
106=== added file 'account_invoice_total/account_invoice_total.py'
107--- account_invoice_total/account_invoice_total.py 1970-01-01 00:00:00 +0000
108+++ account_invoice_total/account_invoice_total.py 2012-11-21 10:31:19 +0000
109@@ -0,0 +1,38 @@
110+# -*- coding: utf-8 -*-
111+##############################################################################
112+#
113+# account_invoice_total module for OpenERP
114+# Copyright (C) 2012 Ren Dao Solutions (<http://rendaosolutions.com>).
115+# Copyright (C) 2012 Acsone (<http://acsone.eu>).
116+#
117+# This program is free software: you can redistribute it and/or modify
118+# it under the terms of the GNU Affero General Public License as
119+# published by the Free Software Foundation, either version 3 of the
120+# License, or (at your option) any later version.
121+#
122+# This program is distributed in the hope that it will be useful,
123+# but WITHOUT ANY WARRANTY; without even the implied warranty of
124+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
125+# GNU Affero General Public License for more details.
126+#
127+# You should have received a copy of the GNU Affero General Public License
128+# along with this program. If not, see <http://www.gnu.org/licenses/>.
129+#
130+##############################################################################
131+
132+from osv import fields, osv
133+from tools.translate import _
134+
135+class account_invoice_total(osv.osv):
136+ _inherit = 'account.invoice'
137+
138+ def action_move_create(self, cr, uid, ids, context=None):
139+ res = super(account_invoice_total, self).action_move_create(cr, uid, ids, context=context)
140+ for inv in self.browse(cr, uid, ids, context=context):
141+ if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0):
142+ raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.'))
143+ return res
144+
145+account_invoice_total()
146+
147+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
148
149=== added file 'account_invoice_total/account_invoice_total_view.xml'
150--- account_invoice_total/account_invoice_total_view.xml 1970-01-01 00:00:00 +0000
151+++ account_invoice_total/account_invoice_total_view.xml 2012-11-21 10:31:19 +0000
152@@ -0,0 +1,16 @@
153+<?xml version="1.0" encoding="utf-8"?>
154+<openerp>
155+ <data>
156+ <record id="account_invoice_total_supplier_form" model="ir.ui.view">
157+ <field name="name">account.invoice.supplier.form</field>
158+ <field name="model">account.invoice</field>
159+ <field name="type">form</field>
160+ <field name="inherit_id" ref="account.invoice_supplier_form"/>
161+ <field name="arch" type="xml">
162+ <field name="date_due" position="after">
163+ <field name="check_total" required="2"/>
164+ </field>
165+ </field>
166+ </record>
167+ </data>
168+</openerp>

Subscribers

People subscribed via source and target branches