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
=== added directory 'account_invoice_line'
=== added file 'account_invoice_line/__init__.py'
--- account_invoice_line/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_line/__init__.py 2013-08-28 02:14:15 +0000
@@ -0,0 +1,25 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
6# Author: Andy Lu <andy.lu@elico-corp.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23import account
24
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
0\ No newline at end of file26\ No newline at end of file
127
=== added file 'account_invoice_line/__openerp__.py'
--- account_invoice_line/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_line/__openerp__.py 2013-08-28 02:14:15 +0000
@@ -0,0 +1,49 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
6# Author: LIN Yu <lin.yu@elico-corp.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23{
24 'name': 'Invoice Line',
25 'version': '1.1',
26 'category': 'Account',
27 'sequence': 19,
28 'summary': 'Invoice line',
29 'description': """
30Invoice Line
31==================================================
32* Create a menu for read Only list View of account invoice line
33* Add part of invoice header infomation in invoice line list view
34 """,
35 'author': 'Elico Corp',
36 'website': 'http://www.elico-corp.com',
37 'images' : [],
38 'depends': ['account'],
39 'data': [
40 'account_view.xml',
41 ],
42 'test': [],
43 'demo': [],
44 'installable': True,
45 'auto_install': False,
46 'application': False,
47}
48
49# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
0\ No newline at end of file50\ No newline at end of file
151
=== added file 'account_invoice_line/account.py'
--- account_invoice_line/account.py 1970-01-01 00:00:00 +0000
+++ account_invoice_line/account.py 2013-08-28 02:14:15 +0000
@@ -0,0 +1,90 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
6# Author: LIN Yu <lin.yu@elico-corp.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from osv import osv, fields
24from tools.translate import _
25import openerp.addons.decimal_precision as dp
26import time
27
28class account_invoice(osv.osv):
29 _inherit = "account.invoice"
30
31 def _get_reference_type(self, cr, uid, context=None):
32 return [('none', _('Free Reference'))] #,
33
34 _columns = {
35 'supplier_invoice_number': fields.char('Supplier Inv Ref', size=64, help="The reference of this invoice as provided by the supplier."),
36 'partner_ref': fields.related('partner_id','ref',type='char', size=64, string='Partner Ref'),
37 'reference_type': fields.selection(_get_reference_type, 'Payment Reference',
38 required=True, readonly=True, states={'draft':[('readonly',False)]}),
39 }
40account_invoice()
41
42class account_invoice_line(osv.osv):
43 _inherit = "account.invoice.line"
44
45 def _amount_line_with_tax(self, cr, uid, ids, prop, arg, context=None):
46 res = {}
47 tax_obj = self.pool.get('account.tax')
48 cur_obj = self.pool.get('res.currency')
49 for line in self.browse(cr, uid, ids, context=context):
50 price = line.price_unit * (1-(line.discount or 0.0)/100.0)
51 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)
52 res[line.id] = taxes['total']
53 if line.invoice_id:
54 cur = line.invoice_id.currency_id
55 res[line.id] = cur_obj.round(cr, uid, cur, res[line.id])
56 return res
57
58 _columns = {
59 'amount_subtotal': fields.function(_amount_line_with_tax, string='Amount (Inc. Tax)', type='float', digits_compute=dp.get_precision('Account')),
60 'partner_ref': fields.related(
61 'partner_id', 'ref',
62 type='char', size=64,relation='res.partner',
63 string='Partner Ref',select=1),
64 'type': fields.related(
65 'invoice_id', 'type',
66 type='char', size=64,relation='account.invoice',
67 string='Type'),
68 'number': fields.related(
69 'invoice_id', 'number',
70 type='char', size=64,relation='account.invoice',
71 string='Number',select=1),
72 'supplier_invoice_number': fields.related(
73 'invoice_id', 'supplier_invoice_number',
74 type='char', size=64,relation='account.invoice',
75 string='Supplier Inv Ref',select=1),
76 'date_invoice': fields.related(
77 'invoice_id', 'date_invoice',
78 type='date', relation='account.invoice',
79 string='Date Invoice',select=1),
80 'state': fields.related(
81 'invoice_id', 'state',
82 type='char', size=16,relation='account.invoice',
83 string='State'),
84 'reference': fields.related(
85 'invoice_id', 'reference',
86 type='char', size=16,relation='account.invoice',
87 string='Reference'),
88 }
89account_invoice_line()
90# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
091
=== added file 'account_invoice_line/account_view.xml'
--- account_invoice_line/account_view.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_line/account_view.xml 2013-08-28 02:14:15 +0000
@@ -0,0 +1,158 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4 <!-- Invoice Line by LY-->
5
6 <record id="account_invoice_line_tree" model="ir.ui.view">
7 <field name="name">account_invoice_line_tree</field>
8 <field name="model">account.invoice.line</field>
9 <field name="inherit_id" ref="account.view_invoice_line_tree"/>
10 <field name="arch" type="xml">
11
12 <xpath expr="/tree" position="attributes">
13 <attribute name="create">0</attribute>
14 <attribute name="delete">0</attribute>
15 </xpath>
16 <xpath expr="/tree/field[@name='name']" position="before">
17 <field name="partner_ref"/>
18 <field name="partner_id"/>
19 <field name="supplier_invoice_number"/>
20 <field name="number"/>
21 <field name="date_invoice"/>
22 <field name="invoice_id" invisible='1'/>
23 <field name="origin"/>
24 </xpath>
25 <xpath expr="/tree/field[@name='quantity']" position="replace">
26 <field name="product_id"/>
27 <field name="quantity" sum="Quantity"/>
28 </xpath>
29 <xpath expr="//field[@name='price_subtotal']" position="replace">
30 <field name="amount_subtotal" sum="Amount"/>
31 <field name="amount_subtotal" sum="Amount(Inc.Tax)"/>
32 <field name="state"/>
33 <field name="reference" string='Reference'/>
34 </xpath>
35 </field>
36 </record>
37 <record id="account_invoice_line_search" model="ir.ui.view">
38 <field name="name">account.invoice.line.search.elico</field>
39 <field name="model">account.invoice.line</field>
40 <field name="arch" type="xml">
41 <search string="Search Invoice">
42 <field name="number" string="Number" filter_domain="['|','|',('number','ilike',self),('supplier_invoice_number','ilike',self),('origin','ilike',self)]"/>
43 <field name="supplier_invoice_number" string="Supplier Invoice Number" />
44 <field name="partner_id" string="Partner"/>
45 <field name="partner_ref" string="Partner ref"/>
46 <field name="product_id" string="Product" />
47 <filter icon="terp-go-today" string="Draft" domain="[('state','=','draft')]" help="draft"/>
48 <filter icon="terp-go-today" string="Open" domain="[('state','not in',('done','draft','cancel'))]" help="draft"/>
49 <filter icon="terp-go-today" string="Paid" domain="[('state','=','done')]" help="Paid"/>
50 <filter icon="terp-go-today" string="Cancel" domain="[('state','=','cancel')]" help="Cancel"/>
51 <separator/>
52 <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"/>
53 <group expand="0" string="Group By...">
54 <filter icon="terp-partner" string="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
55 <filter icon="terp-product" string="Product" domain="[]" context="{'group_by':'product_id'}"/>
56 <filter icon="terp-invoice" string="Invoice" domain="[]" context="{'group_by':'invoice_id'}"/>
57 </group>
58 </search>
59 </field>
60 </record>
61
62 <record id="action_supplier_invoice_line" model="ir.actions.act_window">
63 <field name="name">Invoice Line</field>
64 <field name="type">ir.actions.act_window</field>
65 <field name="res_model">account.invoice.line</field>
66 <field name="context">{}</field>
67 <field name="domain">[('type','=','in_invoice')]</field>
68 <field name="view_mode">tree</field>
69 <field name="view_id" ref="account.view_invoice_line_tree"/>
70 <field name="search_view_id" ref="account_invoice_line_search"/>
71 <field name="help" type="html">
72 <p class="oe_view_nocontent_create">
73 Click to check Invoice Line.
74 </p>
75 </field>
76 </record>
77 <menuitem id="suppler_invoice_line" name="Supplier Invoice Line" parent="account.menu_finance_payables" action="action_supplier_invoice_line" sequence="13"/>
78
79
80 <record id="action_customer_invoice_line" model="ir.actions.act_window">
81 <field name="name">Invoice Line</field>
82 <field name="type">ir.actions.act_window</field>
83 <field name="res_model">account.invoice.line</field>
84 <field name="context">{}</field>
85 <field name="domain">[('type','=','out_invoice')]</field>
86 <field name="view_mode">tree</field>
87 <field name="view_id" ref="account.view_invoice_line_tree"/>
88 <field name="search_view_id" ref="account_invoice_line_search"/>
89 <field name="help" type="html">
90
91 <p class="oe_view_nocontent_create">
92 Click to check Invoice Line.
93 </p>
94 </field>
95 </record>
96 <menuitem id="customer_invoice_line" name="Customer Invoice Line" parent="account.menu_finance_receivables" action="action_customer_invoice_line" sequence="13"/>
97
98
99 <!--
100 Account Invoice
101 -->
102 <record model="ir.ui.view" id="invoice_ait_tree">
103 <field name="name">account.invoice.ait.tree</field>
104 <field name="model">account.invoice</field>
105 <field name="inherit_id" ref="account.invoice_tree" />
106 <field name="arch" type="xml">
107 <xpath expr="//field[@name='partner_id']" position="before">
108 <field name="partner_ref"/>
109 </xpath>
110 <xpath expr="//field[@name='partner_id']" position="after">
111 <field name="supplier_invoice_number"/>
112 </xpath>
113 <xpath expr="//field[@name='state']" position="before">
114 <field name="reference"/>
115 <field name="type" invisible="1"/>
116 </xpath>
117 </field>
118 </record>
119
120 <record model="ir.ui.view" id="invoice_supplier_ait_form">
121 <field name="name">account.invoice.supplier.ait.form</field>
122 <field name="model">account.invoice</field>
123 <field name="inherit_id" ref="account.invoice_supplier_form" />
124 <field name="arch" type="xml">
125 <xpath expr="//field[@name='price_subtotal']" position="after">
126 <field name="amount_subtotal"/>
127 </xpath>
128 </field>
129 </record>
130 <record model="ir.ui.view" id="invoice_ait_form">
131 <field name="name">account.invoice.ait.form</field>
132 <field name="model">account.invoice</field>
133 <field name="inherit_id" ref="account.invoice_form" />
134 <field name="arch" type="xml">
135 <xpath expr="//field[@name='account_id']" position="after">
136 <field name="supplier_invoice_number"/>
137 </xpath>
138 </field>
139 </record>
140 <record model="ir.ui.view" id="view_account_invoice_ait_filter">
141 <field name="name">account.invoice.ait.select</field>
142 <field name="model">account.invoice</field>
143 <field name="inherit_id" ref="account.view_account_invoice_filter" />
144 <field name="arch" type="xml">
145 <xpath expr="//field[@name='user_id']" position="after">
146 <field name="partner_ref"/>
147 <field name="supplier_invoice_number"/>
148
149 <filter string="Invoice" icon="terp-partner" domain="[('type','=','in_invoice')]"/>
150 <filter string="Refund" icon="terp-partner" domain="[('type','=','in_refund')]"/>
151 <separator/>
152 </xpath>
153 </field>
154 </record>
155
156 </data>
157
158</openerp>
0159
=== added directory 'account_invoice_line/i18n'
=== added file 'account_invoice_line/i18n/zh_CN.po'
--- account_invoice_line/i18n/zh_CN.po 1970-01-01 00:00:00 +0000
+++ account_invoice_line/i18n/zh_CN.po 2013-08-28 02:14:15 +0000
@@ -0,0 +1,95 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * fc_account_invoice
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0alpha\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-03-29 02:28+0000\n"
10"PO-Revision-Date: 2013-03-29 02:28+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: account
19#: field:account.invoice,supplier_invoice_number:0
20msgid "Supplier Invoice Number"
21msgstr "增值税普票号码"
22
23#. module: account
24#: code:addons/account/account_invoice.py:92
25#, python-format
26msgid "Free Reference"
27msgstr "入库说明"
28
29#. module: fc_account_invoice
30#: model:account.invoice.type,name:fc_account_invoice.ait_none
31msgid "None"
32msgstr "无"
33
34#. module: fc_account_invoice
35#: field:account.invoice.type,name:0
36msgid "Name"
37msgstr "名称"
38
39#. module: fc_account_invoice
40#: model:account.invoice.type,name:fc_account_invoice.ait_13
41msgid "13%"
42msgstr "13%"
43
44#. module: fc_account_invoice
45#: model:account.invoice.type,name:fc_account_invoice.ait_normal
46msgid "Normal"
47msgstr "普票"
48
49#. module: fc_account_invoice
50#: model:account.invoice.type,name:fc_account_invoice.ait_17
51msgid "17%"
52msgstr "17%"
53
54#. module: fc_account_invoice
55#: model:ir.model,name:fc_account_invoice.model_stock_picking
56msgid "Picking List"
57msgstr "分拣单"
58
59#. module: fc_account_invoice
60#: model:ir.model,name:fc_account_invoice.model_account_invoice_line
61msgid "Invoice Line"
62msgstr "发票明细"
63
64#. module: fc_account_invoice
65#: field:account.invoice.line,amount_subtotal:0
66msgid "Amount (Inc. Tax)"
67msgstr "金额(含税)"
68
69#. module: fc_account_invoice
70#: view:account.invoice.type:0
71msgid "invoice type"
72msgstr "发票税别"
73
74#. module: fc_account_invoice
75#: model:ir.model,name:fc_account_invoice.model_account_invoice
76msgid "Invoice"
77msgstr "发票"
78
79#. module: fc_account_invoice
80#: view:account.invoice:0
81#: field:account.invoice,account_invoice_type:0
82msgid "Invoice Type"
83msgstr "发票税别"
84
85#. module: fc_account_invoice
86#: code:addons/fc_account_invoice/account.py:42
87#, python-format
88msgid "Free Reference"
89msgstr "入库说明"
90
91#. module: fc_account_invoice
92#: field:account.invoice,partner_ref:0
93msgid "Partner Ref"
94msgstr "编号"
95
096
=== added directory 'account_invoice_line/static'
=== added directory 'account_invoice_line/static/description'
=== added file 'account_invoice_line/static/description/account_invoice_line.png'
1Binary 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 differ97Binary 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
=== added file 'account_invoice_line/static/description/index.html'
--- account_invoice_line/static/description/index.html 1970-01-01 00:00:00 +0000
+++ account_invoice_line/static/description/index.html 2013-08-28 02:14:15 +0000
@@ -0,0 +1,16 @@
1<section class="oe_container">
2 <div class="oe_row">
3 <h2 class="oe_slogan">account_invoice_line Module</h2>
4 <h3 class="oe_slogan">Individual Invoices for Each Item Product in Invoices</h3>
5 <h4 class="oe_slogan"><a href="http://www.openerp.com.cn">By Elico Corp</a></h4>
6 <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>
7 <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>
8 <div class="oe_row_img oe_centered oe_mt32">
9 <img class="oe_picture oe_screenshot" src="account_invoice_line.png">
10 </div>
11 </div>
12 <div class="oe_row oe_centeralign oe_more_space">
13 <a href="http://www.elico-corp.com" class="oe_button oe_big">Start your <span class="oe_emph">free</span> trial</a>
14 </div>
15 <h4 class="oe_slogan">or</h4>
16</section>
0\ No newline at end of file17\ No newline at end of file

Subscribers

People subscribed via source and target branches