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
1=== added directory 'account_invoice_purchase_origin'
2=== added file 'account_invoice_purchase_origin/__init__.py'
3--- account_invoice_purchase_origin/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_invoice_purchase_origin/__init__.py 2014-04-17 13:55:12 +0000
5@@ -0,0 +1,22 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU Affero General Public License as
14+# published by the Free Software Foundation, either version 3 of the
15+# License, or (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU Affero General Public License for more details.
21+#
22+# You should have received a copy of the GNU Affero General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+#
25+##############################################################################
26+
27+import purchase
28
29=== added file 'account_invoice_purchase_origin/__openerp__.py'
30--- account_invoice_purchase_origin/__openerp__.py 1970-01-01 00:00:00 +0000
31+++ account_invoice_purchase_origin/__openerp__.py 2014-04-17 13:55:12 +0000
32@@ -0,0 +1,42 @@
33+# -*- coding: utf-8 -*-
34+##############################################################################
35+#
36+# OpenERP, Open Source Management Solution
37+# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
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+{
55+ 'name': 'Account Invoice Purchase Origin',
56+ 'version': '1.1',
57+ 'category': 'Finance',
58+ 'description': """
59+ This module displays the origin field of account invoice lines and populate
60+ them when an invoice is created from a purchase order
61+ """,
62+ 'author': 'Savoir-faire Linux',
63+ 'website': 'http://www.savoirfairelinux.com/',
64+ 'depends': ['account', 'purchase'],
65+ 'data': [
66+ 'account_invoice_view.xml',
67+ ],
68+ 'test': [
69+ ],
70+ 'demo': [],
71+ 'installable': True,
72+ 'active': False,
73+ 'certificate': False,
74+}
75
76=== added file 'account_invoice_purchase_origin/account_invoice_view.xml'
77--- account_invoice_purchase_origin/account_invoice_view.xml 1970-01-01 00:00:00 +0000
78+++ account_invoice_purchase_origin/account_invoice_view.xml 2014-04-17 13:55:12 +0000
79@@ -0,0 +1,14 @@
80+<?xml version="1.0" encoding="utf-8"?>
81+<openerp>
82+ <data>
83+ <record id="view_invoice_line_tree" model="ir.ui.view">
84+ <field name="model">account.invoice</field>
85+ <field name="inherit_id" ref="account.invoice_supplier_form" />
86+ <field name="arch" type="xml">
87+ <xpath expr="//tree//field[@name='account_analytic_id']" position="after">
88+ <field name="origin" readonly="1" />
89+ </xpath>
90+ </field>
91+ </record>
92+ </data>
93+</openerp>
94
95=== added file 'account_invoice_purchase_origin/purchase.py'
96--- account_invoice_purchase_origin/purchase.py 1970-01-01 00:00:00 +0000
97+++ account_invoice_purchase_origin/purchase.py 2014-04-17 13:55:12 +0000
98@@ -0,0 +1,42 @@
99+# -*- coding: utf-8 -*-
100+##############################################################################
101+#
102+# OpenERP, Open Source Management Solution
103+# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
104+#
105+# This program is free software: you can redistribute it and/or modify
106+# it under the terms of the GNU Affero General Public License as
107+# published by the Free Software Foundation, either version 3 of the
108+# License, or (at your option) any later version.
109+#
110+# This program is distributed in the hope that it will be useful,
111+# but WITHOUT ANY WARRANTY; without even the implied warranty of
112+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
113+# GNU Affero General Public License for more details.
114+#
115+# You should have received a copy of the GNU Affero General Public License
116+# along with this program. If not, see <http://www.gnu.org/licenses/>.
117+#
118+##############################################################################
119+
120+from openerp.osv import orm
121+
122+
123+class purchase_order(orm.Model):
124+
125+ _inherit = 'purchase.order'
126+
127+ def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
128+
129+ return {
130+ 'name': order_line.name,
131+ 'account_id': account_id,
132+ 'price_unit': order_line.price_unit or 0.0,
133+ 'origin': order_line.order_id.name,
134+ 'quantity': order_line.product_qty,
135+ 'product_id': order_line.product_id.id or False,
136+ 'uos_id': order_line.product_uom.id or False,
137+ 'invoice_line_tax_id': [(6, 0, [x.id\
138+ for x in order_line.taxes_id])],
139+ 'account_analytic_id': order_line.account_analytic_id.id or False,
140+ }
141
142=== added directory 'account_invoice_sale_origin'
143=== added file 'account_invoice_sale_origin/__init__.py'
144--- account_invoice_sale_origin/__init__.py 1970-01-01 00:00:00 +0000
145+++ account_invoice_sale_origin/__init__.py 2014-04-17 13:55:12 +0000
146@@ -0,0 +1,22 @@
147+# -*- coding: utf-8 -*-
148+##############################################################################
149+#
150+# OpenERP, Open Source Management Solution
151+# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
152+#
153+# This program is free software: you can redistribute it and/or modify
154+# it under the terms of the GNU Affero General Public License as
155+# published by the Free Software Foundation, either version 3 of the
156+# License, or (at your option) any later version.
157+#
158+# This program is distributed in the hope that it will be useful,
159+# but WITHOUT ANY WARRANTY; without even the implied warranty of
160+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
161+# GNU Affero General Public License for more details.
162+#
163+# You should have received a copy of the GNU Affero General Public License
164+# along with this program. If not, see <http://www.gnu.org/licenses/>.
165+#
166+##############################################################################
167+
168+import sale
169
170=== added file 'account_invoice_sale_origin/__openerp__.py'
171--- account_invoice_sale_origin/__openerp__.py 1970-01-01 00:00:00 +0000
172+++ account_invoice_sale_origin/__openerp__.py 2014-04-17 13:55:12 +0000
173@@ -0,0 +1,43 @@
174+# -*- coding: utf-8 -*-
175+##############################################################################
176+#
177+# OpenERP, Open Source Management Solution
178+# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
179+#
180+# This program is free software: you can redistribute it and/or modify
181+# it under the terms of the GNU Affero General Public License as
182+# published by the Free Software Foundation, either version 3 of the
183+# License, or (at your option) any later version.
184+#
185+# This program is distributed in the hope that it will be useful,
186+# but WITHOUT ANY WARRANTY; without even the implied warranty of
187+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
188+# GNU Affero General Public License for more details.
189+#
190+# You should have received a copy of the GNU Affero General Public License
191+# along with this program. If not, see <http://www.gnu.org/licenses/>.
192+#
193+##############################################################################
194+
195+{
196+ 'name': 'Account Invoice Sale Origin',
197+ 'version': '1.1',
198+ 'category': 'Finance',
199+ 'description': """
200+
201+ This module displays the origin field of account invoice lines and populate
202+ them when a customer invoice is create from a delivery order
203+ """,
204+ 'author': 'Savoir-faire Linux',
205+ 'website': 'http://www.savoirfairelinux.com/',
206+ 'depends': ['account', 'sale'],
207+ 'data': [
208+ 'account_invoice_view.xml',
209+ ],
210+ 'test': [
211+ ],
212+ 'demo': [],
213+ 'installable': True,
214+ 'active': False,
215+ 'certificate': False,
216+}
217
218=== added directory 'account_invoice_sale_origin/account_invoice_purchase_origin'
219=== added file 'account_invoice_sale_origin/account_invoice_purchase_origin/__init__.py'
220--- account_invoice_sale_origin/account_invoice_purchase_origin/__init__.py 1970-01-01 00:00:00 +0000
221+++ account_invoice_sale_origin/account_invoice_purchase_origin/__init__.py 2014-04-17 13:55:12 +0000
222@@ -0,0 +1,22 @@
223+# -*- coding: utf-8 -*-
224+##############################################################################
225+#
226+# OpenERP, Open Source Management Solution
227+# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
228+#
229+# This program is free software: you can redistribute it and/or modify
230+# it under the terms of the GNU Affero General Public License as
231+# published by the Free Software Foundation, either version 3 of the
232+# License, or (at your option) any later version.
233+#
234+# This program is distributed in the hope that it will be useful,
235+# but WITHOUT ANY WARRANTY; without even the implied warranty of
236+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
237+# GNU Affero General Public License for more details.
238+#
239+# You should have received a copy of the GNU Affero General Public License
240+# along with this program. If not, see <http://www.gnu.org/licenses/>.
241+#
242+##############################################################################
243+
244+import purchase
245
246=== added file 'account_invoice_sale_origin/account_invoice_purchase_origin/__openerp__.py'
247--- account_invoice_sale_origin/account_invoice_purchase_origin/__openerp__.py 1970-01-01 00:00:00 +0000
248+++ account_invoice_sale_origin/account_invoice_purchase_origin/__openerp__.py 2014-04-17 13:55:12 +0000
249@@ -0,0 +1,42 @@
250+# -*- coding: utf-8 -*-
251+##############################################################################
252+#
253+# OpenERP, Open Source Management Solution
254+# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
255+#
256+# This program is free software: you can redistribute it and/or modify
257+# it under the terms of the GNU Affero General Public License as
258+# published by the Free Software Foundation, either version 3 of the
259+# License, or (at your option) any later version.
260+#
261+# This program is distributed in the hope that it will be useful,
262+# but WITHOUT ANY WARRANTY; without even the implied warranty of
263+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
264+# GNU Affero General Public License for more details.
265+#
266+# You should have received a copy of the GNU Affero General Public License
267+# along with this program. If not, see <http://www.gnu.org/licenses/>.
268+#
269+##############################################################################
270+
271+{
272+ 'name': 'Account Invoice Purchase Origin',
273+ 'version': '1.1',
274+ 'category': 'Finance',
275+ 'description': """
276+ This module displays the origin field of account invoice lines and populate
277+ them when an invoice is created from a purchase order
278+ """,
279+ 'author': 'Savoir-faire Linux',
280+ 'website': 'http://www.savoirfairelinux.com/',
281+ 'depends': ['account', 'purchase'],
282+ 'data': [
283+ 'account_invoice_view.xml',
284+ ],
285+ 'test': [
286+ ],
287+ 'demo': [],
288+ 'installable': True,
289+ 'active': False,
290+ 'certificate': False,
291+}
292
293=== added file 'account_invoice_sale_origin/account_invoice_purchase_origin/account_invoice_view.xml'
294--- account_invoice_sale_origin/account_invoice_purchase_origin/account_invoice_view.xml 1970-01-01 00:00:00 +0000
295+++ account_invoice_sale_origin/account_invoice_purchase_origin/account_invoice_view.xml 2014-04-17 13:55:12 +0000
296@@ -0,0 +1,14 @@
297+<?xml version="1.0" encoding="utf-8"?>
298+<openerp>
299+ <data>
300+ <record id="view_invoice_line_tree" model="ir.ui.view">
301+ <field name="model">account.invoice</field>
302+ <field name="inherit_id" ref="account.invoice_supplier_form" />
303+ <field name="arch" type="xml">
304+ <xpath expr="//tree//field[@name='account_analytic_id']" position="after">
305+ <field name="origin" readonly="1" />
306+ </xpath>
307+ </field>
308+ </record>
309+ </data>
310+</openerp>
311
312=== added file 'account_invoice_sale_origin/account_invoice_purchase_origin/purchase.py'
313--- account_invoice_sale_origin/account_invoice_purchase_origin/purchase.py 1970-01-01 00:00:00 +0000
314+++ account_invoice_sale_origin/account_invoice_purchase_origin/purchase.py 2014-04-17 13:55:12 +0000
315@@ -0,0 +1,42 @@
316+# -*- coding: utf-8 -*-
317+##############################################################################
318+#
319+# OpenERP, Open Source Management Solution
320+# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
321+#
322+# This program is free software: you can redistribute it and/or modify
323+# it under the terms of the GNU Affero General Public License as
324+# published by the Free Software Foundation, either version 3 of the
325+# License, or (at your option) any later version.
326+#
327+# This program is distributed in the hope that it will be useful,
328+# but WITHOUT ANY WARRANTY; without even the implied warranty of
329+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
330+# GNU Affero General Public License for more details.
331+#
332+# You should have received a copy of the GNU Affero General Public License
333+# along with this program. If not, see <http://www.gnu.org/licenses/>.
334+#
335+##############################################################################
336+
337+from openerp.osv import orm
338+
339+
340+class purchase_order(orm.Model):
341+
342+ _inherit = 'purchase.order'
343+
344+ def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
345+
346+ return {
347+ 'name': order_line.name,
348+ 'account_id': account_id,
349+ 'price_unit': order_line.price_unit or 0.0,
350+ 'origin': order_line.order_id.name,
351+ 'quantity': order_line.product_qty,
352+ 'product_id': order_line.product_id.id or False,
353+ 'uos_id': order_line.product_uom.id or False,
354+ 'invoice_line_tax_id': [(6, 0, [x.id\
355+ for x in order_line.taxes_id])],
356+ 'account_analytic_id': order_line.account_analytic_id.id or False,
357+ }
358
359=== added file 'account_invoice_sale_origin/account_invoice_view.xml'
360--- account_invoice_sale_origin/account_invoice_view.xml 1970-01-01 00:00:00 +0000
361+++ account_invoice_sale_origin/account_invoice_view.xml 2014-04-17 13:55:12 +0000
362@@ -0,0 +1,14 @@
363+<?xml version="1.0" encoding="utf-8"?>
364+<openerp>
365+ <data>
366+ <record id="view_invoice_line_tree" model="ir.ui.view">
367+ <field name="model">account.invoice</field>
368+ <field name="inherit_id" ref="account.invoice_supplier_form" />
369+ <field name="arch" type="xml">
370+ <xpath expr="//tree//field[@name='account_analytic_id']" position="after">
371+ <field name="origin" readonly="1" />
372+ </xpath>
373+ </field>
374+ </record>
375+ </data>
376+</openerp>
377
378=== added file 'account_invoice_sale_origin/purchase.py'
379--- account_invoice_sale_origin/purchase.py 1970-01-01 00:00:00 +0000
380+++ account_invoice_sale_origin/purchase.py 2014-04-17 13:55:12 +0000
381@@ -0,0 +1,42 @@
382+# -*- coding: utf-8 -*-
383+##############################################################################
384+#
385+# OpenERP, Open Source Management Solution
386+# Copyright (c) 2010-2013 Savoir-faire Linux. All Rights Reserved.
387+#
388+# This program is free software: you can redistribute it and/or modify
389+# it under the terms of the GNU Affero General Public License as
390+# published by the Free Software Foundation, either version 3 of the
391+# License, or (at your option) any later version.
392+#
393+# This program is distributed in the hope that it will be useful,
394+# but WITHOUT ANY WARRANTY; without even the implied warranty of
395+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
396+# GNU Affero General Public License for more details.
397+#
398+# You should have received a copy of the GNU Affero General Public License
399+# along with this program. If not, see <http://www.gnu.org/licenses/>.
400+#
401+##############################################################################
402+
403+from openerp.osv import orm
404+
405+
406+class purchase_order(orm.Model):
407+
408+ _inherit = 'purchase.order'
409+
410+ def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
411+
412+ return {
413+ 'name': order_line.name,
414+ 'account_id': account_id,
415+ 'price_unit': order_line.price_unit or 0.0,
416+ 'origin': order_line.order_id.name,
417+ 'quantity': order_line.product_qty,
418+ 'product_id': order_line.product_id.id or False,
419+ 'uos_id': order_line.product_uom.id or False,
420+ 'invoice_line_tax_id': [(6, 0, [x.id\
421+ for x in order_line.taxes_id])],
422+ 'account_analytic_id': order_line.account_analytic_id.id or False,
423+ }

Subscribers

People subscribed via source and target branches