Merge lp:~lin-yu/account-invoicing/add_account_invoce_line into lp:~account-core-editors/account-invoicing/7.0

Proposed by LIN Yu
Status: Work in progress
Proposed branch: lp:~lin-yu/account-invoicing/add_account_invoce_line
Merge into: lp:~account-core-editors/account-invoicing/7.0
Diff against target: 471 lines (+433/-0)
6 files modified
account_invoice_line/__init__.py (+25/-0)
account_invoice_line/__openerp__.py (+49/-0)
account_invoice_line/account.py (+90/-0)
account_invoice_line/account_view.xml (+158/-0)
account_invoice_line/i18n/zh_CN.po (+95/-0)
account_invoice_line/static/description/index.html (+16/-0)
To merge this branch: bzr merge lp:~lin-yu/account-invoicing/add_account_invoce_line
Reviewer Review Type Date Requested Status
Joël Grand-Guillaume @ camptocamp code review, no tests Disapprove
Review via email: mp+182531@code.launchpad.net

This proposal supersedes a proposal from 2013-08-26.

Description of the change

[ADD] Module account invoice line

Invoice Line
==================================================
* Create a menu for read Only list View of account invoice line
* Add part of invoice header infomation in invoice line list view

To post a comment you must log in.
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote : Posted in a previous version of this proposal

Hello,

At first glance I have the feeling this account_invoice_line module is doing many different things. Perhaps is it better to split it in separate modules with narrower goals?

Regards,

-sbi

Revision history for this message
LIN Yu (lin-yu) wrote : Posted in a previous version of this proposal

Hello Stéphanie,

I have removed non relevant fields and views and resubmit the proposal,
please review it.

Best regards,
LIN Yu

On 08/27/2013 02:51 PM, Stéphane Bidoul (Acsone) wrote:
> Hello,
>
> At first glance I have the feeling this account_invoice_line module is doing many different things. Perhaps is it better to split it in separate modules with narrower goals?
>
> Regards,
>
> -sbi

--
LIN Yu

LIN Yu
/Project Manager/
--
*Elico Corporation, Shanghai
/OpenERP Premium Certified Training Partner/ *
Cell: + 86 186 1691 1351
Office: + 86 21 6211 8017/27
Skype: llccluf
<email address hidden> <mailto:<email address hidden>>
http://www.elico-corp.com

Elico Corp

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

Dear Lin,

Thank you for this contribs ! At first glance, the view in "Reporting -> Accounting -> Invoicing" or something like this seems to provide that feature or am I wrong ?

I rather prefer to have a module that extend this feature then, for that reason i disapprove the MP.

If you have any good reason not to do it there, please let us knoe !

Regards,

Joël

review: Disapprove (code review, no tests)

Unmerged revisions

20. By LIN Yu

[FIX] Change Module account_invoice_line: remove non relevent functions

19. By LIN Yu

[ADD] account_invoice_line

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_invoice_line'
2=== added file 'account_invoice_line/__init__.py'
3--- account_invoice_line/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_invoice_line/__init__.py 2013-08-28 02:14:15 +0000
5@@ -0,0 +1,25 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
11+# Author: Andy Lu <andy.lu@elico-corp.com>
12+#
13+# This program is free software: you can redistribute it and/or modify
14+# it under the terms of the GNU Affero General Public License as
15+# published by the Free Software Foundation, either version 3 of the
16+# License, or (at your option) any later version.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU Affero General Public License for more details.
22+#
23+# You should have received a copy of the GNU Affero General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+#
26+##############################################################################
27+
28+import account
29+
30+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
31\ No newline at end of file
32
33=== added file 'account_invoice_line/__openerp__.py'
34--- account_invoice_line/__openerp__.py 1970-01-01 00:00:00 +0000
35+++ account_invoice_line/__openerp__.py 2013-08-28 02:14:15 +0000
36@@ -0,0 +1,49 @@
37+# -*- coding: utf-8 -*-
38+##############################################################################
39+#
40+# OpenERP, Open Source Management Solution
41+# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
42+# Author: LIN Yu <lin.yu@elico-corp.com>
43+#
44+# This program is free software: you can redistribute it and/or modify
45+# it under the terms of the GNU Affero General Public License as
46+# published by the Free Software Foundation, either version 3 of the
47+# License, or (at your option) any later version.
48+#
49+# This program is distributed in the hope that it will be useful,
50+# but WITHOUT ANY WARRANTY; without even the implied warranty of
51+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52+# GNU Affero General Public License for more details.
53+#
54+# You should have received a copy of the GNU Affero General Public License
55+# along with this program. If not, see <http://www.gnu.org/licenses/>.
56+#
57+##############################################################################
58+
59+{
60+ 'name': 'Invoice Line',
61+ 'version': '1.1',
62+ 'category': 'Account',
63+ 'sequence': 19,
64+ 'summary': 'Invoice line',
65+ 'description': """
66+Invoice Line
67+==================================================
68+* Create a menu for read Only list View of account invoice line
69+* Add part of invoice header infomation in invoice line list view
70+ """,
71+ 'author': 'Elico Corp',
72+ 'website': 'http://www.elico-corp.com',
73+ 'images' : [],
74+ 'depends': ['account'],
75+ 'data': [
76+ 'account_view.xml',
77+ ],
78+ 'test': [],
79+ 'demo': [],
80+ 'installable': True,
81+ 'auto_install': False,
82+ 'application': False,
83+}
84+
85+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
86\ No newline at end of file
87
88=== added file 'account_invoice_line/account.py'
89--- account_invoice_line/account.py 1970-01-01 00:00:00 +0000
90+++ account_invoice_line/account.py 2013-08-28 02:14:15 +0000
91@@ -0,0 +1,90 @@
92+# -*- coding: utf-8 -*-
93+##############################################################################
94+#
95+# OpenERP, Open Source Management Solution
96+# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
97+# Author: LIN Yu <lin.yu@elico-corp.com>
98+#
99+# This program is free software: you can redistribute it and/or modify
100+# it under the terms of the GNU Affero General Public License as
101+# published by the Free Software Foundation, either version 3 of the
102+# License, or (at your option) any later version.
103+#
104+# This program is distributed in the hope that it will be useful,
105+# but WITHOUT ANY WARRANTY; without even the implied warranty of
106+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
107+# GNU Affero General Public License for more details.
108+#
109+# You should have received a copy of the GNU Affero General Public License
110+# along with this program. If not, see <http://www.gnu.org/licenses/>.
111+#
112+##############################################################################
113+
114+from osv import osv, fields
115+from tools.translate import _
116+import openerp.addons.decimal_precision as dp
117+import time
118+
119+class account_invoice(osv.osv):
120+ _inherit = "account.invoice"
121+
122+ def _get_reference_type(self, cr, uid, context=None):
123+ return [('none', _('Free Reference'))] #,
124+
125+ _columns = {
126+ 'supplier_invoice_number': fields.char('Supplier Inv Ref', size=64, help="The reference of this invoice as provided by the supplier."),
127+ 'partner_ref': fields.related('partner_id','ref',type='char', size=64, string='Partner Ref'),
128+ 'reference_type': fields.selection(_get_reference_type, 'Payment Reference',
129+ required=True, readonly=True, states={'draft':[('readonly',False)]}),
130+ }
131+account_invoice()
132+
133+class account_invoice_line(osv.osv):
134+ _inherit = "account.invoice.line"
135+
136+ def _amount_line_with_tax(self, cr, uid, ids, prop, arg, context=None):
137+ res = {}
138+ tax_obj = self.pool.get('account.tax')
139+ cur_obj = self.pool.get('res.currency')
140+ for line in self.browse(cr, uid, ids, context=context):
141+ price = line.price_unit * (1-(line.discount or 0.0)/100.0)
142+ taxes = tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, price, line.quantity, product=line.product_id, partner=line.invoice_id.partner_id, force_excluded=True)
143+ res[line.id] = taxes['total']
144+ if line.invoice_id:
145+ cur = line.invoice_id.currency_id
146+ res[line.id] = cur_obj.round(cr, uid, cur, res[line.id])
147+ return res
148+
149+ _columns = {
150+ 'amount_subtotal': fields.function(_amount_line_with_tax, string='Amount (Inc. Tax)', type='float', digits_compute=dp.get_precision('Account')),
151+ 'partner_ref': fields.related(
152+ 'partner_id', 'ref',
153+ type='char', size=64,relation='res.partner',
154+ string='Partner Ref',select=1),
155+ 'type': fields.related(
156+ 'invoice_id', 'type',
157+ type='char', size=64,relation='account.invoice',
158+ string='Type'),
159+ 'number': fields.related(
160+ 'invoice_id', 'number',
161+ type='char', size=64,relation='account.invoice',
162+ string='Number',select=1),
163+ 'supplier_invoice_number': fields.related(
164+ 'invoice_id', 'supplier_invoice_number',
165+ type='char', size=64,relation='account.invoice',
166+ string='Supplier Inv Ref',select=1),
167+ 'date_invoice': fields.related(
168+ 'invoice_id', 'date_invoice',
169+ type='date', relation='account.invoice',
170+ string='Date Invoice',select=1),
171+ 'state': fields.related(
172+ 'invoice_id', 'state',
173+ type='char', size=16,relation='account.invoice',
174+ string='State'),
175+ 'reference': fields.related(
176+ 'invoice_id', 'reference',
177+ type='char', size=16,relation='account.invoice',
178+ string='Reference'),
179+ }
180+account_invoice_line()
181+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
182
183=== added file 'account_invoice_line/account_view.xml'
184--- account_invoice_line/account_view.xml 1970-01-01 00:00:00 +0000
185+++ account_invoice_line/account_view.xml 2013-08-28 02:14:15 +0000
186@@ -0,0 +1,158 @@
187+<?xml version="1.0" encoding="UTF-8"?>
188+<openerp>
189+ <data>
190+ <!-- Invoice Line by LY-->
191+
192+ <record id="account_invoice_line_tree" model="ir.ui.view">
193+ <field name="name">account_invoice_line_tree</field>
194+ <field name="model">account.invoice.line</field>
195+ <field name="inherit_id" ref="account.view_invoice_line_tree"/>
196+ <field name="arch" type="xml">
197+
198+ <xpath expr="/tree" position="attributes">
199+ <attribute name="create">0</attribute>
200+ <attribute name="delete">0</attribute>
201+ </xpath>
202+ <xpath expr="/tree/field[@name='name']" position="before">
203+ <field name="partner_ref"/>
204+ <field name="partner_id"/>
205+ <field name="supplier_invoice_number"/>
206+ <field name="number"/>
207+ <field name="date_invoice"/>
208+ <field name="invoice_id" invisible='1'/>
209+ <field name="origin"/>
210+ </xpath>
211+ <xpath expr="/tree/field[@name='quantity']" position="replace">
212+ <field name="product_id"/>
213+ <field name="quantity" sum="Quantity"/>
214+ </xpath>
215+ <xpath expr="//field[@name='price_subtotal']" position="replace">
216+ <field name="amount_subtotal" sum="Amount"/>
217+ <field name="amount_subtotal" sum="Amount(Inc.Tax)"/>
218+ <field name="state"/>
219+ <field name="reference" string='Reference'/>
220+ </xpath>
221+ </field>
222+ </record>
223+ <record id="account_invoice_line_search" model="ir.ui.view">
224+ <field name="name">account.invoice.line.search.elico</field>
225+ <field name="model">account.invoice.line</field>
226+ <field name="arch" type="xml">
227+ <search string="Search Invoice">
228+ <field name="number" string="Number" filter_domain="['|','|',('number','ilike',self),('supplier_invoice_number','ilike',self),('origin','ilike',self)]"/>
229+ <field name="supplier_invoice_number" string="Supplier Invoice Number" />
230+ <field name="partner_id" string="Partner"/>
231+ <field name="partner_ref" string="Partner ref"/>
232+ <field name="product_id" string="Product" />
233+ <filter icon="terp-go-today" string="Draft" domain="[('state','=','draft')]" help="draft"/>
234+ <filter icon="terp-go-today" string="Open" domain="[('state','not in',('done','draft','cancel'))]" help="draft"/>
235+ <filter icon="terp-go-today" string="Paid" domain="[('state','=','done')]" help="Paid"/>
236+ <filter icon="terp-go-today" string="Cancel" domain="[('state','=','cancel')]" help="Cancel"/>
237+ <separator/>
238+ <filter icon="terp-go-today" string="Today" domain="[('date_invoice','&lt;=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date_invoice','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Orders processed Today or planned for Today"/>
239+ <group expand="0" string="Group By...">
240+ <filter icon="terp-partner" string="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
241+ <filter icon="terp-product" string="Product" domain="[]" context="{'group_by':'product_id'}"/>
242+ <filter icon="terp-invoice" string="Invoice" domain="[]" context="{'group_by':'invoice_id'}"/>
243+ </group>
244+ </search>
245+ </field>
246+ </record>
247+
248+ <record id="action_supplier_invoice_line" model="ir.actions.act_window">
249+ <field name="name">Invoice Line</field>
250+ <field name="type">ir.actions.act_window</field>
251+ <field name="res_model">account.invoice.line</field>
252+ <field name="context">{}</field>
253+ <field name="domain">[('type','=','in_invoice')]</field>
254+ <field name="view_mode">tree</field>
255+ <field name="view_id" ref="account.view_invoice_line_tree"/>
256+ <field name="search_view_id" ref="account_invoice_line_search"/>
257+ <field name="help" type="html">
258+ <p class="oe_view_nocontent_create">
259+ Click to check Invoice Line.
260+ </p>
261+ </field>
262+ </record>
263+ <menuitem id="suppler_invoice_line" name="Supplier Invoice Line" parent="account.menu_finance_payables" action="action_supplier_invoice_line" sequence="13"/>
264+
265+
266+ <record id="action_customer_invoice_line" model="ir.actions.act_window">
267+ <field name="name">Invoice Line</field>
268+ <field name="type">ir.actions.act_window</field>
269+ <field name="res_model">account.invoice.line</field>
270+ <field name="context">{}</field>
271+ <field name="domain">[('type','=','out_invoice')]</field>
272+ <field name="view_mode">tree</field>
273+ <field name="view_id" ref="account.view_invoice_line_tree"/>
274+ <field name="search_view_id" ref="account_invoice_line_search"/>
275+ <field name="help" type="html">
276+
277+ <p class="oe_view_nocontent_create">
278+ Click to check Invoice Line.
279+ </p>
280+ </field>
281+ </record>
282+ <menuitem id="customer_invoice_line" name="Customer Invoice Line" parent="account.menu_finance_receivables" action="action_customer_invoice_line" sequence="13"/>
283+
284+
285+ <!--
286+ Account Invoice
287+ -->
288+ <record model="ir.ui.view" id="invoice_ait_tree">
289+ <field name="name">account.invoice.ait.tree</field>
290+ <field name="model">account.invoice</field>
291+ <field name="inherit_id" ref="account.invoice_tree" />
292+ <field name="arch" type="xml">
293+ <xpath expr="//field[@name='partner_id']" position="before">
294+ <field name="partner_ref"/>
295+ </xpath>
296+ <xpath expr="//field[@name='partner_id']" position="after">
297+ <field name="supplier_invoice_number"/>
298+ </xpath>
299+ <xpath expr="//field[@name='state']" position="before">
300+ <field name="reference"/>
301+ <field name="type" invisible="1"/>
302+ </xpath>
303+ </field>
304+ </record>
305+
306+ <record model="ir.ui.view" id="invoice_supplier_ait_form">
307+ <field name="name">account.invoice.supplier.ait.form</field>
308+ <field name="model">account.invoice</field>
309+ <field name="inherit_id" ref="account.invoice_supplier_form" />
310+ <field name="arch" type="xml">
311+ <xpath expr="//field[@name='price_subtotal']" position="after">
312+ <field name="amount_subtotal"/>
313+ </xpath>
314+ </field>
315+ </record>
316+ <record model="ir.ui.view" id="invoice_ait_form">
317+ <field name="name">account.invoice.ait.form</field>
318+ <field name="model">account.invoice</field>
319+ <field name="inherit_id" ref="account.invoice_form" />
320+ <field name="arch" type="xml">
321+ <xpath expr="//field[@name='account_id']" position="after">
322+ <field name="supplier_invoice_number"/>
323+ </xpath>
324+ </field>
325+ </record>
326+ <record model="ir.ui.view" id="view_account_invoice_ait_filter">
327+ <field name="name">account.invoice.ait.select</field>
328+ <field name="model">account.invoice</field>
329+ <field name="inherit_id" ref="account.view_account_invoice_filter" />
330+ <field name="arch" type="xml">
331+ <xpath expr="//field[@name='user_id']" position="after">
332+ <field name="partner_ref"/>
333+ <field name="supplier_invoice_number"/>
334+
335+ <filter string="Invoice" icon="terp-partner" domain="[('type','=','in_invoice')]"/>
336+ <filter string="Refund" icon="terp-partner" domain="[('type','=','in_refund')]"/>
337+ <separator/>
338+ </xpath>
339+ </field>
340+ </record>
341+
342+ </data>
343+
344+</openerp>
345
346=== added directory 'account_invoice_line/i18n'
347=== added file 'account_invoice_line/i18n/zh_CN.po'
348--- account_invoice_line/i18n/zh_CN.po 1970-01-01 00:00:00 +0000
349+++ account_invoice_line/i18n/zh_CN.po 2013-08-28 02:14:15 +0000
350@@ -0,0 +1,95 @@
351+# Translation of OpenERP Server.
352+# This file contains the translation of the following modules:
353+# * fc_account_invoice
354+#
355+msgid ""
356+msgstr ""
357+"Project-Id-Version: OpenERP Server 7.0alpha\n"
358+"Report-Msgid-Bugs-To: \n"
359+"POT-Creation-Date: 2013-03-29 02:28+0000\n"
360+"PO-Revision-Date: 2013-03-29 02:28+0000\n"
361+"Last-Translator: <>\n"
362+"Language-Team: \n"
363+"MIME-Version: 1.0\n"
364+"Content-Type: text/plain; charset=UTF-8\n"
365+"Content-Transfer-Encoding: \n"
366+"Plural-Forms: \n"
367+
368+#. module: account
369+#: field:account.invoice,supplier_invoice_number:0
370+msgid "Supplier Invoice Number"
371+msgstr "增值税普票号码"
372+
373+#. module: account
374+#: code:addons/account/account_invoice.py:92
375+#, python-format
376+msgid "Free Reference"
377+msgstr "入库说明"
378+
379+#. module: fc_account_invoice
380+#: model:account.invoice.type,name:fc_account_invoice.ait_none
381+msgid "None"
382+msgstr "无"
383+
384+#. module: fc_account_invoice
385+#: field:account.invoice.type,name:0
386+msgid "Name"
387+msgstr "名称"
388+
389+#. module: fc_account_invoice
390+#: model:account.invoice.type,name:fc_account_invoice.ait_13
391+msgid "13%"
392+msgstr "13%"
393+
394+#. module: fc_account_invoice
395+#: model:account.invoice.type,name:fc_account_invoice.ait_normal
396+msgid "Normal"
397+msgstr "普票"
398+
399+#. module: fc_account_invoice
400+#: model:account.invoice.type,name:fc_account_invoice.ait_17
401+msgid "17%"
402+msgstr "17%"
403+
404+#. module: fc_account_invoice
405+#: model:ir.model,name:fc_account_invoice.model_stock_picking
406+msgid "Picking List"
407+msgstr "分拣单"
408+
409+#. module: fc_account_invoice
410+#: model:ir.model,name:fc_account_invoice.model_account_invoice_line
411+msgid "Invoice Line"
412+msgstr "发票明细"
413+
414+#. module: fc_account_invoice
415+#: field:account.invoice.line,amount_subtotal:0
416+msgid "Amount (Inc. Tax)"
417+msgstr "金额(含税)"
418+
419+#. module: fc_account_invoice
420+#: view:account.invoice.type:0
421+msgid "invoice type"
422+msgstr "发票税别"
423+
424+#. module: fc_account_invoice
425+#: model:ir.model,name:fc_account_invoice.model_account_invoice
426+msgid "Invoice"
427+msgstr "发票"
428+
429+#. module: fc_account_invoice
430+#: view:account.invoice:0
431+#: field:account.invoice,account_invoice_type:0
432+msgid "Invoice Type"
433+msgstr "发票税别"
434+
435+#. module: fc_account_invoice
436+#: code:addons/fc_account_invoice/account.py:42
437+#, python-format
438+msgid "Free Reference"
439+msgstr "入库说明"
440+
441+#. module: fc_account_invoice
442+#: field:account.invoice,partner_ref:0
443+msgid "Partner Ref"
444+msgstr "编号"
445+
446
447=== added directory 'account_invoice_line/static'
448=== added directory 'account_invoice_line/static/description'
449=== added file 'account_invoice_line/static/description/account_invoice_line.png'
450Binary files account_invoice_line/static/description/account_invoice_line.png 1970-01-01 00:00:00 +0000 and account_invoice_line/static/description/account_invoice_line.png 2013-08-28 02:14:15 +0000 differ
451=== added file 'account_invoice_line/static/description/index.html'
452--- account_invoice_line/static/description/index.html 1970-01-01 00:00:00 +0000
453+++ account_invoice_line/static/description/index.html 2013-08-28 02:14:15 +0000
454@@ -0,0 +1,16 @@
455+<section class="oe_container">
456+ <div class="oe_row">
457+ <h2 class="oe_slogan">account_invoice_line Module</h2>
458+ <h3 class="oe_slogan">Individual Invoices for Each Item Product in Invoices</h3>
459+ <h4 class="oe_slogan"><a href="http://www.openerp.com.cn">By Elico Corp</a></h4>
460+ <p>This module separates each item in the Customer and Supplier invoices into separate invoices. This allows for each of the separate invoices to be categorized by information type (i.e. company, item, V.A.T., account, etc.) enabling easier search and usage of different search filters.</p>
461+ <p>This module also adds more fields that can be filled in the Supplier and Customer invoices which includes:<br>&nbsp; - &nbsp;Account<br>&nbsp; - &nbsp;Journal<br>&nbsp; - &nbsp;Supplier Inv. Ref.<br>&nbsp; - &nbsp;V.A.T. Date<br>&nbsp; - &nbsp;Invoice Type&nbsp;</p>
462+ <div class="oe_row_img oe_centered oe_mt32">
463+ <img class="oe_picture oe_screenshot" src="account_invoice_line.png">
464+ </div>
465+ </div>
466+ <div class="oe_row oe_centeralign oe_more_space">
467+ <a href="http://www.elico-corp.com" class="oe_button oe_big">Start your <span class="oe_emph">free</span> trial</a>
468+ </div>
469+ <h4 class="oe_slogan">or</h4>
470+</section>
471\ No newline at end of file

Subscribers

People subscribed via source and target branches