Merge lp:~0k.io/account-payment/7.0-account_payment_received_state into lp:~account-payment-team/account-payment/7.0

Proposed by Nicolas JEUDY
Status: Needs review
Proposed branch: lp:~0k.io/account-payment/7.0-account_payment_received_state
Merge into: lp:~account-payment-team/account-payment/7.0
Diff against target: 254 lines (+218/-0)
7 files modified
account_payment_received_state/__init__.py (+1/-0)
account_payment_received_state/__openerp__.py (+45/-0)
account_payment_received_state/account_invoice.py (+50/-0)
account_payment_received_state/i18n/fr.po (+39/-0)
account_payment_received_state/ir_ui_view_record.xml (+49/-0)
account_payment_received_state/workflow_activity_record.xml (+17/-0)
account_payment_received_state/workflow_transition_record.xml (+17/-0)
To merge this branch: bzr merge lp:~0k.io/account-payment/7.0-account_payment_received_state
Reviewer Review Type Date Requested Status
Omar (Pexego) code review Needs Fixing
Luis Felipe Miléo - http://www.kmee.com.br Pending
Review via email: mp+206766@code.launchpad.net

Description of the change

Add a new state on account.invoice for manual tracking of payment receipt:

This is for small companies, that are paid with check or cash and manage manualy the account payment followup.:

- They receive the check by post for example
- then they mark invoice as 'payment received' (with the new button associated with new workflow activity)
- And when they have posted and seen that amount is on the bank account they use the existing pay button on the invoice.

I need this because when you use the pay button on invoice, voucher and account.move are written, but I don't want that if I only receive the payment.

In the near futur, I will add compatibility with upcoming trunk account_deposit branch to have a complete workflow.

Sorry for wrong branch on the first merge proposal :)

To post a comment you must log in.
Revision history for this message
Omar (Pexego) (omar7r) wrote :

AGPL please

review: Needs Fixing (code review)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

This project is now hosted on https://github.com/OCA/account-payment. 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

Unmerged revisions

110. By Nicolas JEUDY

new: add new module account_payment_received_state to manually track when company received a payment like check or cash, but did'nt post it to the bank (so account.invoice should not be in paid state)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_payment_received_state'
2=== added file 'account_payment_received_state/__init__.py'
3--- account_payment_received_state/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_payment_received_state/__init__.py 2014-02-17 16:50:35 +0000
5@@ -0,0 +1,1 @@
6+import account_invoice
7
8=== added file 'account_payment_received_state/__openerp__.py'
9--- account_payment_received_state/__openerp__.py 1970-01-01 00:00:00 +0000
10+++ account_payment_received_state/__openerp__.py 2014-02-17 16:50:35 +0000
11@@ -0,0 +1,45 @@
12+# -*- coding: utf-8 -*-
13+
14+{
15+ "name": 'account_payment_received_state',
16+ "description": u"""
17+Track Account payment
18+=====================
19+
20+This module will add a new `payment received` manual state on account.invoice to track check or cash payment receipt.
21+When receiving a check for a payment, invoice should not be considered as paid, but will have `payment_received` state waiting to be deposit in bank (action paid).
22+
23+Changes
24+-------
25+
26+- Add new state `payment_received` on account.invoice
27+- Add new activity on account.invoice.basic worflow (with correct transition)
28+- Add new button on invoice to catch payment receipt
29+- Add new filter option on account.invoice.search
30+
31+Futur
32+-----
33+
34+- state does not support multiple payment for now. Will wait for account_deposit trunk branch and add support to it.
35+
36+Team
37+-----
38+
39+- Nicolas JEUDY <njeudy@tuxservices.com>
40+""",
41+ "version": "0.1",
42+ "depends": [
43+ 'base',
44+ 'account_voucher',
45+ 'account',
46+ ],
47+ "author": "Tuxservices - 0k.io",
48+ "installable" : True,
49+ "active" : False,
50+ "data": [
51+ 'workflow_activity_record.xml',
52+ 'workflow_transition_record.xml',
53+ 'ir_ui_view_record.xml',
54+ ],
55+}
56+
57
58=== added file 'account_payment_received_state/account_invoice.py'
59--- account_payment_received_state/account_invoice.py 1970-01-01 00:00:00 +0000
60+++ account_payment_received_state/account_invoice.py 2014-02-17 16:50:35 +0000
61@@ -0,0 +1,50 @@
62+#!/usr/bin/env python
63+##############################################################################
64+#
65+# account_payment_recieved_state module for OpenERP,
66+# Copyright (C) 2014 Tuxservices - 0k.io (<http://www.txs.fr>)
67+# Authors:
68+# - Nicolas JEUDY <njeudy@tuxservices.com>
69+#
70+# This file is a part of account_payment_recieved_state
71+#
72+# account_payment_recieved_state is free software: you can redistribute it and/or modify
73+# it under the terms of the GNU General Public License as published by
74+# the Free Software Foundation, either version 3 of the License, or
75+# (at your option) any later version.
76+#
77+# account_payment_recieved_state is distributed in the hope that it will be useful,
78+# but WITHOUT ANY WARRANTY; without even the implied warranty of
79+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
80+# GNU General Public License for more details.
81+#
82+# You should have received a copy of the GNU General Public License
83+# along with this program. If not, see <http://www.gnu.org/licenses/>.
84+#
85+##############################################################################
86+
87+from openerp.osv import osv
88+from openerp.osv import orm
89+from openerp.osv import fields
90+
91+
92+class AccountInvoice(orm.Model):
93+ _inherit = 'account.invoice'
94+ STATE_SELECTION = [
95+ ('draft','Draft'),
96+ ('proforma','Pro-forma'),
97+ ('proforma2','Pro-forma'),
98+ ('open','Open'),
99+ ('payment_received','Payment received'),
100+ ('paid','Paid'),
101+ ('cancel','Cancelled'),
102+ ]
103+ _columns = {
104+ 'state': fields.selection(STATE_SELECTION,
105+ 'Status', select=True, readonly=True, track_visibility='onchange',
106+ help=' * The \'Draft\' status is used when a user is encoding a new and unconfirmed Invoice. \
107+ \n* The \'Pro-forma\' when invoice is in Pro-forma status,invoice does not have an invoice number. \
108+ \n* The \'Open\' status is used when user create invoice,a invoice number is generated.Its in open status till user does not pay invoice. \
109+ \n* The \'Paid\' status is set automatically when the invoice is paid. Its related journal entries may or may not be reconciled. \
110+ \n* The \'Cancelled\' status is used when user cancel invoice.'),
111+ }
112
113=== added directory 'account_payment_received_state/i18n'
114=== added file 'account_payment_received_state/i18n/fr.po'
115--- account_payment_received_state/i18n/fr.po 1970-01-01 00:00:00 +0000
116+++ account_payment_received_state/i18n/fr.po 2014-02-17 16:50:35 +0000
117@@ -0,0 +1,39 @@
118+# Translation of OpenERP Server.
119+# This file contains the translation of the following modules:
120+# * account_payment_received_state
121+#
122+msgid ""
123+msgstr ""
124+"Project-Id-Version: OpenERP Server 7.saas~3\n"
125+"Report-Msgid-Bugs-To: \n"
126+"POT-Creation-Date: 2014-02-17 13:10+0000\n"
127+"PO-Revision-Date: 2014-02-17 13:10+0000\n"
128+"Last-Translator: <>\n"
129+"Language-Team: \n"
130+"MIME-Version: 1.0\n"
131+"Content-Type: text/plain; charset=UTF-8\n"
132+"Content-Transfer-Encoding: \n"
133+"Plural-Forms: \n"
134+
135+#. module: account_payment_received_state
136+#: view:account.invoice:0
137+#: selection:account.invoice,state:0
138+msgid "Payment Received"
139+msgstr "Paiement Reçu"
140+
141+#. module: account_payment_received_state
142+#: view:account.invoice:0
143+msgid "Invoices with payment received"
144+msgstr "Facture dont un paiement à été reçu (non encaissé)"
145+
146+#. module: account_payment_received_state
147+#: model:ir.model,name:account_payment_received_state.model_account_invoice
148+msgid "Invoice"
149+msgstr "Facture"
150+
151+#. module: account_payment_received_state
152+#: view:account.invoice:0
153+#: selection:account.invoice,state:0
154+msgid "Payment received"
155+msgstr "Paiement reçu"
156+
157
158=== added file 'account_payment_received_state/ir_ui_view_record.xml'
159--- account_payment_received_state/ir_ui_view_record.xml 1970-01-01 00:00:00 +0000
160+++ account_payment_received_state/ir_ui_view_record.xml 2014-02-17 16:50:35 +0000
161@@ -0,0 +1,49 @@
162+<?xml version="1.0" encoding="utf-8"?>
163+<openerp>
164+ <data>
165+ <record id="ir_ui_view_new_account_invoice_form_payment_received_r0" model="ir.ui.view">
166+ <field name="name">account.invoice.form.payment_received</field>
167+ <field name="arch" type="xml">
168+ <data>
169+ <xpath expr="//button[@name='invoice_open'][last()]" position="after">
170+ <button name="payment_received" string="Payment received" states="open,proforma2"/>
171+ </xpath>
172+ <xpath expr="//button[@name='invoice_pay_customer']" position="attributes">
173+ <attribute name="attrs">{'invisible': ['|', ('state','not in',['open','payment_received']), ('sent','=',False)]}</attribute>
174+ </xpath>
175+ <xpath expr="//button[@name='invoice_pay_customer']" position="attributes">
176+ <attribute name="attrs">{'invisible': ['|', ('state','not in',['open','payment_received']), ('sent','=',True)]}</attribute>
177+ </xpath>
178+ <xpath expr="//button[@string='Refund Invoice']" position="attributes">
179+ <attribute name="states">open,proforma2,paid,payment_received</attribute>
180+ </xpath>
181+ <xpath expr="//field[@name='state']" position="attributes">
182+ <attribute name="statusbar_visible">draft,open,payment_received,paid</attribute>
183+ </xpath>
184+ </data>
185+ </field>
186+ <!-- one2many field 'inherit_children_ids' managed on the ir.ui.view side -->
187+ <field name="inherit_id" ref="account.invoice_form"/>
188+ <field name="model">account.invoice</field>
189+ <!-- one2many field 'model_ids' managed on the ir.model.data side -->
190+ <field name="priority">25</field>
191+ <field name="type">form</field>
192+ </record>
193+ <record id="ir_ui_view_new_account_invoice_select_payment_received_r0" model="ir.ui.view">
194+ <field name="name">account.invoice.select.payment_received</field>
195+ <field name="arch" type="xml">
196+ <data>
197+ <xpath expr="//filter[@name='unpaid']" position="after">
198+ <filter name="payment_received" string="Payment Received" domain="[('state','=','payment_received')]" help="Invoices with payment received"/>
199+ </xpath>
200+ </data>
201+ </field>
202+ <!-- one2many field 'inherit_children_ids' managed on the ir.ui.view side -->
203+ <field name="inherit_id" ref="account.view_account_invoice_filter"/>
204+ <field name="model">account.invoice</field>
205+ <!-- one2many field 'model_ids' managed on the ir.model.data side -->
206+ <field name="priority">25</field>
207+ <field name="type">search</field>
208+ </record>
209+ </data>
210+</openerp>
211
212=== added file 'account_payment_received_state/workflow_activity_record.xml'
213--- account_payment_received_state/workflow_activity_record.xml 1970-01-01 00:00:00 +0000
214+++ account_payment_received_state/workflow_activity_record.xml 2014-02-17 16:50:35 +0000
215@@ -0,0 +1,17 @@
216+<?xml version="1.0" encoding="utf-8"?>
217+<openerp>
218+ <data>
219+ <record id="workflow_activity_new_payment_received_r0" model="workflow.activity">
220+ <field name="name">payment received</field>
221+ <field name="action">write({'state':'payment_received'})</field>
222+ <field name="flow_start" eval="False"/>
223+ <field name="flow_stop" eval="False"/>
224+ <!-- one2many field 'in_transitions' managed on the workflow.transition side -->
225+ <field name="join_mode">XOR</field>
226+ <field name="kind">function</field>
227+ <!-- one2many field 'out_transitions' managed on the workflow.transition side -->
228+ <field name="split_mode">XOR</field>
229+ <field name="wkf_id" ref="account.wkf"/>
230+ </record>
231+ </data>
232+</openerp>
233
234=== added file 'account_payment_received_state/workflow_transition_record.xml'
235--- account_payment_received_state/workflow_transition_record.xml 1970-01-01 00:00:00 +0000
236+++ account_payment_received_state/workflow_transition_record.xml 2014-02-17 16:50:35 +0000
237@@ -0,0 +1,17 @@
238+<?xml version="1.0" encoding="utf-8"?>
239+<openerp>
240+ <data>
241+ <record id="workflow_transition_new_payment_received_r0" model="workflow.transition">
242+ <field name="act_from" ref="account.act_open"/>
243+ <field name="act_to" ref="account_payment_received_state.workflow_activity_new_payment_received_r0"/>
244+ <field name="condition">True</field>
245+ <field name="signal">payment_received</field>
246+ </record>
247+ <record id="workflow_transition_new_payment_received_r1" model="workflow.transition">
248+ <field name="act_from" ref="account_payment_received_state.workflow_activity_new_payment_received_r0"/>
249+ <field name="act_to" ref="account.act_paid"/>
250+ <field name="condition">True</field>
251+ <field name="signal">test_paid()</field>
252+ </record>
253+ </data>
254+</openerp>

Subscribers

People subscribed via source and target branches