Merge lp:~agilebg/account-invoicing/imp_account_invoice_force_number_7 into lp:~account-core-editors/account-invoicing/7.0

Proposed by Alex Comba - Agile BG
Status: Merged
Merged at revision: 23
Proposed branch: lp:~agilebg/account-invoicing/imp_account_invoice_force_number_7
Merge into: lp:~account-core-editors/account-invoicing/7.0
Diff against target: 135 lines (+34/-28)
5 files modified
account_invoice_force_number/AUTHORS.txt (+0/-1)
account_invoice_force_number/__init__.py (+3/-3)
account_invoice_force_number/__openerp__.py (+16/-11)
account_invoice_force_number/invoice.py (+13/-9)
account_invoice_force_number/invoice_view.xml (+2/-4)
To merge this branch: bzr merge lp:~agilebg/account-invoicing/imp_account_invoice_force_number_7
Reviewer Review Type Date Requested Status
Lorenzo Battistini (community) Approve
Guewen Baconnier @ Camptocamp code review, no test Approve
Leonardo Pistone Needs Fixing
Review via email: mp+182634@code.launchpad.net

Description of the change

This branch contains some improvements/fixings concerning the module account_invoice_force_number, in particular:

# got module installable
# fixed wrong xpath values

To post a comment you must log in.
Revision history for this message
Leonardo Pistone (lepistone) wrote :

Thanks Alex.

Could you please pep8 a couple things, like the space before the colon and the long line?

review: Needs Fixing
23. By Alex Comba - Agile BG

[FIX] PEP8 style

24. By Alex Comba - Agile BG

[FIX] PEP8 style: lines too long

Revision history for this message
Alex Comba - Agile BG (tafaru) wrote :

Thanks Leonardo,

now it should be more PEP8 compliant ;)

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Lorenzo Battistini (elbati) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'account_invoice_force_number/AUTHORS.txt'
2--- account_invoice_force_number/AUTHORS.txt 2012-11-16 23:29:22 +0000
3+++ account_invoice_force_number/AUTHORS.txt 1970-01-01 00:00:00 +0000
4@@ -1,1 +0,0 @@
5-Lorenzo Battistini <lorenzo.battistini@agilebg.com>
6
7=== modified file 'account_invoice_force_number/__init__.py'
8--- account_invoice_force_number/__init__.py 2012-11-16 23:34:54 +0000
9+++ account_invoice_force_number/__init__.py 2013-08-28 14:17:58 +0000
10@@ -1,9 +1,9 @@
11 # -*- coding: utf-8 -*-
12 ##############################################################################
13-#
14-# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
15+#
16 # Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
17-# All Rights Reserved
18+# Copyright (C) 2011-2013 Agile Business Group sagl
19+# (<http://www.agilebg.com>)
20 #
21 # This program is free software: you can redistribute it and/or modify
22 # it under the terms of the GNU Affero General Public License as published
23
24=== modified file 'account_invoice_force_number/__openerp__.py'
25--- account_invoice_force_number/__openerp__.py 2013-04-03 14:37:57 +0000
26+++ account_invoice_force_number/__openerp__.py 2013-08-28 14:17:58 +0000
27@@ -1,9 +1,9 @@
28 # -*- coding: utf-8 -*-
29 ##############################################################################
30-#
31-# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
32+#
33 # Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
34-# All Rights Reserved
35+# Copyright (C) 2011-2013 Agile Business Group sagl
36+# (<http://www.agilebg.com>)
37 #
38 # This program is free software: you can redistribute it and/or modify
39 # it under the terms of the GNU Affero General Public License as published
40@@ -24,17 +24,22 @@
41 'version': '0.1',
42 'category': 'Generic Modules/Accounting',
43 'description': """
44- This module allows to force the invoice numbering.
45- 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.
46- So, the new field has to be used when user doesn't want to use the default invoice numbering for a specific invoice.
47+This module allows to force the invoice numbering.
48+It displays the internal_number field. If user fills that field, the typed
49+value will be used as invoice (and move) number.
50+Otherwise, the next sequence number will be retrieved and saved.
51+So, the new field has to be used when user doesn't want to use the default
52+invoice numbering for a specific invoice.
53 """,
54 'author': 'Agile Business Group',
55 'website': 'http://www.agilebg.com',
56 'license': 'AGPL-3',
57- "depends" : ['account'],
58- "init_xml" : [],
59- "update_xml" : ['invoice_view.xml'],
60- "demo_xml" : [],
61+ "depends": [
62+ 'account'
63+ ],
64+ "data": [
65+ 'invoice_view.xml'
66+ ],
67 "active": False,
68- "installable": False
69+ "installable": True
70 }
71
72=== modified file 'account_invoice_force_number/invoice.py'
73--- account_invoice_force_number/invoice.py 2012-11-16 23:34:54 +0000
74+++ account_invoice_force_number/invoice.py 2013-08-28 14:17:58 +0000
75@@ -1,9 +1,11 @@
76 # -*- coding: utf-8 -*-
77 ##############################################################################
78-#
79-# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
80+#
81 # Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
82-# All Rights Reserved
83+# Copyright (C) 2011-2013 Agile Business Group sagl
84+# (<http://www.agilebg.com>)
85+# @author Lorenzo Battistini <lorenzo.battistini@agilebg.com>
86+# Ported to OpenERP 7.0 by Alex Comba <alex.comba@agilebg.com>
87 #
88 # This program is free software: you can redistribute it and/or modify
89 # it under the terms of the GNU Affero General Public License as published
90@@ -20,11 +22,13 @@
91 #
92 ##############################################################################
93
94-from osv import fields, osv
95-
96-class account_invoice(osv.osv):
97+from openerp.osv import fields, orm
98+
99+
100+class account_invoice(orm.Model):
101 _inherit = "account.invoice"
102 _columns = {
103- 'internal_number': fields.char('Invoice Number', size=32, readonly=True, states={'draft':[('readonly',False)]}),
104- }
105-account_invoice()
106+ 'internal_number': fields.char(
107+ 'Invoice Number', size=32, readonly=True,
108+ states={'draft': [('readonly', False)]}),
109+ }
110
111=== modified file 'account_invoice_force_number/invoice_view.xml'
112--- account_invoice_force_number/invoice_view.xml 2013-02-21 18:25:56 +0000
113+++ account_invoice_force_number/invoice_view.xml 2013-08-28 14:17:58 +0000
114@@ -6,9 +6,8 @@
115 <field name="name">account.invoice.form.int_number</field>
116 <field name="model">account.invoice</field>
117 <field name="inherit_id" ref="account.invoice_form"/>
118- <field name="type">form</field>
119 <field name="arch" type="xml">
120- <xpath expr="/form/group/field[@name='fiscal_position']" position="after">
121+ <xpath expr="//sheet/group/group/field[@name='fiscal_position']" position="after">
122 <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"/>
123 </xpath>
124 </field>
125@@ -18,9 +17,8 @@
126 <field name="name">account.invoice.supplier.form.int_number</field>
127 <field name="model">account.invoice</field>
128 <field name="inherit_id" ref="account.invoice_supplier_form"/>
129- <field name="type">form</field>
130 <field name="arch" type="xml">
131- <xpath expr="/form/group/field[@name='fiscal_position']" position="after">
132+ <xpath expr="//sheet/group/group/field[@name='fiscal_position']" position="after">
133 <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"/>
134 </xpath>
135 </field>

Subscribers

People subscribed via source and target branches