← Back to team overview

account-payment-team team mailing list archive

[Merge] lp:~agilebg/account-payment/adding_account_due_list_7 into lp:account-payment/7.0

 

Alex Comba - Agile BG has proposed merging lp:~agilebg/account-payment/adding_account_due_list_7 into lp:account-payment/7.0.

Requested reviews:
  Account Payment (account-payment-team)

For more details, see:
https://code.launchpad.net/~agilebg/account-payment/adding_account_due_list_7/+merge/182330

Added porting account_due_list to 7.0
-- 
https://code.launchpad.net/~agilebg/account-payment/adding_account_due_list_7/+merge/182330
Your team Account Payment is requested to review the proposed merge of lp:~agilebg/account-payment/adding_account_due_list_7 into lp:account-payment/7.0.
=== added directory 'account_due_list'
=== added file 'account_due_list/__init__.py'
--- account_due_list/__init__.py	1970-01-01 00:00:00 +0000
+++ account_due_list/__init__.py	2013-08-27 10:16:39 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#    
+#    Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
+#    Copyright (C) 2011-2013 Agile Business Group sagl
+#    (<http://www.agilebg.com>)
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as published
+#    by the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program 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 Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import account_move_line

=== added file 'account_due_list/__openerp__.py'
--- account_due_list/__openerp__.py	1970-01-01 00:00:00 +0000
+++ account_due_list/__openerp__.py	2013-08-27 10:16:39 +0000
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#    
+#    Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
+#    Copyright (C) 2011-2013 Agile Business Group sagl
+#    (<http://www.agilebg.com>)
+#    @author Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
+#    @author Lorenzo Battistini <lorenzo.battistini@xxxxxxxxxxx>
+#    Ported to OpenERP 7.0 by Alex Comba <alex.comba@xxxxxxxxxxx> and
+#    Bruno Bottacini <bruno.bottacini@xxxxxxxxxxx>
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as published
+#    by the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program 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 Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+{
+    'name': "Payments Due list",
+    'version': '0.1',
+    'category': 'Generic Modules/Payment',
+    'description': """
+A due list of pending payments. The list contains every expected payment, generated by invoices. The list is fully filterable.
+    """,
+    'author': ['Agile Business Group, Zikzakmedia SL'],
+    'website': 'http://www.agilebg.com',
+    'license': 'AGPL-3',
+    "depends" : [
+        'account',
+    ],
+    'conflicts': [
+        'account_payment_extension',
+    ],
+    "data" : [
+        'payment_view.xml',
+    ],
+    "active": False,
+    "installable": True
+}

=== added file 'account_due_list/account_move_line.py'
--- account_due_list/account_move_line.py	1970-01-01 00:00:00 +0000
+++ account_due_list/account_move_line.py	2013-08-27 10:16:39 +0000
@@ -0,0 +1,103 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
+#                       Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
+#    
+#    Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
+#    Copyright (C) 2011-2013 Agile Business Group sagl
+#    (<http://www.agilebg.com>)
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as published
+#    by the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program 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 Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, orm
+from openerp.tools.translate import _
+
+
+class account_move_line(orm.Model):
+        
+    def _get_invoice(self, cr, uid, ids, field_name, arg, context=None):
+        invoice_pool = self.pool.get('account.invoice')
+        res = {}
+        for line in self.browse(cr, uid, ids):
+            inv_ids = invoice_pool.search(cr, uid, [('move_id', '=', line.move_id.id)])
+            if len(inv_ids)>1:
+                raise orm.except_orm(_('Error'),
+                    _('Incongruent data: move %s has more than one invoice')
+                    % line.move_id.name)
+            if inv_ids:
+                res[line.id] = inv_ids[0]
+	    else:
+		res[line.id] = False
+        return res
+        
+    def _get_day(self, cr, uid, ids, field_name, arg, context=None):
+        res = {}
+        for line in self.browse(cr, uid, ids):
+            if line.date_maturity:
+                res[line.id] = line.date_maturity
+	    else: res[line.id] = False
+        return res
+        
+    def _get_move_lines(self, cr, uid, ids, context=None):
+        invoice_pool = self.pool.get('account.invoice')
+        res = []
+        for invoice in invoice_pool.browse(cr, uid, ids):
+            if invoice.move_id:
+                for line in invoice.move_id.line_id:
+                    if line.id not in res:
+                        res.append(line.id)
+        return res
+
+    _inherit = 'account.move.line'
+
+    _columns = {
+        'invoice_origin': fields.related('invoice', 'origin', type='char', string='Source Doc', store=False),
+        'invoice_date': fields.related('invoice', 'date_invoice', type='date', string='Invoice Date', store=False),
+        'partner_ref': fields.related('partner_id', 'ref', type='char', string='Partner Ref', store=False),
+        'payment_term_id': fields.related('invoice', 'payment_term',
+            type='many2one', string='Payment Term', store=False, relation="account.payment.term"),
+        'stored_invoice_id': fields.function(_get_invoice, method=True,
+            string="Invoice", type="many2one", relation="account.invoice",
+            store={
+                'account.move.line': (lambda self, cr, uid, ids, c={}: ids, ['move_id'], 10),
+                'account.invoice': (_get_move_lines, ['move_id'], 10),
+                }),
+        'day': fields.function(_get_day, method=True, string="Day", type="char", size=16,
+                store={
+                'account.move.line': (lambda self, cr, uid, ids, c={}: ids, ['date_maturity'], 10),
+                }),
+        }
+
+    def fields_view_get(self, cr, uid, view_id=None, view_type='form',
+        context={}, toolbar=False, submenu=False):
+        model_data_obj = self.pool.get('ir.model.data')
+        ids = model_data_obj.search(cr, uid, [
+            ('module','=','account_due_list'), ('name','=','view_payments_tree')
+            ])
+        if ids:
+            view_payments_tree_id = model_data_obj.get_object_reference(
+                cr, uid, 'account_due_list', 'view_payments_tree')
+        if ids and view_id == view_payments_tree_id[1]:
+            # Use due list
+            result = super(orm.Model, self).fields_view_get(cr, uid, view_id,
+                view_type, context, toolbar=toolbar, submenu=submenu)
+        else:
+            # Use special views for account.move.line object (for ex. tree view contains user defined fields)
+            result = super(account_move_line, self).fields_view_get(cr, uid,
+                view_id, view_type, context, toolbar=toolbar, submenu=submenu)
+        return result

=== added directory 'account_due_list/i18n'
=== added file 'account_due_list/i18n/de.po'
--- account_due_list/i18n/de.po	1970-01-01 00:00:00 +0000
+++ account_due_list/i18n/de.po	2013-08-27 10:16:39 +0000
@@ -0,0 +1,109 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* account_due_list
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-10-11 08:28+0000\n"
+"PO-Revision-Date: 2011-10-11 10:35+0100\n"
+"Last-Translator: Thomas Winteler <info@xxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Receivable"
+msgstr "Debitor"
+
+#. module: account_due_list
+#: field:account.move.line,invoice_origin:0
+msgid "Source Doc"
+msgstr "Herkunft"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Payable"
+msgstr "Kreditor"
+
+#. module: account_due_list
+#: constraint:account.move.line:0
+msgid "You can not create move line on closed account."
+msgstr "Sie können keine Buchung auf einem bereits abgeschlossenen Konto vornehmen."
+
+#. module: account_due_list
+#: field:account.move.line,invoice_date:0
+msgid "Invoice Date"
+msgstr "Rechnungsdatum"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Unreconciled"
+msgstr "Offene Posten"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Total Debit"
+msgstr "Total Debit"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Group By..."
+msgstr "Gruppierung..."
+
+#. module: account_due_list
+#: sql_constraint:account.move.line:0
+msgid "Wrong credit or debit value in accounting entry !"
+msgstr "Falscher Buchungsbetrag in Soll oder Haben"
+
+#. module: account_due_list
+#: view:account.move.line:0
+#: model:ir.actions.act_window,name:account_due_list.action_invoice_payments
+#: model:ir.ui.menu,name:account_due_list.menu_action_invoice_payments
+msgid "Payments"
+msgstr "Zahlungen"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Search Payments"
+msgstr "Zahlungen suchen"
+
+#. module: account_due_list
+#: model:ir.model,name:account_due_list.model_account_move_line
+msgid "Journal Items"
+msgstr "Buchungsjournale"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Partner"
+msgstr "Partner"
+
+#. module: account_due_list
+#: constraint:account.move.line:0
+msgid "You can not create move line on view account."
+msgstr "Sie können keine Buchungen auf Konten des Typs Ansicht erstellen."
+
+#. module: account_due_list
+#: constraint:account.move.line:0
+msgid "Company must be same for its related account and period."
+msgstr "Das Unternehmen muss für zugehörige Konten und Perioden identisch sein."
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Total Credit"
+msgstr "Total Kredit"
+
+#. module: account_due_list
+#: field:account.move.line,partner_ref:0
+msgid "Partner Ref"
+msgstr "Partner Ref"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Overdue"
+msgstr "Überfällig"
+

=== added file 'account_due_list/i18n/it.po'
--- account_due_list/i18n/it.po	1970-01-01 00:00:00 +0000
+++ account_due_list/i18n/it.po	2013-08-27 10:16:39 +0000
@@ -0,0 +1,157 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* account_due_list
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2012-01-01 14:38+0000\n"
+"PO-Revision-Date: 2012-01-01 15:39+0100\n"
+"Last-Translator: Lorenzo Battistini <lorenzo.battistini@xxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Receivable"
+msgstr "Crediti"
+
+#. module: account_due_list
+#: field:account.move.line,payment_term_id:0
+msgid "Payment Term"
+msgstr "Termini di pagamento"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Unreconciled"
+msgstr "Non riconciliate"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Group By..."
+msgstr "Raggruppa per..."
+
+#. module: account_due_list
+#: field:account.move.line,invoice_origin:0
+msgid "Source Doc"
+msgstr "Documento di origine"
+
+#. module: account_due_list
+#: field:account.move.line,invoice_date:0
+msgid "Invoice Date"
+msgstr "Data fattura"
+
+#. module: account_due_list
+#: code:addons/account_due_list/account_move_line.py:37
+#, python-format
+msgid "Incongruent data: move %s has more than one invoice"
+msgstr "Dati incongruenti: la registrazione %s ha più di una fattura"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Payable"
+msgstr "Debiti"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Search Payments"
+msgstr "Ricerca pagamenti"
+
+#. module: account_due_list
+#: model:ir.model,name:account_due_list.model_account_move_line
+msgid "Journal Items"
+msgstr "Voci sezionale"
+
+#. module: account_due_list
+#: constraint:account.move.line:0
+msgid "Company must be same for its related account and period."
+msgstr "L'azienda deve essere la stessa del suo conto e periodo."
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Total Credit"
+msgstr "Credito totale"
+
+#. module: account_due_list
+#: constraint:account.move.line:0
+msgid "You can not create move line on closed account."
+msgstr "Nonè possibile creare movimenti su un conto chiuso."
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Total Debit"
+msgstr "Debito totale"
+
+#. module: account_due_list
+#: sql_constraint:account.move.line:0
+msgid "Wrong credit or debit value in accounting entry !"
+msgstr "Valore di debito o credito errato nella registrazione contabile"
+
+#. module: account_due_list
+#: view:account.move.line:0
+#: model:ir.actions.act_window,name:account_due_list.action_invoice_payments
+#: model:ir.ui.menu,name:account_due_list.menu_action_invoice_payments
+msgid "Payments"
+msgstr "Pagamenti"
+
+#. module: account_due_list
+#: code:addons/account_due_list/account_move_line.py:37
+#, python-format
+msgid "Error"
+msgstr "Errore"
+
+#. module: account_due_list
+#: model:ir.module.module,description:account_due_list.module_meta_information
+msgid "A due list of pending payments. The list contains every expected payment, generated by invoices. The list is fully filterable."
+msgstr "A due list of pending payments. The list contains every expected payment, generated by invoices. The list is fully filterable."
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Overdue"
+msgstr "Scaduti"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Due date"
+msgstr "Data scadenza"
+
+#. module: account_due_list
+#: model:ir.module.module,shortdesc:account_due_list.module_meta_information
+msgid "Payments Due list"
+msgstr "Scadenzario pagamenti"
+
+#. module: account_due_list
+#: field:account.move.line,day:0
+msgid "Day"
+msgstr "Giorno"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Month"
+msgstr "Mese"
+
+#. module: account_due_list
+#: view:account.move.line:0
+#: field:account.move.line,stored_invoice_id:0
+msgid "Invoice"
+msgstr "Fattura"
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Partner"
+msgstr "Partner"
+
+#. module: account_due_list
+#: field:account.move.line,partner_ref:0
+msgid "Partner Ref"
+msgstr "Rif Partner"
+
+#. module: account_due_list
+#: constraint:account.move.line:0
+msgid "You can not create move line on view account."
+msgstr "Non è possibile creare movimenti su conti vista."
+

=== added file 'account_due_list/payment_view.xml'
--- account_due_list/payment_view.xml	1970-01-01 00:00:00 +0000
+++ account_due_list/payment_view.xml	2013-08-27 10:16:39 +0000
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+    <!--****************************** PAYMENTS ***********************************-->
+    <record id="view_payments_tree" model="ir.ui.view">
+        <field name="name">Payments</field>
+        <field name="model">account.move.line</field>
+        <field name="field_parent">partner_id</field>
+        <field name="priority" eval="20"/>
+        <field name="arch" type="xml">
+            <tree string="Payments" colors="grey:reconcile_id!=False;red:date_maturity&lt;current_date">
+                <field name="stored_invoice_id" readonly="1"/>
+                <field name="invoice_date" readonly="1"/>
+                <field name="invoice_origin" readonly="1"/>
+                <field name="partner_id" readonly="1"/>
+                <field name="partner_ref" readonly="1"/>
+                <field name="payment_term_id" readonly="1"/>
+                <field name="account_id" readonly="1"/>
+                <field name="debit" readonly="1" sum="Total Debit"/>
+                <field name="credit" readonly="1" sum="Total Credit"/>
+                <field name="date_maturity"/>
+                <field name="move_id" readonly="1"/>
+                <field name="reconcile_id" readonly="1"/>
+                <field name="reconcile_partial_id" readonly="1"/>
+                <field name="day" invisible="1"/>
+            </tree>
+        </field>
+    </record>
+
+    <record id="view_payments_filter" model="ir.ui.view">
+        <field name="name">Payments Select</field>
+        <field name="model">account.move.line</field>
+        <field name="priority" eval="20"/>
+        <field name="arch" type="xml">
+            <search string="Search Payments">
+               <group col='10' colspan='4'>
+                    <filter icon="terp-sale" string="Receivable" domain="[('account_id.type','=','receivable')]" help="Receivable payments"/>
+                    <filter icon="terp-purchase" string="Payable" domain="[('account_id.type','=','payable')]" help="Payable payments"/>
+                    <separator orientation="vertical"/>
+                    <filter icon="terp-dolar_ok!" string="Unreconciled" domain="[('reconcile_id','=',False)]" help="Unreconciled payments"/>
+                    <separator orientation="vertical"/>
+                    <filter icon="terp-go-today" string="Overdue" domain="[('date_maturity','&lt;',time.strftime('%%Y-%%m-%%d'))]" help="Overdue payments" name="overdue"/>
+                    <separator orientation="vertical"/>
+                    <field name="account_id"/>
+                    <field name="partner_id"/>
+                    <field name="invoice"/>
+                    <field name="invoice_origin"/>
+                    <field name="date_maturity"/>
+               </group>
+                <newline/>
+                <group expand="0" string="Group By...">
+                    <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
+                    <filter string="Invoice" icon="terp-folder-orange" domain="[]" context="{'group_by':'stored_invoice_id'}"/>
+                    <filter string="Due date" icon="terp-go-today" domain="[]" context="{'group_by':'day'}"/>
+                    <filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'date_maturity'}"/>
+               </group>
+           </search>
+        </field>
+    </record>
+
+    <!-- Invoice Payments -->
+    <record model="ir.actions.act_window" id="action_invoice_payments">
+        <field name="name">Invoice payments</field>
+        <field name="res_model">account.move.line</field>
+        <field name="view_type">form</field>
+        <field name="view_mode">tree,form</field>
+        <field name="view_id" ref="view_payments_tree"/>
+        <field name="search_view_id" ref="view_payments_filter"/>
+        <field name="domain">[('account_id.type','in',['receivable','payable']),('invoice','&lt;&gt;',False)]</field>
+    </record>
+    
+    <menuitem name="Invoice payments" parent="account.menu_finance_entries" action="action_invoice_payments" id="menu_action_invoice_payments" sequence="5"/>
+
+</data>
+</openerp>


Follow ups