account-payment-team team mailing list archive
-
account-payment-team team
-
Mailing list archive
-
Message #00307
[Merge] lp:~0k.io/account-payment/7.0-account_payment_received_state into lp:account-payment/7.0
Nicolas JEUDY has proposed merging lp:~0k.io/account-payment/7.0-account_payment_received_state into lp:account-payment/7.0.
Requested reviews:
Account Payment (account-payment-team)
For more details, see:
https://code.launchpad.net/~0k.io/account-payment/7.0-account_payment_received_state/+merge/206766
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 :)
--
https://code.launchpad.net/~0k.io/account-payment/7.0-account_payment_received_state/+merge/206766
Your team Account Payment is requested to review the proposed merge of lp:~0k.io/account-payment/7.0-account_payment_received_state into lp:account-payment/7.0.
=== 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 @@
+import account_invoice
=== 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 @@
+# -*- coding: utf-8 -*-
+
+{
+ "name": 'account_payment_received_state',
+ "description": u"""
+Track Account payment
+=====================
+
+This module will add a new `payment received` manual state on account.invoice to track check or cash payment receipt.
+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).
+
+Changes
+-------
+
+- Add new state `payment_received` on account.invoice
+- Add new activity on account.invoice.basic worflow (with correct transition)
+- Add new button on invoice to catch payment receipt
+- Add new filter option on account.invoice.search
+
+Futur
+-----
+
+- state does not support multiple payment for now. Will wait for account_deposit trunk branch and add support to it.
+
+Team
+-----
+
+- Nicolas JEUDY <njeudy@xxxxxxxxxxxxxxx>
+""",
+ "version": "0.1",
+ "depends": [
+ 'base',
+ 'account_voucher',
+ 'account',
+ ],
+ "author": "Tuxservices - 0k.io",
+ "installable" : True,
+ "active" : False,
+ "data": [
+ 'workflow_activity_record.xml',
+ 'workflow_transition_record.xml',
+ 'ir_ui_view_record.xml',
+ ],
+}
+
=== 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 @@
+#!/usr/bin/env python
+##############################################################################
+#
+# account_payment_recieved_state module for OpenERP,
+# Copyright (C) 2014 Tuxservices - 0k.io (<http://www.txs.fr>)
+# Authors:
+# - Nicolas JEUDY <njeudy@xxxxxxxxxxxxxxx>
+#
+# This file is a part of account_payment_recieved_state
+#
+# account_payment_recieved_state is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# account_payment_recieved_state is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import osv
+from openerp.osv import orm
+from openerp.osv import fields
+
+
+class AccountInvoice(orm.Model):
+ _inherit = 'account.invoice'
+ STATE_SELECTION = [
+ ('draft','Draft'),
+ ('proforma','Pro-forma'),
+ ('proforma2','Pro-forma'),
+ ('open','Open'),
+ ('payment_received','Payment received'),
+ ('paid','Paid'),
+ ('cancel','Cancelled'),
+ ]
+ _columns = {
+ 'state': fields.selection(STATE_SELECTION,
+ 'Status', select=True, readonly=True, track_visibility='onchange',
+ help=' * The \'Draft\' status is used when a user is encoding a new and unconfirmed Invoice. \
+ \n* The \'Pro-forma\' when invoice is in Pro-forma status,invoice does not have an invoice number. \
+ \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. \
+ \n* The \'Paid\' status is set automatically when the invoice is paid. Its related journal entries may or may not be reconciled. \
+ \n* The \'Cancelled\' status is used when user cancel invoice.'),
+ }
=== 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 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_payment_received_state
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.saas~3\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-02-17 13:10+0000\n"
+"PO-Revision-Date: 2014-02-17 13:10+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_payment_received_state
+#: view:account.invoice:0
+#: selection:account.invoice,state:0
+msgid "Payment Received"
+msgstr "Paiement Reçu"
+
+#. module: account_payment_received_state
+#: view:account.invoice:0
+msgid "Invoices with payment received"
+msgstr "Facture dont un paiement à été reçu (non encaissé)"
+
+#. module: account_payment_received_state
+#: model:ir.model,name:account_payment_received_state.model_account_invoice
+msgid "Invoice"
+msgstr "Facture"
+
+#. module: account_payment_received_state
+#: view:account.invoice:0
+#: selection:account.invoice,state:0
+msgid "Payment received"
+msgstr "Paiement reçu"
+
=== 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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="ir_ui_view_new_account_invoice_form_payment_received_r0" model="ir.ui.view">
+ <field name="name">account.invoice.form.payment_received</field>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//button[@name='invoice_open'][last()]" position="after">
+ <button name="payment_received" string="Payment received" states="open,proforma2"/>
+ </xpath>
+ <xpath expr="//button[@name='invoice_pay_customer']" position="attributes">
+ <attribute name="attrs">{'invisible': ['|', ('state','not in',['open','payment_received']), ('sent','=',False)]}</attribute>
+ </xpath>
+ <xpath expr="//button[@name='invoice_pay_customer']" position="attributes">
+ <attribute name="attrs">{'invisible': ['|', ('state','not in',['open','payment_received']), ('sent','=',True)]}</attribute>
+ </xpath>
+ <xpath expr="//button[@string='Refund Invoice']" position="attributes">
+ <attribute name="states">open,proforma2,paid,payment_received</attribute>
+ </xpath>
+ <xpath expr="//field[@name='state']" position="attributes">
+ <attribute name="statusbar_visible">draft,open,payment_received,paid</attribute>
+ </xpath>
+ </data>
+ </field>
+ <!-- one2many field 'inherit_children_ids' managed on the ir.ui.view side -->
+ <field name="inherit_id" ref="account.invoice_form"/>
+ <field name="model">account.invoice</field>
+ <!-- one2many field 'model_ids' managed on the ir.model.data side -->
+ <field name="priority">25</field>
+ <field name="type">form</field>
+ </record>
+ <record id="ir_ui_view_new_account_invoice_select_payment_received_r0" model="ir.ui.view">
+ <field name="name">account.invoice.select.payment_received</field>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//filter[@name='unpaid']" position="after">
+ <filter name="payment_received" string="Payment Received" domain="[('state','=','payment_received')]" help="Invoices with payment received"/>
+ </xpath>
+ </data>
+ </field>
+ <!-- one2many field 'inherit_children_ids' managed on the ir.ui.view side -->
+ <field name="inherit_id" ref="account.view_account_invoice_filter"/>
+ <field name="model">account.invoice</field>
+ <!-- one2many field 'model_ids' managed on the ir.model.data side -->
+ <field name="priority">25</field>
+ <field name="type">search</field>
+ </record>
+ </data>
+</openerp>
=== 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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="workflow_activity_new_payment_received_r0" model="workflow.activity">
+ <field name="name">payment received</field>
+ <field name="action">write({'state':'payment_received'})</field>
+ <field name="flow_start" eval="False"/>
+ <field name="flow_stop" eval="False"/>
+ <!-- one2many field 'in_transitions' managed on the workflow.transition side -->
+ <field name="join_mode">XOR</field>
+ <field name="kind">function</field>
+ <!-- one2many field 'out_transitions' managed on the workflow.transition side -->
+ <field name="split_mode">XOR</field>
+ <field name="wkf_id" ref="account.wkf"/>
+ </record>
+ </data>
+</openerp>
=== 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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="workflow_transition_new_payment_received_r0" model="workflow.transition">
+ <field name="act_from" ref="account.act_open"/>
+ <field name="act_to" ref="account_payment_received_state.workflow_activity_new_payment_received_r0"/>
+ <field name="condition">True</field>
+ <field name="signal">payment_received</field>
+ </record>
+ <record id="workflow_transition_new_payment_received_r1" model="workflow.transition">
+ <field name="act_from" ref="account_payment_received_state.workflow_activity_new_payment_received_r0"/>
+ <field name="act_to" ref="account.act_paid"/>
+ <field name="condition">True</field>
+ <field name="signal">test_paid()</field>
+ </record>
+ </data>
+</openerp>
Follow ups