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
=== added directory 'account_payment_received_state'
=== added file 'account_payment_received_state/__init__.py'
--- account_payment_received_state/__init__.py 1970-01-01 00:00:00 +0000
+++ account_payment_received_state/__init__.py 2014-02-17 16:50:35 +0000
@@ -0,0 +1,1 @@
1import account_invoice
02
=== added file 'account_payment_received_state/__openerp__.py'
--- account_payment_received_state/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_payment_received_state/__openerp__.py 2014-02-17 16:50:35 +0000
@@ -0,0 +1,45 @@
1# -*- coding: utf-8 -*-
2
3{
4 "name": 'account_payment_received_state',
5 "description": u"""
6Track Account payment
7=====================
8
9This module will add a new `payment received` manual state on account.invoice to track check or cash payment receipt.
10When 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).
11
12Changes
13-------
14
15- Add new state `payment_received` on account.invoice
16- Add new activity on account.invoice.basic worflow (with correct transition)
17- Add new button on invoice to catch payment receipt
18- Add new filter option on account.invoice.search
19
20Futur
21-----
22
23- state does not support multiple payment for now. Will wait for account_deposit trunk branch and add support to it.
24
25Team
26-----
27
28- Nicolas JEUDY <njeudy@tuxservices.com>
29""",
30 "version": "0.1",
31 "depends": [
32 'base',
33 'account_voucher',
34 'account',
35 ],
36 "author": "Tuxservices - 0k.io",
37 "installable" : True,
38 "active" : False,
39 "data": [
40 'workflow_activity_record.xml',
41 'workflow_transition_record.xml',
42 'ir_ui_view_record.xml',
43 ],
44}
45
046
=== added file 'account_payment_received_state/account_invoice.py'
--- account_payment_received_state/account_invoice.py 1970-01-01 00:00:00 +0000
+++ account_payment_received_state/account_invoice.py 2014-02-17 16:50:35 +0000
@@ -0,0 +1,50 @@
1#!/usr/bin/env python
2##############################################################################
3#
4# account_payment_recieved_state module for OpenERP,
5# Copyright (C) 2014 Tuxservices - 0k.io (<http://www.txs.fr>)
6# Authors:
7# - Nicolas JEUDY <njeudy@tuxservices.com>
8#
9# This file is a part of account_payment_recieved_state
10#
11# account_payment_recieved_state is free software: you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation, either version 3 of the License, or
14# (at your option) any later version.
15#
16# account_payment_recieved_state is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program. If not, see <http://www.gnu.org/licenses/>.
23#
24##############################################################################
25
26from openerp.osv import osv
27from openerp.osv import orm
28from openerp.osv import fields
29
30
31class AccountInvoice(orm.Model):
32 _inherit = 'account.invoice'
33 STATE_SELECTION = [
34 ('draft','Draft'),
35 ('proforma','Pro-forma'),
36 ('proforma2','Pro-forma'),
37 ('open','Open'),
38 ('payment_received','Payment received'),
39 ('paid','Paid'),
40 ('cancel','Cancelled'),
41 ]
42 _columns = {
43 'state': fields.selection(STATE_SELECTION,
44 'Status', select=True, readonly=True, track_visibility='onchange',
45 help=' * The \'Draft\' status is used when a user is encoding a new and unconfirmed Invoice. \
46 \n* The \'Pro-forma\' when invoice is in Pro-forma status,invoice does not have an invoice number. \
47 \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. \
48 \n* The \'Paid\' status is set automatically when the invoice is paid. Its related journal entries may or may not be reconciled. \
49 \n* The \'Cancelled\' status is used when user cancel invoice.'),
50 }
051
=== added directory 'account_payment_received_state/i18n'
=== added file 'account_payment_received_state/i18n/fr.po'
--- account_payment_received_state/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ account_payment_received_state/i18n/fr.po 2014-02-17 16:50:35 +0000
@@ -0,0 +1,39 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * account_payment_received_state
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.saas~3\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2014-02-17 13:10+0000\n"
10"PO-Revision-Date: 2014-02-17 13:10+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_payment_received_state
19#: view:account.invoice:0
20#: selection:account.invoice,state:0
21msgid "Payment Received"
22msgstr "Paiement Reçu"
23
24#. module: account_payment_received_state
25#: view:account.invoice:0
26msgid "Invoices with payment received"
27msgstr "Facture dont un paiement à été reçu (non encaissé)"
28
29#. module: account_payment_received_state
30#: model:ir.model,name:account_payment_received_state.model_account_invoice
31msgid "Invoice"
32msgstr "Facture"
33
34#. module: account_payment_received_state
35#: view:account.invoice:0
36#: selection:account.invoice,state:0
37msgid "Payment received"
38msgstr "Paiement reçu"
39
040
=== added file 'account_payment_received_state/ir_ui_view_record.xml'
--- account_payment_received_state/ir_ui_view_record.xml 1970-01-01 00:00:00 +0000
+++ account_payment_received_state/ir_ui_view_record.xml 2014-02-17 16:50:35 +0000
@@ -0,0 +1,49 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="ir_ui_view_new_account_invoice_form_payment_received_r0" model="ir.ui.view">
5 <field name="name">account.invoice.form.payment_received</field>
6 <field name="arch" type="xml">
7 <data>
8 <xpath expr="//button[@name='invoice_open'][last()]" position="after">
9 <button name="payment_received" string="Payment received" states="open,proforma2"/>
10 </xpath>
11 <xpath expr="//button[@name='invoice_pay_customer']" position="attributes">
12 <attribute name="attrs">{'invisible': ['|', ('state','not in',['open','payment_received']), ('sent','=',False)]}</attribute>
13 </xpath>
14 <xpath expr="//button[@name='invoice_pay_customer']" position="attributes">
15 <attribute name="attrs">{'invisible': ['|', ('state','not in',['open','payment_received']), ('sent','=',True)]}</attribute>
16 </xpath>
17 <xpath expr="//button[@string='Refund Invoice']" position="attributes">
18 <attribute name="states">open,proforma2,paid,payment_received</attribute>
19 </xpath>
20 <xpath expr="//field[@name='state']" position="attributes">
21 <attribute name="statusbar_visible">draft,open,payment_received,paid</attribute>
22 </xpath>
23 </data>
24 </field>
25 <!-- one2many field 'inherit_children_ids' managed on the ir.ui.view side -->
26 <field name="inherit_id" ref="account.invoice_form"/>
27 <field name="model">account.invoice</field>
28 <!-- one2many field 'model_ids' managed on the ir.model.data side -->
29 <field name="priority">25</field>
30 <field name="type">form</field>
31 </record>
32 <record id="ir_ui_view_new_account_invoice_select_payment_received_r0" model="ir.ui.view">
33 <field name="name">account.invoice.select.payment_received</field>
34 <field name="arch" type="xml">
35 <data>
36 <xpath expr="//filter[@name='unpaid']" position="after">
37 <filter name="payment_received" string="Payment Received" domain="[('state','=','payment_received')]" help="Invoices with payment received"/>
38 </xpath>
39 </data>
40 </field>
41 <!-- one2many field 'inherit_children_ids' managed on the ir.ui.view side -->
42 <field name="inherit_id" ref="account.view_account_invoice_filter"/>
43 <field name="model">account.invoice</field>
44 <!-- one2many field 'model_ids' managed on the ir.model.data side -->
45 <field name="priority">25</field>
46 <field name="type">search</field>
47 </record>
48 </data>
49</openerp>
050
=== added file 'account_payment_received_state/workflow_activity_record.xml'
--- account_payment_received_state/workflow_activity_record.xml 1970-01-01 00:00:00 +0000
+++ account_payment_received_state/workflow_activity_record.xml 2014-02-17 16:50:35 +0000
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="workflow_activity_new_payment_received_r0" model="workflow.activity">
5 <field name="name">payment received</field>
6 <field name="action">write({'state':'payment_received'})</field>
7 <field name="flow_start" eval="False"/>
8 <field name="flow_stop" eval="False"/>
9 <!-- one2many field 'in_transitions' managed on the workflow.transition side -->
10 <field name="join_mode">XOR</field>
11 <field name="kind">function</field>
12 <!-- one2many field 'out_transitions' managed on the workflow.transition side -->
13 <field name="split_mode">XOR</field>
14 <field name="wkf_id" ref="account.wkf"/>
15 </record>
16 </data>
17</openerp>
018
=== added file 'account_payment_received_state/workflow_transition_record.xml'
--- account_payment_received_state/workflow_transition_record.xml 1970-01-01 00:00:00 +0000
+++ account_payment_received_state/workflow_transition_record.xml 2014-02-17 16:50:35 +0000
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="workflow_transition_new_payment_received_r0" model="workflow.transition">
5 <field name="act_from" ref="account.act_open"/>
6 <field name="act_to" ref="account_payment_received_state.workflow_activity_new_payment_received_r0"/>
7 <field name="condition">True</field>
8 <field name="signal">payment_received</field>
9 </record>
10 <record id="workflow_transition_new_payment_received_r1" model="workflow.transition">
11 <field name="act_from" ref="account_payment_received_state.workflow_activity_new_payment_received_r0"/>
12 <field name="act_to" ref="account.act_paid"/>
13 <field name="condition">True</field>
14 <field name="signal">test_paid()</field>
15 </record>
16 </data>
17</openerp>

Subscribers

People subscribed via source and target branches