Merge lp:~elbati/account-invoicing/adding_account_invoice_force_number into lp:~account-core-editors/account-invoicing/6.1

Proposed by Lorenzo Battistini
Status: Merged
Merge reported by: Joël Grand-Guillaume @ camptocamp
Merged at revision: not available
Proposed branch: lp:~elbati/account-invoicing/adding_account_invoice_force_number
Merge into: lp:~account-core-editors/account-invoicing/6.1
Diff against target: 235 lines (+199/-0)
7 files modified
account_invoice_force_number/AUTHORS.txt (+1/-0)
account_invoice_force_number/__init__.py (+22/-0)
account_invoice_force_number/__openerp__.py (+40/-0)
account_invoice_force_number/i18n/account_invoice_force_number.pot (+41/-0)
account_invoice_force_number/i18n/it.po (+47/-0)
account_invoice_force_number/invoice.py (+30/-0)
account_invoice_force_number/invoice_view.xml (+18/-0)
To merge this branch: bzr merge lp:~elbati/account-invoicing/adding_account_invoice_force_number
Reviewer Review Type Date Requested Status
Niels Huylebroeck (community) Approve
Stefan Rijnhart (Opener) code reading Approve
Review via email: mp+134758@code.launchpad.net

Description of the change

This module allows to force the invoice numbering.
    It displays the internal_number field. If user fills that field, the typed value will be used as invoice (and move) number. Otherwise, the next sequence number will be retrieved and saved.
    So, the new field has to be used when user doesn't want to use the default invoice numbering for a specific invoice

To post a comment you must log in.
13. By Lorenzo Battistini

[FIX] header

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

Code looks good.

review: Approve (code reading)
Revision history for this message
Niels Huylebroeck (red15) wrote :

If this is for v7.0 you have to drop the <field name="type">form</field> line because it will complain about this. If meant for multiple versions it's ok to leave this in, as v7 will "only" complain about it (but v6 would error if it's not there)

Another small remark I have is that your xpath expression might be a bit too specific, the question is do we want it to work or do we want to get an error when the view is not 100% what we expected ?

I would suggest we avoid errors for the user and we try to work with as many views as possible (even if view might not look really good, the field would still be shown and no error) My suggestion for the xpath in question :"//field[@name='fiscal_position']" )

review: Approve
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Ok, he propose this to be merged in v6.1 so I merge it. We'll create soon the 7.0 series where you'll be able to correct that.

Thank for review !

Regards,

Joël

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_invoice_force_number'
2=== added file 'account_invoice_force_number/AUTHORS.txt'
3--- account_invoice_force_number/AUTHORS.txt 1970-01-01 00:00:00 +0000
4+++ account_invoice_force_number/AUTHORS.txt 2012-11-16 23:37:19 +0000
5@@ -0,0 +1,1 @@
6+Lorenzo Battistini <lorenzo.battistini@agilebg.com>
7
8=== added file 'account_invoice_force_number/__init__.py'
9--- account_invoice_force_number/__init__.py 1970-01-01 00:00:00 +0000
10+++ account_invoice_force_number/__init__.py 2012-11-16 23:37:19 +0000
11@@ -0,0 +1,22 @@
12+# -*- coding: utf-8 -*-
13+##############################################################################
14+#
15+# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
16+# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
17+# All Rights Reserved
18+#
19+# This program is free software: you can redistribute it and/or modify
20+# it under the terms of the GNU Affero General Public License as published
21+# by the Free Software Foundation, either version 3 of the License, or
22+# (at your option) any later version.
23+#
24+# This program is distributed in the hope that it will be useful,
25+# but WITHOUT ANY WARRANTY; without even the implied warranty of
26+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27+# GNU Affero General Public License for more details.
28+#
29+# You should have received a copy of the GNU Affero General Public License
30+# along with this program. If not, see <http://www.gnu.org/licenses/>.
31+#
32+##############################################################################
33+import invoice
34
35=== added file 'account_invoice_force_number/__openerp__.py'
36--- account_invoice_force_number/__openerp__.py 1970-01-01 00:00:00 +0000
37+++ account_invoice_force_number/__openerp__.py 2012-11-16 23:37:19 +0000
38@@ -0,0 +1,40 @@
39+# -*- coding: utf-8 -*-
40+##############################################################################
41+#
42+# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
43+# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
44+# All Rights Reserved
45+#
46+# This program is free software: you can redistribute it and/or modify
47+# it under the terms of the GNU Affero General Public License as published
48+# by the Free Software Foundation, either version 3 of the License, or
49+# (at your option) any later version.
50+#
51+# This program is distributed in the hope that it will be useful,
52+# but WITHOUT ANY WARRANTY; without even the implied warranty of
53+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54+# GNU Affero General Public License for more details.
55+#
56+# You should have received a copy of the GNU Affero General Public License
57+# along with this program. If not, see <http://www.gnu.org/licenses/>.
58+#
59+##############################################################################
60+{
61+ 'name': "Force Invoice Number",
62+ 'version': '0.1',
63+ 'category': 'Generic Modules/Accounting',
64+ 'description': """
65+ This module allows to force the invoice numbering.
66+ It displays the internal_number field. If user fills that field, the typed value will be used as invoice (and move) number. Otherwise, the next sequence number will be retrieved and saved.
67+ So, the new field has to be used when user doesn't want to use the default invoice numbering for a specific invoice.
68+ """,
69+ 'author': 'Agile Business Group & Domsense',
70+ 'website': 'http://www.agilebg.com',
71+ 'license': 'AGPL-3',
72+ "depends" : ['account'],
73+ "init_xml" : [],
74+ "update_xml" : ['invoice_view.xml'],
75+ "demo_xml" : [],
76+ "active": False,
77+ "installable": True
78+}
79
80=== added directory 'account_invoice_force_number/i18n'
81=== added file 'account_invoice_force_number/i18n/account_invoice_force_number.pot'
82--- account_invoice_force_number/i18n/account_invoice_force_number.pot 1970-01-01 00:00:00 +0000
83+++ account_invoice_force_number/i18n/account_invoice_force_number.pot 2012-11-16 23:37:19 +0000
84@@ -0,0 +1,41 @@
85+# Translation of OpenERP Server.
86+# This file contains the translation of the following modules:
87+# * account_invoice_force_number
88+#
89+msgid ""
90+msgstr ""
91+"Project-Id-Version: OpenERP Server 6.0.3\n"
92+"Report-Msgid-Bugs-To: support@openerp.com\n"
93+"POT-Creation-Date: 2011-11-16 16:44+0000\n"
94+"PO-Revision-Date: 2011-11-16 16:44+0000\n"
95+"Last-Translator: <>\n"
96+"Language-Team: \n"
97+"MIME-Version: 1.0\n"
98+"Content-Type: text/plain; charset=UTF-8\n"
99+"Content-Transfer-Encoding: \n"
100+"Plural-Forms: \n"
101+
102+#. module: account_invoice_force_number
103+#: view:account.invoice:0
104+msgid "Force Number"
105+msgstr ""
106+
107+#. module: account_invoice_force_number
108+#: model:ir.module.module,description:account_invoice_force_number.module_meta_information
109+msgid "\n"
110+" This module allows to force the invoice numbering.\n"
111+" It displays the internal_number field. If user fills that field, the typed value will be used as invoice (and move) number. Otherwise, the next sequence sequence number will be retrieved and saved.\n"
112+" So, the new field has to be used when user doesn't want to use the default invoice numbering for a specific invoice.\n"
113+" "
114+msgstr ""
115+
116+#. module: account_invoice_force_number
117+#: model:ir.module.module,shortdesc:account_invoice_force_number.module_meta_information
118+msgid "Force Invoice Number"
119+msgstr ""
120+
121+#. module: account_invoice_force_number
122+#: model:ir.model,name:account_invoice_force_number.model_account_invoice
123+msgid "Invoice"
124+msgstr ""
125+
126
127=== added file 'account_invoice_force_number/i18n/it.po'
128--- account_invoice_force_number/i18n/it.po 1970-01-01 00:00:00 +0000
129+++ account_invoice_force_number/i18n/it.po 2012-11-16 23:37:19 +0000
130@@ -0,0 +1,47 @@
131+# Translation of OpenERP Server.
132+# This file contains the translation of the following modules:
133+# * account_invoice_force_number
134+#
135+msgid ""
136+msgstr ""
137+"Project-Id-Version: OpenERP Server 6.0.3\n"
138+"Report-Msgid-Bugs-To: support@openerp.com\n"
139+"POT-Creation-Date: 2011-11-17 15:20+0000\n"
140+"PO-Revision-Date: 2011-11-17 16:29+0100\n"
141+"Last-Translator: Lorenzo Battistini <lorenzo.battistini@agilebg.com>\n"
142+"Language-Team: \n"
143+"MIME-Version: 1.0\n"
144+"Content-Type: text/plain; charset=UTF-8\n"
145+"Content-Transfer-Encoding: 8bit\n"
146+"Plural-Forms: \n"
147+
148+#. module: account_invoice_force_number
149+#: view:account.invoice:0
150+msgid "Force Number"
151+msgstr "Forza numero"
152+
153+#. module: account_invoice_force_number
154+#: model:ir.module.module,description:account_invoice_force_number.module_meta_information
155+msgid ""
156+"\n"
157+" This module allows to force the invoice numbering.\n"
158+" It displays the internal_number field. If user fills that field, the typed value will be used as invoice (and move) number. Otherwise, the next sequence sequence number will be retrieved and saved.\n"
159+" So, the new field has to be used when user doesn't want to use the default invoice numbering for a specific invoice.\n"
160+" "
161+msgstr ""
162+"\n"
163+" This module allows to force the invoice numbering.\n"
164+" It displays the internal_number field. If user fills that field, the typed value will be used as invoice (and move) number. Otherwise, the next sequence sequence number will be retrieved and saved.\n"
165+" So, the new field has to be used when user doesn't want to use the default invoice numbering for a specific invoice.\n"
166+" "
167+
168+#. module: account_invoice_force_number
169+#: model:ir.module.module,shortdesc:account_invoice_force_number.module_meta_information
170+msgid "Force Invoice Number"
171+msgstr "Forza numero fattura"
172+
173+#. module: account_invoice_force_number
174+#: model:ir.model,name:account_invoice_force_number.model_account_invoice
175+msgid "Invoice"
176+msgstr "Fattura"
177+
178
179=== added file 'account_invoice_force_number/invoice.py'
180--- account_invoice_force_number/invoice.py 1970-01-01 00:00:00 +0000
181+++ account_invoice_force_number/invoice.py 2012-11-16 23:37:19 +0000
182@@ -0,0 +1,30 @@
183+# -*- coding: utf-8 -*-
184+##############################################################################
185+#
186+# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
187+# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
188+# All Rights Reserved
189+#
190+# This program is free software: you can redistribute it and/or modify
191+# it under the terms of the GNU Affero General Public License as published
192+# by the Free Software Foundation, either version 3 of the License, or
193+# (at your option) any later version.
194+#
195+# This program is distributed in the hope that it will be useful,
196+# but WITHOUT ANY WARRANTY; without even the implied warranty of
197+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
198+# GNU Affero General Public License for more details.
199+#
200+# You should have received a copy of the GNU Affero General Public License
201+# along with this program. If not, see <http://www.gnu.org/licenses/>.
202+#
203+##############################################################################
204+
205+from osv import fields, osv
206+
207+class account_invoice(osv.osv):
208+ _inherit = "account.invoice"
209+ _columns = {
210+ 'internal_number': fields.char('Invoice Number', size=32, readonly=True, states={'draft':[('readonly',False)]}),
211+ }
212+account_invoice()
213
214=== added file 'account_invoice_force_number/invoice_view.xml'
215--- account_invoice_force_number/invoice_view.xml 1970-01-01 00:00:00 +0000
216+++ account_invoice_force_number/invoice_view.xml 2012-11-16 23:37:19 +0000
217@@ -0,0 +1,18 @@
218+<?xml version="1.0" encoding="utf-8"?>
219+<openerp>
220+<data>
221+
222+ <record model="ir.ui.view" id="account_invoice_form_int_number">
223+ <field name="name">account.invoice.form.int_number</field>
224+ <field name="model">account.invoice</field>
225+ <field name="inherit_id" ref="account.invoice_form"/>
226+ <field name="type">form</field>
227+ <field name="arch" type="xml">
228+ <xpath expr="/form/group/field[@name='fiscal_position']" position="after">
229+ <field name="internal_number" attrs="{'invisible':[('state','!=','draft')]}" string="Force Number" help="Force invoice number. Use this field if you don't want to use the default numbering"/>
230+ </xpath>
231+ </field>
232+ </record>
233+
234+</data>
235+</openerp>

Subscribers

People subscribed via source and target branches