← Back to team overview

account-payment-team team mailing list archive

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

 

Nicolas JEUDY has proposed merging lp:~0k.io/account-payment/7.0-account_payment_received_state into lp:account-payment.

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/206763

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.
-- 
https://code.launchpad.net/~0k.io/account-payment/7.0-account_payment_received_state/+merge/206763
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.
=== 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	2014-02-17 16:33:43 +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/>.
+#
+##############################################################################
+from . 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	2014-02-17 16:33:43 +0000
@@ -0,0 +1,48 @@
+# -*- 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	2014-02-17 16:33:43 +0000
@@ -0,0 +1,165 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com)
+#                       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, context=context):
+            inv_ids = invoice_pool.search(
+                cr,
+                uid,
+                [('move_id', '=', line.move_id.id)],
+                context=context
+            )
+            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, context=context):
+            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, context=context):
+            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=None, 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')
+            ],
+            context=context
+        )
+        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/account_due_list.pot'
--- account_due_list/i18n/account_due_list.pot	1970-01-01 00:00:00 +0000
+++ account_due_list/i18n/account_due_list.pot	2014-02-17 16:33:43 +0000
@@ -0,0 +1,151 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* account_due_list
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-11-12 08:17+0000\n"
+"PO-Revision-Date: 2013-11-12 08:17+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_due_list
+#: view:account.move.line:0
+msgid "Receivable"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Unreconciled payments"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Payable payments"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Unreconciled"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Group By..."
+msgstr ""
+
+#. module: account_due_list
+#: field:account.move.line,invoice_origin:0
+msgid "Source Doc"
+msgstr ""
+
+#. module: account_due_list
+#: field:account.move.line,invoice_date:0
+msgid "Invoice Date"
+msgstr ""
+
+#. module: account_due_list
+#: code:addons/account_due_list/account_move_line.py:42
+#, python-format
+msgid "Incongruent data: move %s has more than one invoice"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Payable"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Search Payments"
+msgstr ""
+
+#. module: account_due_list
+#: model:ir.model,name:account_due_list.model_account_move_line
+msgid "Journal Items"
+msgstr ""
+
+#. module: account_due_list
+#: field:account.move.line,day:0
+msgid "Day"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Overdue payments"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Total Debit"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Payments"
+msgstr ""
+
+#. module: account_due_list
+#: code:addons/account_due_list/account_move_line.py:41
+#, python-format
+msgid "Error"
+msgstr ""
+
+#. module: account_due_list
+#: 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 "Invoice payments"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Overdue"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Receivable payments"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Due date"
+msgstr ""
+
+#. module: account_due_list
+#: field:account.move.line,payment_term_id:0
+msgid "Payment Term"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Month"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Total Credit"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+#: field:account.move.line,stored_invoice_id:0
+msgid "Invoice"
+msgstr ""
+
+#. module: account_due_list
+#: view:account.move.line:0
+msgid "Partner"
+msgstr ""
+
+#. module: account_due_list
+#: field:account.move.line,partner_ref:0
+msgid "Partner Ref"
+msgstr ""
+

=== 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	2014-02-17 16:33:43 +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	2014-02-17 16:33:43 +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	2014-02-17 16:33:43 +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>

=== modified file 'account_payment_extension/__init__.py'
--- account_payment_extension/__init__.py	2012-11-01 21:49:33 +0000
+++ account_payment_extension/__init__.py	2014-02-17 16:33:43 +0000
@@ -1,29 +1,33 @@
 # -*- encoding: utf-8 -*-
 ##############################################################################
 #
-#    OpenERP, Open Source Management Solution
-#    Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
-#                       Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
-#    AvanzOSC, Avanzed Open Source Consulting 
-#    Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
-#    $Id$
-#
-#    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/>.
+# OpenERP, Open Source Management Solution
+# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com)
+#                    All Rights Reserved.Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
+# AvanzOSC, Avanzed Open Source Consulting
+# Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
+# Copyright (C) 2013 Akretion Ltda ME (www.akretion.com) All Rights Reserved
+# Renato Lima <renato.lima@xxxxxxxxxxxxxxx>
+# $Id$
+#
+# 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 payment
+import account_payment_extension
+import res_partner
 import account_invoice
 import account_move_line
+import account_payment
 import wizard

=== modified file 'account_payment_extension/__openerp__.py'
--- account_payment_extension/__openerp__.py	2013-09-12 11:10:24 +0000
+++ account_payment_extension/__openerp__.py	2014-02-17 16:33:43 +0000
@@ -1,6 +1,7 @@
 # -*- encoding: utf-8 -*-
 ##############################################################################
 #
+<<<<<<< TREE
 #    OpenERP, Open Source Management Solution
 #    Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
 #                       Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
@@ -22,10 +23,34 @@
 #
 #    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/>.
+=======
+# OpenERP, Open Source Management Solution
+# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com)
+#                    All Rights Reserved.Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
+# AvanzOSC, Avanzed Open Source Consulting
+# Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
+# Copyright (C) 2013 Akretion Ltda ME (www.akretion.com) All Rights Reserved
+# Renato Lima <renato.lima@xxxxxxxxxxxxxxx>
+# $Id$
+#
+# 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/>.
+>>>>>>> MERGE-SOURCE
 #
 ##############################################################################
 
 {
+<<<<<<< TREE
     "name" : "Account Payment Extension",
     "version" : "1.2",
     "author" : "Zikzakmedia SL",
@@ -33,8 +58,20 @@
     "website" : "www.zikzakmedia.com",
     "license" : "AGPL-3",
     "description": """Account payment extension.
+=======
+    'name': 'Account Payment Extension',
+    'version': '1.1',
+    'author': 'Zikzakmedia SL',
+    'category': 'Accounting & Finance',
+    'website': 'www.zikzakmedia.com',
+    'license': 'AGPL-3',
+    'description': """
+Account payment extension.
+==========================
+>>>>>>> MERGE-SOURCE
 
 This module extends the account_payment module with a lot of features:
+----------------------------------------------------------------------
     * Definition of payment types (cash, bank transfer, automatical bank transfer, ...). The payment type has a translatable name and note that can be shown in the invoices.
     * Two default payment types for partners (client and supplier).
     * Automatic selection of payment type in invoices. Now an invoice can have a payment term (30 days, 30/60 days, ...) and a payment type (cash, bank transfer, ...).
@@ -46,11 +83,12 @@
     * Payment orders: Selected invoices are filtered by payment type, the second message communication can be set at the same time for several invoices.
 Based on previous work of Pablo Rocandio & Zikzakmedia (version for 4.2).
 """,
-    "depends" : [
-        "base",
-        "account",
-        "account_payment",
+    'depends': [
+        'base',
+        'account',
+        'account_payment',
         ],
+<<<<<<< TREE
     "init_xml" : [],
     "demo_xml" : [],
     "update_xml" : [
@@ -63,4 +101,19 @@
                     ],
     "active": False,
     "installable": True,
+=======
+    'data': [
+        'security/ir.model.access.csv',
+        'wizard/account_payment_order_view.xml',
+        'account_payment_extension_view.xml',
+        'account_payment_sequence.xml',
+        'account_payment_view.xml',
+        'account_invoice_view.xml',
+        'res_partner_view.xml',
+    ],
+    'demo': [],
+    'test': [],
+    'installable': True,
+    'auto_install': False,
+>>>>>>> MERGE-SOURCE
 }

=== modified file 'account_payment_extension/account_invoice.py'
--- account_payment_extension/account_invoice.py	2012-12-03 08:17:51 +0000
+++ account_payment_extension/account_invoice.py	2014-02-17 16:33:43 +0000
@@ -1,61 +1,72 @@
 # -*- encoding: utf-8 -*-
 ##############################################################################
 #
-#    OpenERP, Open Source Management Solution
-#    Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
-#                       Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
-#    AvanzOSC, Avanzed Open Source Consulting
-#    Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
-#    $Id$
-#
-#    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/>.
+# OpenERP, Open Source Management Solution
+# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com)
+#                    All Rights Reserved.Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
+# AvanzOSC, Avanzed Open Source Consulting
+# Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
+# Copyright (C) 2013 Akretion Ltda ME (www.akretion.com) All Rights Reserved
+# Renato Lima <renato.lima@xxxxxxxxxxxxxxx>
+# $Id$
+#
+# 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 netsvc
-from osv import fields, osv
-
-class account_invoice(osv.osv):
-    _inherit='account.invoice'
-    _columns={
+from openerp.osv import fields, orm
+
+
+class account_invoice(orm.Model):
+    _inherit = 'account.invoice'
+    _columns = {
         'payment_type': fields.many2one('payment.type', 'Payment type'),
     }
 
-    def onchange_partner_id(self, cr, uid, ids, type, partner_id, date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False):
-        # Copy partner data to invoice, also the new field payment_type
-        result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, date_invoice, payment_term, partner_bank_id, company_id)
+    def onchange_partner_id(self, cr, uid, ids, type, partner_id,
+                            date_invoice=False, payment_term=False,
+                            partner_bank_id=False, company_id=False):
+
+        result = super(account_invoice, self).onchange_partner_id(
+            cr, uid, ids, type, partner_id, date_invoice, payment_term,
+            partner_bank_id, company_id)
         payment_type = False
         if partner_id:
-            partner_line = self.pool.get('res.partner').browse(cr, uid, partner_id)
-            if partner_line:
-                if type=='in_invoice' or type=='in_refund':
-                    payment_type = partner_line.payment_type_supplier.id
-                else:
-                    payment_type = partner_line.payment_type_customer.id
-            if payment_type:
-                result['value']['payment_type'] = payment_type
-        return self.onchange_payment_type(cr, uid, ids, payment_type, partner_id, result)
+            partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
+            if type in ('in_invoice', 'in_refund'):
+                payment_type = partner.payment_type_supplier.id
+            else:
+                payment_type = partner.payment_type_customer.id
+            result['value']['payment_type'] = payment_type
+        return self.onchange_payment_type(
+            cr, uid, ids, payment_type, partner_id, result)
 
-    def onchange_payment_type(self, cr, uid, ids, payment_type, partner_id, result = None):
-        if result is None:
+    def onchange_payment_type(self, cr, uid, ids, payment_type,
+                            partner_id, result=None):
+        if not result:
             result = {'value': {}}
+
         if payment_type and partner_id:
-            bank_types = self.pool.get('payment.type').browse(cr, uid, payment_type).suitable_bank_types
-            if bank_types: # If the payment type is related with a bank account
+            bank_types = self.pool.get('payment.type').browse(
+                cr, uid, payment_type).suitable_bank_types
+            # If the payment type is related with a bank account
+            if bank_types:
                 bank_types = [bt.code for bt in bank_types]
                 partner_bank_obj = self.pool.get('res.partner.bank')
-                args = [('partner_id', '=', partner_id), ('default_bank', '=', 1), ('state', 'in', bank_types)]
+                args = [('partner_id', '=', partner_id),
+                    ('default_bank', '=', 1),
+                    ('state', 'in', bank_types)]
                 bank_account_id = partner_bank_obj.search(cr, uid, args)
                 if bank_account_id:
                     result['value']['partner_bank_id'] = bank_account_id[0]
@@ -63,17 +74,20 @@
         result['value']['partner_bank_id'] = False
         return result
 
-    def action_move_create(self, cr, uid, ids, *args):
-        ret = super(account_invoice, self).action_move_create(cr, uid, ids, *args)
-        if ret:
-            for inv in self.browse(cr, uid, ids):
+    def action_move_create(self, cr, uid, ids, context=None):
+        result = super(account_invoice, self).action_move_create(
+            cr, uid, ids, context)
+        if result:
+            for inv in self.browse(cr, uid, ids, context):
                 move_line_ids = []
                 for move_line in inv.move_id.line_id:
-                    if (move_line.account_id.type == 'receivable' or move_line.account_id.type == 'payable') and move_line.state != 'reconciled' and not move_line.reconcile_id.id:
+                    if (move_line.account_id.type == 'receivable' or
+                    move_line.account_id.type == 'payable') and \
+                    move_line.state != 'reconciled' and \
+                    not move_line.reconcile_id.id:
                         move_line_ids.append(move_line.id)
                 if len(move_line_ids) and inv.partner_bank_id:
                     aml_obj = self.pool.get("account.move.line")
-                    aml_obj.write(cr, uid, move_line_ids, {'partner_bank_id': inv.partner_bank_id.id})
-        return ret
-
-account_invoice()
+                    aml_obj.write(cr, uid, move_line_ids,
+                        {'partner_bank_id': inv.partner_bank_id.id})
+        return result

=== added file 'account_payment_extension/account_invoice_view.xml'
--- account_payment_extension/account_invoice_view.xml	1970-01-01 00:00:00 +0000
+++ account_payment_extension/account_invoice_view.xml	2014-02-17 16:33:43 +0000
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record model="ir.ui.view" id="invoice_form3">
+            <field name="name">account.invoice.form3.payment_type</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_form"/>
+            <field name="arch" type="xml">
+                <field name="partner_bank_id" position="replace">
+                    <field domain="[('partner_id', '=', partner_id)]" name="partner_bank_id" on_change="onchange_partner_bank(partner_bank_id)"/>
+                </field>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="invoice_form4">
+            <field name="name">account.invoice.form4.payment_type</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_form"/>
+            <field name="arch" type="xml">
+                <field name="fiscal_position" position="after">
+                    <field domain="[('company_id', '=', company_id)]" name="payment_type" on_change="onchange_payment_type(payment_type, partner_id)" />
+                </field>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="invoice_supplier_form2">
+            <field name="name">account.invoice.supplier.form2</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_supplier_form"/>
+            <field name="arch" type="xml">
+                <field name="fiscal_position" position="after">
+                    <field domain="[('company_id', '=', company_id)]" name="payment_type" on_change="onchange_payment_type(payment_type, partner_id)" />
+                </field>
+            </field>
+        </record>
+
+    </data>
+</openerp>
\ No newline at end of file

=== modified file 'account_payment_extension/account_move_line.py'
--- account_payment_extension/account_move_line.py	2013-09-12 11:01:19 +0000
+++ account_payment_extension/account_move_line.py	2014-02-17 16:33:43 +0000
@@ -1,36 +1,46 @@
 # -*- encoding: utf-8 -*-
 ##############################################################################
 #
-#    OpenERP, Open Source Management Solution
-#    Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
-#                       Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
-#    AvanzOSC, Avanzed Open Source Consulting 
-#    Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
-#    $Id$
-#
-#    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/>.
+# OpenERP, Open Source Management Solution
+# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com)
+#                    All Rights Reserved.Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
+# AvanzOSC, Avanzed Open Source Consulting
+# Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
+# Copyright (C) 2013 Akretion Ltda ME (www.akretion.com) All Rights Reserved
+# Renato Lima <renato.lima@xxxxxxxxxxxxxxx>
+# $Id$
+#
+# 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/>.
 #
 ##############################################################################
 
+<<<<<<< TREE
 import netsvc
 from osv import fields, osv
 from tools.translate import _
 
 class account_move_line(osv.osv):
     _name = 'account.move.line'
+=======
+from openerp.osv import fields, orm
+
+
+class account_move_line(orm.Model):
+>>>>>>> MERGE-SOURCE
     _inherit = 'account.move.line'
 
+<<<<<<< TREE
     def _invoice(self, cursor, user, ids, name, arg, context=None):
         context = context or {}
         invoice_obj = self.pool.get('account.invoice')
@@ -56,6 +66,27 @@
     # def _invoice(self, cr, uid, ids, name, arg, context=None):
     #    return super(account_move_line, self)._invoice(cr, uid, ids, name, arg, context)
     #===========================================================================
+=======
+    def _invoice(self, cr, uid, ids, name, arg, context=None):
+        invoice_obj = self.pool.get('account.invoice')
+        res = {}
+        for line_id in ids:
+            res[line_id] = False
+        
+        cursor.execute('SELECT l.id, i.id ' \
+                       'FROM account_invoice i,account_move_line l ' \
+                       'left join account_move_line r on l.reconcile_id=r.reconcile_id and l.id<>r.id ' \
+                       'left join account_move_line p on l.reconcile_partial_id=p.reconcile_partial_id and l.id<>p.id ' \
+                       'where (i.move_id = l.move_id or i.move_id = r.move_id or i.move_id = p.move_id) ' \
+                       'AND l.id IN %s',
+                        (tuple(ids),))
+        invoice_ids = []        
+ 
+        for line_id, invoice_id in cursor.fetchall():
+            name = invoice_obj.name_get(cursor, user, [invoice_id], context=context)
+            res[line_id] = name and name[0] or False
+        return res
+>>>>>>> MERGE-SOURCE
 
     def _invoice_search(self, cr, uid, obj, name, args, context=None):
         """ Redefinition for searching account move lines without any invoice related ('invoice.id','=',False)"""
@@ -73,44 +104,48 @@
 
     def amount_to_pay(self, cr, uid, ids, name, arg={}, context=None):
         """
-        Return amount pending to be paid taking into account payment lines and the reconciliation.
-        Note that the amount to pay can be due to negative supplier refund invoices or customer invoices.
+        Return amount pending to be paid taking into account payment
+        lines and the reconciliation. Note that the amount to pay can be
+        due to negative supplier refund invoices or customer invoices.
         """
+<<<<<<< TREE
         context = context or {}
+=======
+>>>>>>> MERGE-SOURCE
         if not ids:
             return {}
         cr.execute("""SELECT ml.id,
-                    CASE WHEN ml.amount_currency < 0
-                        THEN - ml.amount_currency
-                        WHEN ml.amount_currency > 0
-                        THEN ml.amount_currency
-                        ELSE ml.credit - ml.debit
-                    END AS debt,
-                    (SELECT coalesce(sum(CASE WHEN pl.type='receivable' THEN -amount_currency ELSE amount_currency END),0)
-                        FROM payment_line pl
-                            INNER JOIN payment_order po
-                                ON (pl.order_id = po.id)
-                        WHERE 
-                            pl.move_line_id = ml.id AND
-                            pl.payment_move_id IS NULL AND 
-                            po.state != 'cancel'
-                    ) AS paid,
-                    (
-                        SELECT
-                            COALESCE( SUM(COALESCE(amrl.credit,0) - COALESCE(amrl.debit,0)), 0 )
-                        FROM
-                            account_move_reconcile amr,
-                            account_move_line amrl
-                        WHERE
-                            amr.id = amrl.reconcile_partial_id AND
-                            amr.id = ml.reconcile_partial_id
-                    ) AS unreconciled,
-                    reconcile_id
-                    FROM account_move_line ml
-                    WHERE id in (%s)""" % (",".join([str(int(x)) for x in ids])))
+            CASE WHEN ml.amount_currency < 0
+                THEN - ml.amount_currency
+                WHEN ml.amount_currency > 0
+                THEN ml.amount_currency
+                ELSE ml.credit - ml.debit
+            END AS debt,
+            (SELECT coalesce(sum(CASE WHEN pl.type='receivable' THEN -amount_currency ELSE amount_currency END),0)
+                FROM payment_line pl
+                    INNER JOIN payment_order po
+                        ON (pl.order_id = po.id)
+                WHERE
+                    pl.move_line_id = ml.id AND
+                    pl.payment_move_id IS NULL AND
+                    po.state != 'cancel'
+            ) AS paid,
+            (
+                SELECT
+                    COALESCE( SUM(COALESCE(amrl.credit,0) - COALESCE(amrl.debit,0)), 0 )
+                FROM
+                    account_move_reconcile amr,
+                    account_move_line amrl
+                WHERE
+                    amr.id = amrl.reconcile_partial_id AND
+                    amr.id = ml.reconcile_partial_id
+            ) AS unreconciled,
+            reconcile_id
+            FROM account_move_line ml
+            WHERE id in (%s)""" % (",".join([str(int(x)) for x in ids])))
         result = {}
         for record in cr.fetchall():
-            id = record[0]
+            move_id = record[0]
             debt = record[1] or 0.0
             paid = record[2]
             unreconciled = record[3]
@@ -124,74 +159,109 @@
                     debt = min(debt - paid, max(0.0, unreconciled))
                 else:
                     debt = max(debt - paid, min(0.0, unreconciled))
-            result[id] = debt
+            result[move_id] = debt
         return result
 
     def _to_pay_search(self, cr, uid, obj, name, args, context=None):
         context = context or {}
         if not len(args):
             return []
-        currency = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.currency_id
+        currency = self.pool.get('res.users').browse(
+            cr, uid, uid, context).company_id.currency_id
 
-        # For searching we first discard reconciled moves because the filter is fast and discards most records
-        # quickly.
-        ids = self.pool.get('account.move.line').search(cr, uid, [('reconcile_id','=',False)], context=context)
-        records = self.pool.get('account.move.line').read(cr, uid, ids, ['id', 'amount_to_pay'], context)
+        # For searching we first discard reconciled moves
+        # because the filter is fast and discards most records quickly.
+        ids = self.pool.get('account.move.line').search(
+            cr, uid, [('reconcile_id', '=', False)], context=context)
+        records = self.pool.get('account.move.line').read(
+            cr, uid, ids, ['id', 'amount_to_pay'], context)
         ids = []
         for record in records:
-            if not self.pool.get('res.currency').is_zero( cr, uid, currency, record['amount_to_pay'] ):
-                ids.append( record['id'] )
+            if not self.pool.get('res.currency').is_zero(
+                cr, uid, currency, record['amount_to_pay']):
+                ids.append(record['id'])
         if not ids:
-            return [('id','=',False)]
-        return [('id','in',ids)]
+            return [('id', '=', False)]
+        return [('id', 'in', ids)]
 
     def _payment_type_get(self, cr, uid, ids, field_name, arg, context=None):
         context = context or {}
         result = {}
         invoice_obj = self.pool.get('account.invoice')
-        for rec in self.browse(cr, uid, ids, context):
-            result[rec.id] = (0,0)
-            invoice_id = invoice_obj.search(cr, uid, [('move_id', '=', rec.move_id.id)], context=context)
+        for move_line in self.browse(cr, uid, ids, context):
+            result[move_line.id] = (0, 0)
+            invoice_id = invoice_obj.search(
+                cr, uid, [('move_id', '=', move_line.move_id.id)],
+                context=context)
             if invoice_id:
                 inv = invoice_obj.browse(cr, uid, invoice_id[0], context)
                 if inv.payment_type:
-                    result[rec.id] = (inv.payment_type.id, self.pool.get('payment.type').browse(cr, uid, inv.payment_type.id, context).name)
-            else:
-                result[rec.id] = (0,0)
+                    result[move_line.id] = (inv.payment_type.id, self.pool.get(
+                        'payment.type').browse(
+                            cr, uid, inv.payment_type.id, context).name)
         return result
 
+<<<<<<< TREE
     def _payment_type_search(self, cr, uid, obj, name, args, context=None):
         context = context or {}
+=======
+    def _payment_type_search(self, cr, uid, obj, name, args, context={}):
+        result = [('id', '=', '0')]
+>>>>>>> MERGE-SOURCE
         if not len(args):
-            return []
-        operator = args[0][1]
+            return result
+#        operator = args[0][1]
         value = args[0][2]
         if not value:
             return []
         if isinstance(value, (int, long)):
             ids = [value]
         elif isinstance(value, list):
-            ids = value 
+            ids = value
         else:
-            ids = self.pool.get('payment.type').search(cr,uid,[('name','ilike',value)], context=context)
+            ids = self.pool.get('payment.type').search(
+                cr, uid, [('name', 'ilike', value)], context=context)
         if ids:
+<<<<<<< TREE
             cr.execute('SELECT l.id ' \
                 'FROM account_move_line l, account_invoice i ' \
                 'WHERE l.move_id = i.move_id AND i.payment_type in %s', (tuple(ids),))
+=======
+            cr.execute("""SELECT l.id
+                FROM
+                    account_move_line l, account_invoice i
+                WHERE
+                    l.move_id = i.move_id AND
+                    i.payment_type in (%s)""" % (','.join(map(str, ids))))
+>>>>>>> MERGE-SOURCE
             res = cr.fetchall()
             if len(res):
-                return [('id', 'in', [x[0] for x in res])]
-        return [('id','=','0')]
+                result = [('id', 'in', [x[0] for x in res])]
+        return result
 
     _columns = {
+<<<<<<< TREE
         'invoice': fields.function(_invoice, method=True, string='Invoice',
             type='many2one', relation='account.invoice', fnct_search=_invoice_search),
         'received_check': fields.boolean('Received check', help="To write down that a check in paper support has been received, for example."),
         'partner_bank_id': fields.many2one('res.partner.bank','Bank Account'),
         'amount_to_pay' : fields.function(amount_to_pay, method=True, type='float', string='Amount to pay', fnct_search=_to_pay_search, store=True),
         'payment_type': fields.function(_payment_type_get, fnct_search=_payment_type_search, method=True, type="many2one", relation="payment.type", string="Payment type"),
+=======
+        'received_check': fields.boolean('Received check',
+            help="""To write down that a check in paper support has
+                been received, for example."""),
+        'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account'),
+        'amount_to_pay': fields.function(
+            amount_to_pay, method=True, type='float', string='Amount to pay',
+            fnct_search=_to_pay_search),
+        'payment_type': fields.function(_payment_type_get,
+            type="many2one", relation="payment.type", method=True,
+            string="Payment type", fnct_search=_payment_type_search),
+>>>>>>> MERGE-SOURCE
     }
 
+<<<<<<< TREE
     def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
         context = context or {}
         for key in vals.keys():
@@ -291,3 +361,14 @@
 account_move_line()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+=======
+    def write(self, cr, uid, ids, vals, context=None,
+            check=True, update_check=True):
+        for key in list(vals.keys()):
+            if key not in ('received_check', 'partner_bank_id',
+            'date_maturity'):
+                return super(account_move_line, self).write(
+                    cr, uid, ids, vals, context, check, update_check)
+        return super(account_move_line, self).write(
+            cr, uid, ids, vals, context, check, update_check=False)
+>>>>>>> MERGE-SOURCE

=== renamed file 'account_payment_extension/payment.py' => 'account_payment_extension/account_payment.py'
--- account_payment_extension/payment.py	2014-01-24 13:13:23 +0000
+++ account_payment_extension/account_payment.py	2014-02-17 16:33:43 +0000
@@ -1,108 +1,81 @@
 # -*- encoding: utf-8 -*-
 ##############################################################################
 #
-#    OpenERP, Open Source Management Solution
-#    Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
-#                       Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
-#    AvanzOSC, Avanzed Open Source Consulting 
-#    Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
-#    $Id$
-#
-#    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/>.
+# OpenERP, Open Source Management Solution
+# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com)
+#                    All Rights Reserved.Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
+# AvanzOSC, Avanzed Open Source Consulting
+# Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
+# Copyright (C) 2013 Akretion Ltda ME (www.akretion.com) All Rights Reserved
+# Renato Lima <renato.lima@xxxxxxxxxxxxxxx>
+# $Id$
+#
+# 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 time
-import netsvc
-from osv import fields, osv
-from tools.translate import _
-import decimal_precision as dp
-
-class payment_type(osv.osv):
-    _name= 'payment.type'
-    _description= 'Payment type'
-    _columns= {
-        'name': fields.char('Name', size=64, required=True, help='Payment Type', translate=True),
-        'code': fields.char('Code', size=64, required=True, help='Specify the Code for Payment Type'),
-        'suitable_bank_types': fields.many2many('res.partner.bank.type','bank_type_payment_type_rel','pay_type_id','bank_type_id','Suitable bank types'),
+from openerp.osv import fields, orm
+from openerp.tools.translate import _
+
+
+class payment_type(orm.Model):
+    _name = 'payment.type'
+    _description = 'Payment type'
+    _columns = {
+        'name': fields.char('Name', size=64, required=True,
+            help='Payment Type', translate=True),
+        'code': fields.char('Code', size=64, required=True,
+            help='Specify the Code for Payment Type'),
+        'suitable_bank_types': fields.many2many(
+            'res.partner.bank.type', 'bank_type_payment_type_rel',
+            'pay_type_id', 'bank_type_id', 'Suitable bank types'),
         'active': fields.boolean('Active', select=True),
-        'note': fields.text('Description', translate=True, help="Description of the payment type that will be shown in the invoices"),
+        'note': fields.text('Description', translate=True,
+            help="""Description of the payment type that will be shown in
+                the invoices"""),
         'company_id': fields.many2one('res.company', 'Company', required=True),
     }
-    
     _defaults = {
-        'active': lambda *a: 1,
-        'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id
+        'active': True,
+        'company_id': lambda self, cr, uid, c: self.pool.get(
+            'res.users').browse(cr, uid, uid, c).company_id.id
     }
 
-payment_type()
-
-
-class payment_mode(osv.osv):
+
+class payment_mode(orm.Model):
     _inherit = 'payment.mode'
     _columns = {
-        'type': fields.many2one('payment.type', 'Payment type', required=True, help='Select the Payment Type for the Payment Mode.'),
-        'require_bank_account': fields.boolean('Require Bank Account', help='Ensure all lines in the payment order have a bank account when proposing lines to be added in the payment order.'),
-        'require_received_check': fields.boolean('Require Received Check', help='Ensure all lines in the payment order have the Received Check flag set.'),
-        'require_same_bank_account': fields.boolean('Require the Same Bank Account', help='Ensure all lines in the payment order and the payment mode have the same account number.'),
+        'type': fields.many2one('payment.type', 'Payment type', required=True,
+            help='Select the Payment Type for the Payment Mode.'),
+        'require_bank_account': fields.boolean('Require Bank Account',
+            help="""Ensure all lines in the payment order have a bank
+                account when proposing lines to be added in the
+                payment order."""),
+        'require_received_check': fields.boolean('Require Received Check',
+            help="""Ensure all lines in the payment order have the
+                Received Check flag set."""),
+        'require_same_bank_account': fields.boolean(
+            'Require the Same Bank Account', help="""Ensure all lines in the
+                payment order and the payment mode have the same
+                account number."""),
     }
     _defaults = {
-        'require_bank_account': lambda *a: False,
-    }
-payment_mode()
-
-
-class res_partner(osv.osv):
-    _inherit='res.partner'
-    _columns={
-        'payment_type_customer': fields.property('payment.type', type='many2one', relation='payment.type', string ='Customer Payment Type', method=True, view_load=True, help="Payment type of the customer"),
-        'payment_type_supplier': fields.property('payment.type', type='many2one', relation='payment.type', string ='Supplier Payment Type', method=True, view_load=True, help="Payment type of the supplier"),
-    }
-res_partner()
-
-
-class res_partner_bank(osv.osv):
-    _inherit="res.partner.bank"
-
-    def create(self, cr, uid, vals, context=None):
-        if vals.get('default_bank') and vals.get('partner_id') and vals.get('state'):
-            sql = "UPDATE res_partner_bank SET default_bank='0' WHERE partner_id=%i AND default_bank='1' AND state='%s'" % (vals['partner_id'], vals['state'])
-            cr.execute(sql)
-        return super(res_partner_bank, self).create(cr, uid, vals, context=context)
-
-    def write(self, cr, uid, ids, vals, context=None):
-        if 'default_bank' in vals and vals['default_bank'] == True:
-            partner_bank = self.pool.get('res.partner.bank').browse(cr, uid, ids)[0]
-            partner_id = partner_bank.partner_id.id
-            if 'state' in vals and vals['state']:
-                state = vals['state']
-            else:
-                state = partner_bank.state
-            sql = "UPDATE res_partner_bank SET default_bank='0' WHERE partner_id=%i AND default_bank='1' AND state='%s' AND id<>%i" % (partner_id, state, ids[0])
-            cr.execute(sql)
-        return super(res_partner_bank, self).write(cr, uid, ids, vals, context=context)
-
-   
-    _columns = {
-        'default_bank' : fields.boolean('Default'),
-    }
-
-res_partner_bank()
-
-
-class payment_order(osv.osv):
-    _name = 'payment.order'
+        'require_bank_account': False,
+    }
+
+
+class payment_order(orm.Model):
     _inherit = 'payment.order'
 
     def _get_type(self, cr, uid, context=None):
@@ -113,24 +86,27 @@
     def _get_reference(self, cr, uid, context=None):
         if context is None:
             context = {}
-        type = context.get('type', 'payable')
-        model = type == 'payable' and 'payment.order' or 'rec.payment.order'
+        PAYMENT_MODEL = {
+            'payable': 'payment.order', 'receivable': 'rec.payment.order'}
+        model = PAYMENT_MODEL.get(context.get('type', 'payable'))
         return self.pool.get('ir.sequence').get(cr, uid, model)
 
     def _get_period(self, cr, uid, context=None):
         try:
-            # find() function will throw an exception if no period can be found for
-            # current date. That should not be a problem because user would be notified
-            # but as this model inherits an existing one, once installed it will create 
-            # the new field and try to update existing records (even if there are no records yet)
-            # So we must ensure no exception is thrown, otherwise the module can only be installed
-            # once periods are created.
+            # find() function will throw an exception if no period can be
+            # found for current date. That should not be a problem because
+            # user would be notified but as this model inherits an existing
+            # one, once installed it will create the new field and try to
+            # update existing records (even if there are no records yet)
+            # So we must ensure no exception is thrown, otherwise the
+            # module can only be installed once periods are created.
             periods = self.pool.get('account.period').find(cr, uid)
             return periods[0]
-        except Exception, e:
+        except Exception:
             return False
 
-    def _payment_type_name_get(self, cr, uid, ids, field_name, arg, context=None):
+    def _payment_type_name_get(self, cr, uid, ids, field_name,
+                            arg, context=None):
         result = {}
         for rec in self.browse(cr, uid, ids, context):
             result[rec.id] = rec.mode and rec.mode.type.name or ""
@@ -144,21 +120,28 @@
 
     _columns = {
         'type': fields.selection([
-            ('payable','Payable'),
-            ('receivable','Receivable'),
-            ],'Type', readonly=True, select=True),
+            ('payable', 'Payable'),
+            ('receivable', 'Receivable'),
+            ], 'Type', readonly=True, select=True),
         # invisible field to filter payment order lines by payment type
-        'payment_type_name': fields.function(_payment_type_name_get, method=True, type="char", size=64, string="Payment type name"),
-        # The field name is necessary to add attachement documents to payment orders
-        'name': fields.function(_name_get, method=True, type="char", size=64, string="Name"),
-        'create_account_moves': fields.selection([('bank-statement','Bank Statement'),('direct-payment','Direct Payment')],
-                                                 'Create Account Moves',
-                                                 required=True,
-                                                 states={'done':[('readonly',True)]},
-                                                 help='Indicates when account moves should be created for order payment lines. "Bank Statement" '\
-                                                      'will wait until user introduces those payments in bank a bank statement. "Direct Payment" '\
-                                                      'will mark all payment lines as payied once the order is done.'),
-        'period_id': fields.many2one('account.period', 'Period', states={'done':[('readonly',True)]}),
+        'payment_type_name': fields.function(
+            _payment_type_name_get, method=True, type="char", size=64,
+            string="Payment type name"),
+        # The field name is necessary to add attachement documents to
+        # payment orders
+        'name': fields.function(
+            _name_get, method=True, type="char", size=64, string="Name"),
+        'create_account_moves': fields.selection(
+            [('bank-statement', 'Bank Statement'),
+            ('direct-payment', 'Direct Payment')], 'Create Account Moves',
+            required=True, states={'done': [('readonly', True)]},
+            help="""Indicates when account moves should be created for
+            order payment lines. 'Bank Statement' will wait until user
+            introduces those payments in bank a bank statement.
+            'Direct Payment' will mark all payment lines as payied once
+            the order is done."""),
+        'period_id': fields.many2one('account.period', 'Period',
+            states={'done': [('readonly', True)]}),
     }
     _defaults = {
         'type': _get_type,
@@ -168,22 +151,21 @@
     }
 
     def cancel_from_done(self, cr, uid, ids, context=None):
-        if context is None:
+        if not context:
             context = {}
 
         #Search for account_moves
         remove = []
-        for move in self.browse(cr,uid,ids,context):
+        for move in self.browse(cr, uid, ids, context=context):
             #Search for any line
-            for line in move.line_ids:
-                if line.payment_move_id:
-                    remove += [ line.payment_move_id.id ]
-        
-        self.pool.get('account.move').button_cancel( cr, uid, remove, context=context)
+            for move_line in move.line_ids:
+                if move_line.payment_move_id:
+                    remove.append(move_line.payment_move_id.id)
+
+        self.pool.get('account.move').button_cancel(
+            cr, uid, remove, context=context)
         self.pool.get('account.move').unlink(cr, uid, remove, context)
-        self.write( cr, uid, ids, {
-            'state':'cancel'
-        },context=context)
+        self.write(cr, uid, ids, {'state': 'cancel'}, context=context)
         return True
 
     def unlink(self, cr, uid, ids, context=None):
@@ -193,13 +175,18 @@
             if t['state'] in ('draft', 'cancel'):
                 unlink_ids.append(t['id'])
             else:
-                raise osv.except_osv(_('Invalid action!'), _('You cannot delete payment order(s) which are already confirmed or done!'))
-        result = super(payment_order, self).unlink(cr, uid, unlink_ids, context=context)
+                raise orm.except_orm(
+                    _('Invalid action!'),
+                    _("""You cannot delete payment order(s) which are
+                        already confirmed or done!"""))
+        result = super(payment_order, self).unlink(
+            cr, uid, unlink_ids, context=context)
         return result
 
     def set_done(self, cr, uid, ids, context=None):
         result = super(payment_order, self).set_done(cr, uid, ids, context)
 
+<<<<<<< TREE
         move_obj = self.pool.get('account.move')
         move_line_obj = self.pool.get('account.move.line')
         currency_obj = self.pool.get('res.currency')
@@ -209,15 +196,32 @@
         user = users_obj.browse(cr, uid, uid, context=context)
         currency = user.company_id.currency_id
         company_currency_id = currency.id
+=======
+        move_obj = self.pool.get('account.move')
+        move_line_obj = self.pool.get('account.move.line')
+        currency_obj = self.pool.get('res.currency')
+        payment_line_obj = self.pool.get('payment.line')
+
+        currency = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.currency_id
+        company_currency_id = currency.id
+>>>>>>> MERGE-SOURCE
 
         for order in self.browse(cr, uid, ids, context):
             if order.create_account_moves != 'direct-payment':
                 continue
 
+<<<<<<< TREE
             # This process creates a simple account move with bank and line 
             # accounts and line's amount. At the end it will reconcile or 
             # partial reconcile both entries if that is possible.
             move_id = move_obj.create(cr, uid, {
+=======
+            # This process creates a simple account move with
+            # bank and line accounts and line's amount. At the end
+            # it will reconcile or partial reconcile both entries
+            # if that is possible.
+            move_id = self.pool.get('account.move').create(cr, uid, {
+>>>>>>> MERGE-SOURCE
                 'name': '/',
                 'journal_id': order.mode.journal.id,
                 'period_id': order.period_id.id,
@@ -228,10 +232,19 @@
                     continue
 
                 if not line.account_id:
+<<<<<<< TREE
                     raise osv.except_osv(_('Error!'), _('Payment order should '
                         'create account moves but line with amount %.2f for '
                         'partner "%s" has no account assigned.') %(
                             line.amount, line.partner_id.name))
+=======
+                    raise orm.except_orm(
+                        _('Error!'),
+                        _("""Payment order should create account moves
+                            but line with amount %.2f for partner "%s" has
+                            no account assigned.""") %
+                            (line.amount, line.partner_id.name))
+>>>>>>> MERGE-SOURCE
 
                 currency_id = (order.mode.journal.currency and
                                order.mode.journal.currency.id or
@@ -241,20 +254,28 @@
                     line_amount = line.amount_currency or line.amount
                 else:
                     line_amount = -line.amount_currency or -line.amount
-                    
+
                 if line_amount >= 0:
                     account_id = order.mode.journal.default_credit_account_id.id
                 else:
                     account_id = order.mode.journal.default_debit_account_id.id
+<<<<<<< TREE
                 acc_cur = ((line_amount<=0) and 
                            order.mode.journal.default_debit_account_id
                            ) or line.account_id
+=======
+                acc_cur = ((line_amount <= 0) and order.mode.journal.default_debit_account_id) or line.account_id
+>>>>>>> MERGE-SOURCE
 
                 ctx = context.copy()
                 ctx['res.currency.compute.account'] = acc_cur
+<<<<<<< TREE
                 amount = currency_obj.compute(cr, uid, currency_id,
                                               company_currency_id, line_amount,
                                               context=ctx)
+=======
+                amount = currency_obj.compute(cr, uid, currency_id, company_currency_id, line_amount, context=ctx)
+>>>>>>> MERGE-SOURCE
 
                 val = {
                     'name': line.move_line_id and line.move_line_id.name or '/',
@@ -263,20 +284,33 @@
                     'ref': line.move_line_id and line.move_line_id.ref or False,
                     'partner_id': line.partner_id and line.partner_id.id or False,
                     'account_id': line.account_id.id,
-                    'debit': ((amount>0) and amount) or 0.0,
-                    'credit': ((amount<0) and -amount) or 0.0,
+                    'debit': ((amount > 0) and amount) or 0.0,
+                    'credit': ((amount < 0) and - amount) or 0.0,
                     'journal_id': order.mode.journal.id,
                     'period_id': order.period_id.id,
+<<<<<<< TREE
                     'currency_id': currency_id,
                     'state': 'valid',
+=======
+                    'state': 'valid',
+>>>>>>> MERGE-SOURCE
                 }
+<<<<<<< TREE
                 
+=======
+
+>>>>>>> MERGE-SOURCE
                 if currency_id <> company_currency_id:
+<<<<<<< TREE
                     amount_cur = currency_obj.compute(cr, uid,
                                                       company_currency_id,
                                                       currency_id, amount,
                                                       context=ctx)
+=======
+                    amount_cur = currency_obj.compute(cr, uid, company_currency_id, currency_id, amount, context=ctx)
+>>>>>>> MERGE-SOURCE
                     val['amount_currency'] = -amount_cur
+                    val['currency_id'] = currency_id
 
                 if line.account_id and line.account_id.currency_id and \
                         line.account_id.currency_id.id <> company_currency_id:
@@ -284,15 +318,23 @@
                     if company_currency_id == line.account_id.currency_id.id:
                         amount_cur = line_amount
                     else:
+<<<<<<< TREE
                         amount_cur = currency_obj.compute(cr, uid,
                             company_currency_id,
                             line.account_id.currency_id.id, amount,
                             context=ctx)
+=======
+                        amount_cur = currency_obj.compute(cr, uid, company_currency_id, line.account_id.currency_id.id, amount, context=ctx)
+>>>>>>> MERGE-SOURCE
                     val['amount_currency'] = amount_cur
 
+<<<<<<< TREE
                 partner_line_id = move_line_obj.create(cr, uid, val,
                                                        context=context,
                                                        check=False)
+=======
+                partner_line_id = move_line_obj.create(cr, uid, val, context, check=False)
+>>>>>>> MERGE-SOURCE
 
                 # Fill the secondary amount/currency
                 # if currency is not the same than the company
@@ -316,8 +358,13 @@
                     'period_id': order.period_id.id,
                     'amount_currency': amount_currency,
                     'currency_id': move_currency_id,
+<<<<<<< TREE
                     'state': 'valid',
                 }, context=context, check=False)
+=======
+                    'state': 'valid',
+                }, context, check=False)
+>>>>>>> MERGE-SOURCE
 
                 if line.move_line_id and not line.move_line_id.reconcile_id:
                     # If payment line has a related move line, we try to reconcile it with the move we just created.
@@ -329,23 +376,43 @@
                         for rline in line.move_line_id.reconcile_partial_id.line_partial_ids:
                             lines_to_reconcile.append(rline.id)
                     else:
+<<<<<<< TREE
                         lines_to_reconcile.append(line.move_line_id.id)
+=======
+                        lines_to_reconcile.append( line.move_line_id.id )
+>>>>>>> MERGE-SOURCE
                     amount = 0.0
+<<<<<<< TREE
                     for rline in move_line_obj.browse(cr, uid,
                                                       lines_to_reconcile,
                                                       context=context):
+=======
+                    for rline in move_line_obj.browse(cr, uid, lines_to_reconcile, context):
+>>>>>>> MERGE-SOURCE
                         amount += rline.debit - rline.credit
+<<<<<<< TREE
         
                     if currency_obj.is_zero(cr, uid, currency, amount):
                         move_line_obj.reconcile(cr, uid, lines_to_reconcile,
                                                 'payment', context=context)
+=======
+
+                    if currency_obj.is_zero(cr, uid, currency, amount):
+                        move_line_obj.reconcile(cr, uid, lines_to_reconcile, 'payment', context=context)
+>>>>>>> MERGE-SOURCE
                     else:
+<<<<<<< TREE
                         move_line_obj.reconcile_partial(cr, uid,
                                                         lines_to_reconcile,
                                                         'payment',
                                                         context=context)
                 # Annotate the move id
                 payment_line_obj.write(cr, uid, [line.id], {
+=======
+                        move_line_obj.reconcile_partial(cr, uid, lines_to_reconcile, 'payment', context)
+                # Annotate the move id
+                payment_line_obj.write(cr, uid, [line.id], {
+>>>>>>> MERGE-SOURCE
                     'payment_move_id': move_id,
                 }, context)
             # Post the move
@@ -354,15 +421,16 @@
 
         return result
 
-payment_order()
-
-
-class payment_line(osv.osv):
-    _name = 'payment.line'
+
+class payment_line(orm.Model):
     _inherit = 'payment.line'
 
     def _auto_init(self, cr, context=None):
-        cr.execute("SELECT column_name FROM information_schema.columns WHERE table_name = 'payment_line' and column_name='type'")
+        cr.execute("""SELECT column_name
+            FROM
+                information_schema.columns
+            WHERE
+                table_name = 'payment_line' and column_name='type'""")
         if cr.fetchone():
             update_sign = False
         else:
@@ -370,29 +438,50 @@
         result = super(payment_line, self)._auto_init(cr, context=context)
 
         if update_sign:
-            # Ensure related store value of field 'type' is updated in the database.
-            # Note that by forcing the update here we also ensure everything is done in the same transaction.
-            # Because addons/__init__.py will execute a commit just after creating table fields.
+            # Ensure related store value of field 'type' is updated in
+            # the database.
+            # Note that by forcing the update here we also ensure
+            # everything is done in the same transaction.
+            # Because addons/__init__.py will execute a commit just
+            # after creating table fields.
             result.sort()
             for item in result:
                 item[1](cr, *item[2])
             # Change sign of 'receivable' payment lines
-            cr.execute("UPDATE payment_line SET amount_currency = -amount_currency WHERE type='receivable'")
+            cr.execute("""UPDATE payment_line
+                SET
+                    amount_currency = -amount_currency
+                WHERE
+                    type='receivable'""")
         return result
 
     _columns = {
-        'move_line_id': fields.many2one('account.move.line', 'Entry line', domain="[('reconcile_id','=', False), ('amount_to_pay','<>',0), ('account_id.type','=',parent.type),('payment_type','ilike',parent.payment_type_name or '%')]", help='This Entry Line will be referred for the information of the ordering customer.'),
-        'payment_move_id': fields.many2one('account.move', 'Payment Move', readonly=True, help='Account move that pays this debt.'),
+        'move_line_id': fields.many2one(
+            'account.move.line', 'Entry line',
+            domain="[('reconcile_id', '=', False), ('amount_to_pay', '!=', 0), ('account_id.type', '=', parent.type), ('payment_type', 'ilike', parent.payment_type_name or '%')]",
+             help="""This Entry Line will be referred for the information
+                 of the ordering customer."""),
+        'payment_move_id': fields.many2one(
+            'account.move', 'Payment Move', readonly=True,
+            help='Account move that pays this debt.'),
         'account_id': fields.many2one('account.account', 'Account'),
-        'type': fields.related('order_id','type', type='selection', selection=[('payable','Payable'),('receivable','Receivable')], readonly=True, store=True, string='Type'),
+        'type': fields.related('order_id', 'type',
+            type='selection', readonly=True, store=True, string='Type',
+            selection=[('payable', 'Payable'), ('receivable', 'Receivable')]),
     }
 
-    def onchange_move_line(self, cr, uid, ids, move_line_id, payment_type, date_prefered, date_scheduled, currency=False, company_currency=False, context=None):
+    def onchange_move_line(self, cr, uid, ids, move_line_id, payment_type,
+                        date_prefered, date_scheduled, currency=False,
+                        company_currency=False, context=None):
         # Adds account.move.line name to the payment line communication
-        res = super(payment_line, self).onchange_move_line(cr, uid, ids, move_line_id, payment_type, date_prefered, date_scheduled, currency, company_currency, context)
+        result = super(payment_line, self).onchange_move_line(
+            cr, uid, ids, move_line_id, payment_type, date_prefered,
+            date_scheduled, currency, company_currency, context)
         if move_line_id:
-            line = self.pool.get('account.move.line').browse(cr, uid, move_line_id)
+            line = self.pool.get('account.move.line').browse(
+                cr, uid, move_line_id, context=context)
             if line.name != '/':
+<<<<<<< TREE
                 res['value']['communication'] = res['value']['communication'] + '. ' + line.name
             res['value']['account_id'] = line.account_id.id
             if context.get('order_id'):
@@ -406,3 +495,14 @@
 payment_line()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+=======
+                result['value']['communication'] = result['value']['communication'] + '. ' + line.name
+            result['value']['account_id'] = line.account_id.id
+            if context.get('order_id'):
+                payment_order = self.pool.get('payment.order').browse(
+                    cr, uid, context['order_id'], context=context)
+                if payment_order.type == 'receivable':
+                    result['value']['amount'] *= -1
+                    result['value']['amount_currency'] *= -1
+        return result
+>>>>>>> MERGE-SOURCE

=== added file 'account_payment_extension/account_payment_extension.py'
--- account_payment_extension/account_payment_extension.py	1970-01-01 00:00:00 +0000
+++ account_payment_extension/account_payment_extension.py	2014-02-17 16:33:43 +0000
@@ -0,0 +1,51 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com)
+#                    All Rights Reserved.Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
+# AvanzOSC, Avanzed Open Source Consulting
+# Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
+# Copyright (C) 2013 Akretion Ltda ME (www.akretion.com) All Rights Reserved
+# Renato Lima <renato.lima@xxxxxxxxxxxxxxx>
+# $Id$
+#
+# 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
+
+
+class payment_type(orm.Model):
+    _name = 'payment.type'
+    _description = 'Payment type'
+    _columns = {
+        'name': fields.char('Name', size=64, required=True,
+            help='Payment Type', translate=True),
+        'code': fields.char('Code', size=64, required=True,
+            help='Specify the Code for Payment Type'),
+        'suitable_bank_types': fields.many2many(
+            'res.partner.bank.type', 'bank_type_payment_type_rel',
+            'pay_type_id', 'bank_type_id', 'Suitable bank types'),
+        'active': fields.boolean('Active', select=True),
+        'note': fields.text('Description', translate=True,
+            help="""Description of the payment type that will be shown
+                in the invoices"""),
+        'company_id': fields.many2one('res.company', 'Company', required=True),
+    }
+    _defaults = {
+        'active': lambda *a: 1,
+        'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id
+    }

=== added file 'account_payment_extension/account_payment_extension_view.xml'
--- account_payment_extension/account_payment_extension_view.xml	1970-01-01 00:00:00 +0000
+++ account_payment_extension/account_payment_extension_view.xml	2014-02-17 16:33:43 +0000
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record model="ir.ui.view" id="view_payment_type_tree">
+        <field name="name">payment.type.tree</field>
+        <field name="model">payment.type</field>
+        <field name="arch" type="xml">
+            <tree string="Payment Type">
+                <field name="name"/>
+                <field name="code"/>
+                <field name="active"/>
+                <field name="company_id" groups="base.group_multi_company"/>
+            </tree>
+        </field>
+    </record>
+
+    <record model="ir.ui.view" id="view_payment_type_form">
+        <field name="name">payment.type.form</field>
+        <field name="model">payment.type</field>
+        <field name="arch" type="xml">
+            <form string="Payment Type">
+                <field name="name" select="1"/>
+                <field name="code" select="1"/>
+                <field name="active" select="1"/>
+                <field name="company_id" select="1" widget='selection' groups="base.group_multi_company"/>
+                <separator string="Description" colspan="4"/>
+                <field name="note" nolabel="1" colspan="4"/>
+                <separator string="Suitable Bank Types" colspan="4"/>
+                <field name="suitable_bank_types" nolabel="1" colspan="4"/>
+            </form>
+        </field>
+    </record>
+
+    <record model="ir.actions.act_window" id="action_payment_type">
+        <field name="name">Payment Type</field>
+        <field name="res_model">payment.type</field>
+        <field name="view_mode">tree,form</field>
+    </record>
+
+    <menuitem action="action_payment_type" id="menu_action_payment_type" parent="account.menu_configuration_misc"/>
+
+</data>
+</openerp>

=== renamed file 'account_payment_extension/payment_sequence.xml' => 'account_payment_extension/account_payment_sequence.xml'
=== renamed file 'account_payment_extension/payment_view.xml' => 'account_payment_extension/account_payment_view.xml'
--- account_payment_extension/payment_view.xml	2013-03-11 09:20:35 +0000
+++ account_payment_extension/account_payment_view.xml	2014-02-17 16:33:43 +0000
@@ -6,132 +6,6 @@
    
         
     <!--
-    ========================================================================================================
-        PARTNERS - default bank
-    ========================================================================================================
-    -->
-    <record model="ir.ui.view" id="view_partner_form">
-        <field name="model">res.partner</field>
-        <field name="inherit_id" ref="account.view_partner_property_form"/>
-        <field name="arch" type="xml">
-            <field name="acc_number" position="after">
-                  <field name="default_bank"/>
-            </field>
-        </field>
-    </record>
-
-    <record model="ir.ui.view" id="view_partner_form2">
-        <field name="model">res.partner</field>
-        <field name="inherit_id" ref="account.view_partner_property_form"/>
-        <field name="arch" type="xml">
-            <tree string="Bank Details" position="inside">
-                <field name="default_bank"/>
-            </tree>
-        </field>
-    </record>
-
-    <record model="ir.ui.view" id="view_partner_form3">
-        <field name="name">view.partner.form3</field>
-        <field name="model">res.partner.bank</field>
-        <field name="inherit_id" ref="base.view_partner_bank_form"/>
-        <field name="arch" type="xml">
-            <field name="acc_number" position="after">
-                <field name="default_bank"/>
-            </field>
-        </field>
-    </record>
-
-    <record model="ir.ui.view" id="view_partner_bank_tree">
-        <field name="name">view.partner.bank.tree </field>
-        <field name="model">res.partner.bank</field>
-        <field name="inherit_id" ref="base.view_partner_bank_tree"/>
-        <field name="arch" type="xml">
-            <field name="partner_id" position="before">
-                <field name="default_bank"/>
-            </field>
-        </field>
-    </record>
-
-
-    <!--
-    ====================================================================================================
-        PARTNERS - payment type
-    ====================================================================================================
-    -->
-    <record model="ir.ui.view" id="view_payment_type_res_partner_form1">
-        <field name="name">res.partner.form.payment_type1</field>
-        <field name="model">res.partner</field>
-        <field name="type">form</field>
-        <field name="inherit_id" ref="account.view_partner_property_form"/>
-        <field name="priority" eval="20"/>
-        <field name="arch" type="xml">
-            <field name="property_account_receivable" position="after">
-                <field name="payment_type_customer" widget="selection"/>
-            </field>
-        </field>
-    </record>
-
-    <record model="ir.ui.view" id="view_payment_type_res_partner_form2">
-        <field name="name">res.partner.form.payment_type2</field>
-        <field name="model">res.partner</field>
-        <field name="type">form</field>
-        <field name="inherit_id" ref="account.view_partner_property_form"/>
-        <field name="priority" eval="20"/>
-        <field name="arch" type="xml">
-            <field name="property_account_payable" position="after">
-                <field name="payment_type_supplier" widget="selection"/>
-            </field>
-        </field>
-    </record>
-
-
-    <!--
-    =====================================================================================================
-        PAYMENT TYPE
-    =====================================================================================================
-    -->
-        <record model="ir.ui.view" id="view_payment_type_tree">
-        <field name="name">payment.type.tree</field>
-        <field name="model">payment.type</field>
-        <field name="type">tree</field>
-        <field name="arch" type="xml">
-            <tree string="Payment Type">
-                <field name="name"/>
-                <field name="code"/>
-                <field name="active"/>
-                <field name="company_id" groups="base.group_multi_company"/>
-            </tree>
-        </field>
-    </record>
-
-    <record model="ir.ui.view" id="view_payment_type_form">
-        <field name="name">payment.type.form</field>
-        <field name="model">payment.type</field>
-        <field name="type">form</field>
-        <field name="arch" type="xml">
-            <form string="Payment Type">
-                <field name="name" select="1"/>
-                <field name="code" select="1"/>
-                <field name="active" select="1"/>
-                <field name="company_id" select="1" widget='selection' groups="base.group_multi_company"/>
-                <separator string="Description" colspan="4"/>
-                <field name="note" nolabel="1" colspan="4"/>
-                <separator string="Suitable Bank Types" colspan="4"/>
-                <field name="suitable_bank_types" nolabel="1" colspan="4"/>
-            </form>
-        </field>
-    </record>
-
-    <record model="ir.actions.act_window" id="action_payment_type">
-        <field name="name">Payment Type</field>
-        <field name="res_model">payment.type</field>
-        <field name="view_mode">tree,form</field>
-    </record>
-
-    <menuitem action="action_payment_type" id="menu_action_payment_type" parent="account.menu_configuration_misc"/>
-
-
-    <!--
     =======================================================================================================
         PAYMENT MODE
     =======================================================================================================
@@ -139,7 +13,6 @@
     <record id="view_payment_mode_form_require_bank_account" model="ir.ui.view">
         <field name="name">payment.mode.form.require_bank_account</field>
         <field name="model">payment.mode</field>
-        <field name="type">form</field>
         <field name="inherit_id" ref="account_payment.view_payment_mode_form"/>
         <field name="arch" type="xml">
             <field name="bank_id" position="before">
@@ -149,6 +22,7 @@
         </field>
     </record>
 
+<<<<<<< TREE
 
     <!--
     =================================================================================================
@@ -198,10 +72,17 @@
     <!--
     <record model="ir.ui.view" id="payments_move_line_tree">
         <field name="name">account.payments.move.line.tree</field>
+=======
+    <!--************ account.move.line extension to show additional fields ********** -->
+    <record model="ir.ui.view" id="view_move_line_tree_wiz">
+        <field name="name">account.move.line.tree</field>
+>>>>>>> MERGE-SOURCE
         <field name="model">account.move.line</field>
-        <field name="type">tree</field>
-        <field name="inherit_id" ref="account_payment.view_move_line_tree_wiz"/>
+        <field name="inherit_id" ref="account.view_move_line_tree"/>
         <field name="arch" type="xml">
+            <field name="reconcile" position="after">
+                <field name="amount_to_pay"/>
+            </field>
             <field name="currency_id" position="replace">
                 <field name="currency_id" groups="base.group_extended"/>
                 <field name="reconcile_id"/>
@@ -215,20 +96,18 @@
     <record model="ir.ui.view" id="payments_move_line_form">
         <field name="name">account.payments.move.line.form</field>
         <field name="model">account.move.line</field>
-        <field name="type">form</field>
         <field name="inherit_id" ref="account.view_move_line_form"/>
         <field name="arch" type="xml">
-            <separator string="Internal Note" position="before">
-                <group col="2" colspan="2">
-                    <separator colspan="2" string="Payment"/>
+            <field name="narration" position="before">
+        <!--        <group col="2" colspan="2">
+                    <separator colspan="2" string="Payment"/> -->
                     <field name="payment_type" select="1" widget="selection"/>
                     <field name="partner_bank_id" domain="[('partner_id','=',partner_id)]"/>
                     <field name="received_check"/>
-                </group>
-            </separator>
+        <!--        </group> -->
+            </field>
         </field>
     </record>
-	-->
 
     <!--
     ========================================================================================================
@@ -239,12 +118,11 @@
     <record id="view_bank_statement_form_ext" model="ir.ui.view">
         <field name="name">account.bank.statement.form.ext</field>
         <field name="model">account.bank.statement</field>
-        <field name="type">form</field>
         <field name="inherit_id" ref="account_payment.view_bank_statement_form"/>
         <field name="arch" type="xml">
             <button name="%(account_payment.action_account_populate_statement_confirm)d" position="replace">
                   <button name="%(act_wizard_populate_statement)d" string="Import payment lines" type="action" attrs="{'invisible':[('state','=','confirm')]}" icon="gtk-execute"/>
-			  </button>
+            </button>
         </field>
     </record>
      -->
@@ -257,27 +135,20 @@
     <record id="view_payment_order_form_ext1" model="ir.ui.view">
         <field name="name">payment.order.form.ext1</field>
         <field name="model">payment.order</field>
-        <field name="type">form</field>
         <field name="inherit_id" ref="account_payment.view_payment_order_form"/>
         <field name="arch" type="xml">
             <button name="%(account_payment.action_create_payment_order)d" position="replace">
+                <button name="%(action_create_payment_extension_order)d" string="Select invoices to pay/receive payment" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/>
+            </button>
+            <button name="cancel" position="after">
+                <button name="cancel_from_done" states="done" type="object" string="Cancel" icon="gtk-cancel"/>
+            </button>
+            <field name="mode" position="after">
                 <field name="payment_type_name" invisible="1"/>
                 <field name="type"/>
                 <field name="create_account_moves"/>
-                <group colspan="2" col="1" attrs="{'invisible': [('create_account_moves', '=', 'bank-statement')]}">
-                    <field name="period_id" attrs="{'required': [('create_account_moves', '!=', 'bank-statement')]}"/>
-                </group>
-				<button colspan="2" name="%(action_create_payment_extension_order)d" string="Select invoices to pay/receive payment" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/>
-            </button>
-        </field>
-    </record>
-
-    <record id="view_payment_order_form_ext2" model="ir.ui.view">
-        <field name="name">payment.order.form.ext2</field>
-        <field name="model">payment.order</field>
-        <field name="type">form</field>
-        <field name="inherit_id" ref="account_payment.view_payment_order_form"/>
-        <field name="arch" type="xml">
+                    <field name="period_id" attrs="{'required': [('create_account_moves', '!=', 'bank-statement')], 'invisible': [('create_account_moves', '=', 'bank-statement')]}"/>
+            </field>
             <field name="move_line_id" position="replace">
             <group col="6" colspan="4">
                 <field name="move_line_id" on_change="onchange_move_line(move_line_id,parent.mode,parent.date_prefered,parent.date_scheduled,currency,company_currency,context)" select="1"/>
@@ -288,22 +159,9 @@
         </field>
     </record>
 
-    <record id="view_payment_order_form_cancel" model="ir.ui.view">
-        <field name="name">payment.order.form.cancel</field>
-        <field name="model">payment.order</field>
-        <field name="type">form</field>
-        <field name="inherit_id" ref="account_payment.view_payment_order_form"/>
-        <field name="arch" type="xml">
-            <button name="cancel" position="after">
-                <button name="cancel_from_done" states="done" type="object" string="Cancel" icon="gtk-cancel"/>
-            </button>
-        </field>
-    </record>
-
     <record id="view_payment_line_form_ext1" model="ir.ui.view">
         <field name="name">payment.line.ext1</field>
         <field name="model">payment.line</field>
-        <field name="type">form</field>
         <field name="inherit_id" ref="account_payment.view_payment_line_form"/>
         <field name="arch" type="xml">
             <field name="move_line_id" position="replace">
@@ -316,9 +174,12 @@
         </field>
     </record>
 
-
-
-
+<<<<<<< TREE
+
+
+
+=======
+>>>>>>> MERGE-SOURCE
     <!--
     ====================================================================================================
         PAYABLE PAYMENT ORDER
@@ -329,8 +190,8 @@
         <field name="res_model">payment.order</field>
         <field name="view_type">form</field>
         <field name="view_mode">tree,form</field>
-        <field name="domain">[('type','=','payable')]</field>
-        <field name="context">{'type':'payable'}</field>
+        <field name="domain">[('type', '=', 'payable')]</field>
+        <field name="context">{'type': 'payable'}</field>
     </record>
 
     <!--
@@ -343,8 +204,8 @@
         <field name="res_model">payment.order</field>
         <field name="view_type">form</field>
         <field name="view_mode">tree,form</field>
-        <field name="domain">[('type','=','receivable')]</field>
-        <field name="context">{'type':'receivable'}</field>
+        <field name="domain">[('type', '=', 'receivable')]</field>
+        <field name="context">{'type': 'receivable'}</field>
     </record>
     <menuitem action="action_rec_payment_order_tree" id="menu_action_rec_payment_order_form" parent="account_payment.menu_main_payment" sequence="2"/>
 
@@ -357,11 +218,9 @@
         <field name="name">Payments</field>
         <field name="model">account.move.line</field>
         <field name="field_parent">partner_id</field>
-        <field name="type">tree</field>
         <field name="priority" eval="20"/>
         <field name="arch" type="xml">
-            <tree string="Payments" editable="top"
-                        colors="grey:reconcile_id!=0;blue:amount_to_pay==0;red:date_maturity&lt;time.strftime('%%Y-%%m-%%d')">
+            <tree string="Payments" editable="top" colors="grey:reconcile_id!=0;blue:amount_to_pay==0;red:date_maturity&lt;time.strftime('%%Y-%%m-%%d')">
                 <field name="invoice" readonly="1"/>
                 <field name="partner_id" readonly="1"/>
                 <field name="account_id" readonly="1"/>
@@ -385,24 +244,23 @@
     <record id="view_payments_filter" model="ir.ui.view">
         <field name="name">Invoice Payments Select</field>
         <field name="model">account.move.line</field>
-        <field name="type">search</field>
         <field name="priority" eval="20"/>
         <field name="arch" type="xml">
             <search string="Search Invoice Payments">
-               <group col='10' colspan='4'>
                     <filter icon="terp-sale" string="Receive" domain="[('account_id.type','=','receivable')]" help="Receivable payments"/>
                     <filter icon="terp-purchase" string="Pay" domain="[('account_id.type','=','payable')]" help="Payable payments"/>
-                    <separator orientation="vertical"/>
+                    <separator/>
                     <filter icon="terp-dolar_ok!" string="Unreconciled" domain="[('reconcile_id','=',False)]" help="Unreconciled payments"/>
                     <field name="account_id"/>
                     <field name="partner_id"/>
                     <field name="invoice"/>
                     <field name="date_maturity"/>
-                    <newline/>
+                    <separator/>
                     <field name="amount_to_pay"/>
                     <field name="payment_type" widget="selection"/>
                     <field name="partner_bank_id"/>
                     <field name="received_check"/>
+<<<<<<< TREE
                </group>
                <newline/>
                 <group expand="0" string="Group By...">
@@ -416,30 +274,53 @@
 
                 </group>
            </search>
+=======
+                    <group expand="0" string="Group By...">
+                        <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
+                        <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
+                        <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
+                        <separator/>
+                        <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
+                        <filter string="Effective date" icon="terp-go-month" domain="[]" context="{'group_by':'date_maturity'}"/>
+                    </group>
+            </search>
+>>>>>>> MERGE-SOURCE
         </field>
     </record>
+<<<<<<< TREE
 
     <!--Invoice Payments-->
+=======
+
+    <!-- Invoice Payments -->
+>>>>>>> MERGE-SOURCE
     <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_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>
+        <field name="domain">[('account_id.type', 'in', ['receivable', 'payable']), ('reconcile_id', '=', False)]</field>
     </record>
+
     <menuitem name="Invoice payments" parent="account_payment.menu_main_payment" action="action_invoice_payments" id="menu_action_invoice_payments" sequence="4"/>
+<<<<<<< TREE
 	
     <!-- Done Payments
+=======
+-
+    <!-- Done Payments -->
+>>>>>>> MERGE-SOURCE
     <record model="ir.actions.act_window" id="action_done_payments">
         <field name="name">Done payments</field>
         <field name="res_model">account.move.line</field>
         <field name="view_type">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','=',False)]</field>
+        <field name="domain">[('account_id.type', 'in', ['receivable', 'payable']), ('reconcile_id', '!=', False)]</field>
     </record>
+
     <menuitem name="Done payments" parent="account_payment.menu_main_payment" action="action_done_payments" id="menu_action_done_payments" sequence="5"/>
-	-->
+
 </data>
 </openerp>

=== modified file 'account_payment_extension/i18n/account_payment_extension.pot'
--- account_payment_extension/i18n/account_payment_extension.pot	2013-05-15 16:18:16 +0000
+++ account_payment_extension/i18n/account_payment_extension.pot	2014-02-17 16:33:43 +0000
@@ -4,10 +4,17 @@
 #
 msgid ""
 msgstr ""
+<<<<<<< TREE
 "Project-Id-Version: OpenERP Server 6.1\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2013-05-15 16:13+0000\n"
 "PO-Revision-Date: 2013-05-15 16:13+0000\n"
+=======
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-21 09:20+0000\n"
+"PO-Revision-Date: 2013-10-21 09:20+0000\n"
+>>>>>>> MERGE-SOURCE
 "Last-Translator: <>\n"
 "Language-Team: \n"
 "MIME-Version: 1.0\n"
@@ -16,6 +23,7 @@
 "Plural-Forms: \n"
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: view:payment.order.create:0
 msgid "Extra message of payment communication"
 msgstr "Extra message of payment communication"
@@ -29,20 +37,154 @@
 #: model:ir.actions.act_window,help:account_payment_extension.action_pay_account_move_line
 msgid "with this wizard ypu can change the state of the selected entries. "
 msgstr "with this wizard ypu can change the state of the selected entries. "
+=======
+#: selection:payment.line,type:0
+#: selection:payment.order,type:0
+msgid "Receivable"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:payment.order.create:0
+msgid "Extra message of payment communication"
+msgstr ""
+
+#. module: account_payment_extension
+#: selection:payment.order,create_account_moves:0
+msgid "Direct Payment"
+msgstr ""
+
+#. module: account_payment_extension
+#: field:payment.mode,require_received_check:0
+msgid "Require Received Check"
+msgstr ""
+
+#. module: account_payment_extension
+#: field:payment.line,payment_move_id:0
+msgid "Payment Move"
+msgstr ""
+
+#. module: account_payment_extension
+#: help:payment.mode,require_bank_account:0
+msgid "Ensure all lines in the payment order have a bank\n"
+"                account when proposing lines to be added in the\n"
+"                payment order."
+msgstr ""
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "Pay"
+msgstr ""
+
+#. module: account_payment_extension
+#: model:ir.model,name:account_payment_extension.model_payment_order
+msgid "Payment Order"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "Receive"
+msgstr ""
+
+#. module: account_payment_extension
+#: model:ir.actions.act_window,name:account_payment_extension.action_payment_type
+#: model:ir.ui.menu,name:account_payment_extension.menu_action_payment_type
+#: view:payment.type:0
+#: help:payment.type,name:0
+msgid "Payment Type"
+msgstr ""
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: field:payment.mode,require_bank_account:0
 msgid "Require Bank Account"
+<<<<<<< TREE
 msgstr "Require Bank Account"
 
 #. module: account_payment_extension
+=======
+msgstr ""
+
+#. module: account_payment_extension
+#: help:payment.type,note:0
+msgid "Description of the payment type that will be shown in\n"
+"                the invoices"
+msgstr ""
+
+#. module: account_payment_extension
+#: model:ir.actions.act_window,name:account_payment_extension.action_rec_payment_order_tree
+#: model:ir.ui.menu,name:account_payment_extension.menu_action_rec_payment_order_form
+msgid "Rec. payment order"
+msgstr ""
+
+#. module: account_payment_extension
+#: help:payment.order,create_account_moves:0
+msgid "Indicates when account moves should be created for\n"
+"            order payment lines. 'Bank Statement' will wait until user\n"
+"            introduces those payments in bank a bank statement.\n"
+"            'Direct Payment' will mark all payment lines as payied once\n"
+"            the order is done."
+msgstr ""
+
+#. module: account_payment_extension
+#: model:ir.model,name:account_payment_extension.model_payment_line
+msgid "Payment Line"
+msgstr ""
+
+#. module: account_payment_extension
+#: code:addons/account_payment_extension/account_payment.py:218
+#, python-format
+msgid "Payment order should create account moves\n"
+"                            but line with amount %.2f for partner \"%s\" has\n"
+"                            no account assigned."
+msgstr ""
+
+#. module: account_payment_extension
+#: help:payment.type,code:0
+msgid "Specify the Code for Payment Type"
+msgstr ""
+
+#. module: account_payment_extension
+#: model:ir.model,name:account_payment_extension.model_payment_mode
+msgid "Payment Mode"
+msgstr ""
+
+#. module: account_payment_extension
+#: field:payment.order.create,communication2:0
+msgid "Communication 2"
+msgstr ""
+
+#. module: account_payment_extension
+#: field:payment.line,type:0
+#: field:payment.order,type:0
+msgid "Type"
+msgstr ""
+
+#. module: account_payment_extension
+>>>>>>> MERGE-SOURCE
 #: view:account.move.line:0
+<<<<<<< TREE
 msgid "Group By..."
 msgstr "Group By..."
+=======
+msgid "Search Invoice Payments"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:payment.type:0
+msgid "Suitable Bank Types"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:payment.type:0
+#: field:payment.type,note:0
+msgid "Description"
+msgstr ""
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: field:payment.type,company_id:0
 msgid "Company"
+<<<<<<< TREE
 msgstr "Company"
 
 #. module: account_payment_extension
@@ -53,69 +195,213 @@
 
 #. module: account_payment_extension
 #: selection:payment.line,type:0
+=======
+msgstr ""
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "Unreconciled payments"
+msgstr ""
+
+#. module: account_payment_extension
+#: field:payment.order,payment_type_name:0
+msgid "Payment type name"
+msgstr ""
+
+#. module: account_payment_extension
+#: selection:payment.line,type:0
+>>>>>>> MERGE-SOURCE
 #: selection:payment.order,type:0
 msgid "Payable"
+<<<<<<< TREE
 msgstr "Payable"
 
 #. module: account_payment_extension
+=======
+msgstr ""
+
+#. module: account_payment_extension
+>>>>>>> MERGE-SOURCE
 #: field:res.partner,payment_type_customer:0
 msgid "Customer Payment Type"
+<<<<<<< TREE
 msgstr "Customer Payment Type"
 
 #. module: account_payment_extension
 #: view:payment.order.create:0
+=======
+msgstr ""
+
+#. module: account_payment_extension
+#: field:payment.mode,require_same_bank_account:0
+msgid "Require the Same Bank Account"
+msgstr ""
+
+#. module: account_payment_extension
+#: field:res.partner,payment_type_supplier:0
+msgid "Supplier Payment Type"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:payment.order.create:0
+>>>>>>> MERGE-SOURCE
 msgid "Entries"
-msgstr "Entries"
+msgstr ""
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: view:account.move.line.payment:0
 msgid "Pay Journal Entries"
 msgstr "Pay Journal Entries"
+=======
+#: field:payment.type,active:0
+msgid "Active"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:payment.order:0
+msgid "Select invoices to pay/receive payment"
+msgstr ""
+
+#. module: account_payment_extension
+#: help:payment.line,payment_move_id:0
+msgid "Account move that pays this debt."
+msgstr ""
+
+#. module: account_payment_extension
+#: help:account.move.line,received_check:0
+msgid "To write down that a check in paper support has\n"
+"                been received, for example."
+msgstr ""
+
+#. module: account_payment_extension
+#: help:payment.order.create,communication2:0
+msgid "The successor message of payment communication."
+msgstr ""
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: view:account.move.line:0
+<<<<<<< TREE
 msgid "Total Credit"
 msgstr "Total Credit"
+=======
+msgid "Total Credit"
+msgstr ""
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: field:payment.order,create_account_moves:0
 msgid "Create Account Moves"
-msgstr "Create Account Moves"
-
-#. module: account_payment_extension
+msgstr ""
+
+#. module: account_payment_extension
+<<<<<<< TREE
+=======
+#: help:payment.mode,require_same_bank_account:0
+msgid "Ensure all lines in the\n"
+"                payment order and the payment mode have the same\n"
+"                account number."
+msgstr ""
+
+#. module: account_payment_extension
+>>>>>>> MERGE-SOURCE
 #: field:payment.line,account_id:0
 msgid "Account"
-msgstr "Account"
+msgstr ""
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: help:payment.mode,require_bank_account:0
 msgid "Ensure all lines in the payment order have a bank account when proposing lines to be added in the payment order."
 msgstr "Ensure all lines in the payment order have a bank account when proposing lines to be added in the payment order."
+=======
+#: field:payment.type,suitable_bank_types:0
+msgid "Suitable bank types"
+msgstr ""
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: view:account.move.line:0
 msgid "Due Date"
 msgstr "Due Date"
-
-#. module: account_payment_extension
-#: view:account.move.line:0
+=======
+#: field:payment.order,name:0
+#: field:payment.type,name:0
+msgid "Name"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "Receivable payments"
+msgstr ""
+>>>>>>> MERGE-SOURCE
+
+#. module: account_payment_extension
+<<<<<<< TREE
+=======
+#: field:res.partner.bank,default_bank:0
+msgid "Default"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "Total Amount to Pay"
+msgstr ""
+
+#. module: account_payment_extension
+#: code:addons/account_payment_extension/account_payment.py:180
+#, python-format
+msgid "You cannot delete payment order(s) which are\n"
+"                        already confirmed or done!"
+msgstr ""
+
+#. module: account_payment_extension
+#: field:account.move.line,partner_bank_id:0
+msgid "Bank Account"
+msgstr ""
+
+#. module: account_payment_extension
+#: code:addons/account_payment_extension/account_payment.py:179
+#, python-format
+msgid "Invalid action!"
+msgstr ""
+
+#. module: account_payment_extension
+>>>>>>> MERGE-SOURCE
+#: view:account.move.line:0
+<<<<<<< TREE
 msgid "Total Debit"
 msgstr "Total Debit"
 
 #. module: account_payment_extension
 #: code:addons/account_payment_extension/payment.py:223
+=======
+msgid "Effective date"
+msgstr ""
+
+#. module: account_payment_extension
+#: model:ir.actions.act_window,name:account_payment_extension.action_create_payment_extension_order
+msgid "Seleccionar facturas a Pagar/Cobrar"
+msgstr ""
+
+#. module: account_payment_extension
+#: code:addons/account_payment_extension/account_payment.py:217
+>>>>>>> MERGE-SOURCE
 #, python-format
 msgid "Error!"
-msgstr "Error!"
+msgstr ""
 
 #. module: account_payment_extension
 #: field:payment.order.create,amount:0
 msgid "Amount"
-msgstr "Amount"
+msgstr ""
 
 #. module: account_payment_extension
 #: help:payment.mode,type:0
 msgid "Select the Payment Type for the Payment Mode."
+<<<<<<< TREE
 msgstr "Select the Payment Type for the Payment Mode."
 
 #. module: account_payment_extension
@@ -182,6 +468,24 @@
 #: field:res.partner,payment_type_supplier:0
 msgid "Supplier Payment Type"
 msgstr "Supplier Payment Type"
+=======
+msgstr ""
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "Payments"
+msgstr ""
+
+#. module: account_payment_extension
+#: model:ir.model,name:account_payment_extension.model_payment_order_create
+msgid "payment.order.create"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "Payable payments"
+msgstr ""
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: view:account.move.line:0
@@ -250,9 +554,10 @@
 #. module: account_payment_extension
 #: help:res.partner,payment_type_customer:0
 msgid "Payment type of the customer"
-msgstr "Payment type of the customer"
+msgstr ""
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: view:account.move.line.payment:0
 msgid "Change payment entries"
 msgstr "Change payment entries"
@@ -356,55 +661,138 @@
 #: constraint:account.move.line:0
 msgid "You can not create journal items on an account of type view."
 msgstr "You can not create journal items on an account of type view."
+=======
+#: view:account.move.line:0
+msgid "Total Debit"
+msgstr ""
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: model:ir.actions.act_window,name:account_payment_extension.action_invoice_payments
 #: model:ir.ui.menu,name:account_payment_extension.menu_action_invoice_payments
 msgid "Invoice payments"
-msgstr "Invoice payments"
-
-#. module: account_payment_extension
+msgstr ""
+
+#. module: account_payment_extension
+#: help:payment.mode,require_received_check:0
+msgid "Ensure all lines in the payment order have the\n"
+"                Received Check flag set."
+msgstr ""
+
+#. module: account_payment_extension
+<<<<<<< TREE
 #: help:payment.mode,require_same_bank_account:0
 msgid "Ensure all lines in the payment order and the payment mode have the same account number."
 msgstr "Ensure all lines in the payment order and the payment mode have the same account number."
+=======
+#: model:ir.actions.act_window,name:account_payment_extension.action_done_payments
+#: model:ir.ui.menu,name:account_payment_extension.menu_action_done_payments
+msgid "Done payments"
+msgstr ""
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: sql_constraint:account.invoice:0
 msgid "Invoice Number must be unique per Company!"
 msgstr "Invoice Number must be unique per Company!"
+=======
+#: field:account.invoice,payment_type:0
+#: field:account.move.line,payment_type:0
+#: model:ir.model,name:account_payment_extension.model_payment_type
+#: field:payment.mode,type:0
+msgid "Payment type"
+msgstr ""
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: field:payment.type,code:0
 msgid "Code"
-msgstr "Code"
+msgstr ""
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: help:payment.type,note:0
 msgid "Description of the payment type that will be shown in the invoices"
 msgstr "Description of the payment type that will be shown in the invoices"
 
 #. module: account_payment_extension
 #: view:account.move.line:0
+=======
+#: view:res.partner:0
+msgid "Bank Details"
+msgstr ""
+
+#. module: account_payment_extension
+#: field:payment.order.create,show_refunds:0
+msgid "Show Refunds"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "State"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "Group By..."
+msgstr ""
+
+#. module: account_payment_extension
+#: help:payment.order.create,amount:0
+msgid "Next step will automatically select payments up to this amount as long as account moves have bank account if that is required by the selected payment mode."
+msgstr ""
+
+#. module: account_payment_extension
+#: help:payment.order.create,show_refunds:0
+msgid "Indicates if search should include refunds."
+msgstr ""
+
+#. module: account_payment_extension
+#: model:ir.model,name:account_payment_extension.model_res_partner_bank
+msgid "Bank Accounts"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+>>>>>>> MERGE-SOURCE
 #: field:payment.order,period_id:0
 msgid "Period"
-msgstr "Period"
+msgstr ""
 
 #. module: account_payment_extension
 #: selection:payment.order,create_account_moves:0
 msgid "Bank Statement"
-msgstr "Bank Statement"
+msgstr ""
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: constraint:account.move.line:0
 msgid "You can not create journal items on closed account."
 msgstr "You can not create journal items on closed account."
+=======
+#: help:res.partner,payment_type_supplier:0
+msgid "Payment type of the supplier"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "Unreconciled"
+msgstr ""
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: model:ir.model,name:account_payment_extension.model_account_invoice
 msgid "Invoice"
-msgstr "Invoice"
-
-#. module: account_payment_extension
+msgstr ""
+
+#. module: account_payment_extension
+#: view:payment.order:0
+msgid "Cancel"
+msgstr ""
+
+#. module: account_payment_extension
+<<<<<<< TREE
 #: view:account.move.line.payment:0
 #: view:payment.order:0
 msgid "Cancel"
@@ -551,4 +939,25 @@
 #: field:account.move.line,received_check:0
 msgid "Received check"
 msgstr "Received check"
+=======
+#: view:account.move.line:0
+#: model:ir.model,name:account_payment_extension.model_res_partner
+msgid "Partner"
+msgstr ""
+
+#. module: account_payment_extension
+#: field:account.move.line,received_check:0
+msgid "Received check"
+msgstr ""
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "Journal"
+msgstr ""
+
+#. module: account_payment_extension
+#: model:ir.model,name:account_payment_extension.model_account_move_line
+msgid "Journal Items"
+msgstr ""
+>>>>>>> MERGE-SOURCE
 

=== modified file 'account_payment_extension/i18n/fr_BE.po' (properties changed: +x to -x)
=== modified file 'account_payment_extension/i18n/pt_BR.po'
--- account_payment_extension/i18n/pt_BR.po	2014-02-01 06:51:38 +0000
+++ account_payment_extension/i18n/pt_BR.po	2014-02-17 16:33:43 +0000
@@ -13,6 +13,7 @@
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
+<<<<<<< TREE
 "X-Launchpad-Export-Date: 2014-02-01 06:51+0000\n"
 "X-Generator: Launchpad (build 16916)\n"
 
@@ -31,13 +32,126 @@
 msgid "with this wizard ypu can change the state of the selected entries. "
 msgstr ""
 "com este assistente você pode alterar o estado das entradas selecionadas. "
+=======
+"X-Launchpad-Export-Date: 2012-12-11 05:25+0000\n"
+"X-Generator: Launchpad (build 16356)\n"
+
+#. module: account_payment_extension
+#: selection:payment.order,type:0
+msgid "Receivable"
+msgstr "Recebível"
+
+#. module: account_payment_extension
+#: model:ir.actions.act_window,name:account_payment_extension.action_payment_type
+#: model:ir.ui.menu,name:account_payment_extension.menu_action_payment_type
+#: view:payment.type:0
+#: help:payment.type,name:0
+msgid "Payment Type"
+msgstr "Tipo de Pagamento"
+
+#. module: account_payment_extension
+#: selection:payment.order,create_account_moves:0
+msgid "Direct Payment"
+msgstr "Pagamento Direto"
+
+#. module: account_payment_extension
+#: code:addons/account_payment_extension/payment.py:0
+#, python-format
+msgid ""
+"Payment order should create account moves but line with amount %.2f for "
+"partner \"%s\" has no account assigned."
+msgstr ""
+"Payment order should create account moves but line with amount %.2f for "
+"partner \"%s\" has no account assigned."
+
+#. module: account_payment_extension
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr "Nome do modelo inválido na ação definida"
+
+#. module: account_payment_extension
+#: help:payment.type,code:0
+msgid "Specify the Code for Payment Type"
+msgstr "Especifique o código para o tipo de pagamento"
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "Pay"
+msgstr "Pagar"
+
+#. module: account_payment_extension
+#: code:addons/account_payment_extension/payment.py:0
+#, python-format
+msgid ""
+"You cannot delete payment order(s) which are already confirmed or done!"
+msgstr ""
+"Você não pode excluir ordens de pagamentos que estão confirmadas ou concluídas!"
+
+#. module: account_payment_extension
+#: model:ir.model,name:account_payment_extension.model_payment_order
+msgid "Payment Order"
+msgstr "Ordem de Pagamento"
+
+#. module: account_payment_extension
+#: view:account.move.line:0
+msgid "Receive"
+msgstr "Receber"
+
+#. module: account_payment_extension
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML Inválido para Arquitetura da Visão"
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: field:payment.mode,require_bank_account:0
 msgid "Require Bank Account"
-msgstr "Require Bank Account"
-
-#. module: account_payment_extension
+msgstr "Conta Corrente Requerida"
+
+#. module: account_payment_extension
+<<<<<<< TREE
+=======
+#: model:ir.actions.wizard,name:account_payment_extension.wizard_populate_statement_ext
+msgid "Populate Statement with Payment lines"
+msgstr "Importar das Linhas de Pagamento"
+
+#. module: account_payment_extension
+#: wizard_field:populate_statement_ext,init,lines:0
+msgid "Payment Lines"
+msgstr "Linhas de Pagamento"
+
+#. module: account_payment_extension
+#: model:ir.model,name:account_payment_extension.model_payment_line
+msgid "Payment Line"
+msgstr "Linha de Pagamento"
+
+#. module: account_payment_extension
+#: constraint:ir.ui.menu:0
+msgid "Error ! You can not create recursive Menu."
+msgstr "Erro ! Você não pode criar um menu recursivo."
+
+#. module: account_payment_extension
+#: model:ir.model,name:account_payment_extension.model_payment_mode
+msgid "Payment Mode"
+msgstr "Modo de Pagamento"
+
+#. module: account_payment_extension
+#: wizard_field:populate_payment_ext,search,communication2:0
+msgid "Communication 2"
+msgstr "Comunicação 2"
+
+#. module: account_payment_extension
+#: help:payment.type,note:0
+msgid "Description of the payment type that will be shown in the invoices"
+msgstr "Description of the payment type that will be shown in the invoices"
+
+#. module: account_payment_extension
+#: field:payment.order,type:0
+msgid "Type"
+msgstr "Tipo"
+
+#. module: account_payment_extension
+>>>>>>> MERGE-SOURCE
 #: view:account.move.line:0
 msgid "Group By..."
 msgstr "Agrupado Por..."
@@ -51,7 +165,7 @@
 #: code:addons/account_payment_extension/payment.py:298
 #, python-format
 msgid "Account move line \"%s\" is not valid"
-msgstr "Account move line \"%s\" is not valid"
+msgstr "Linha de movimentação contábil \"%s\" não é válida"
 
 #. module: account_payment_extension
 #: selection:payment.line,type:0
@@ -60,12 +174,29 @@
 msgstr "Pagágel"
 
 #. module: account_payment_extension
+<<<<<<< TREE
+=======
+#: model:ir.actions.wizard,name:account_payment_extension.wizard_populate_payment_ext
+msgid "Populate payment to pay"
+msgstr "Importar Pagamentos para Pagar"
+
+#. module: account_payment_extension
+>>>>>>> MERGE-SOURCE
 #: field:res.partner,payment_type_customer:0
 msgid "Customer Payment Type"
 msgstr "Tipo de Pagamento Cliente"
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: view:payment.order.create:0
+=======
+#: help:populate_payment_ext,init,amount:0
+msgid "Next step will automatically select payments up to this amount."
+msgstr "O próximo passo vai selecionar automaticamente os pagamentos até esse valor."
+
+#. module: account_payment_extension
+#: wizard_field:populate_payment_ext,search,entries:0
+>>>>>>> MERGE-SOURCE
 msgid "Entries"
 msgstr "Lançamentos"
 
@@ -122,7 +253,7 @@
 #. module: account_payment_extension
 #: help:payment.mode,type:0
 msgid "Select the Payment Type for the Payment Mode."
-msgstr "Select the Payment Type for the Payment Mode."
+msgstr "Selecione o Tipo de Pagamento para o Modo de Pagamento."
 
 #. module: account_payment_extension
 #: sql_constraint:account.move.line:0
@@ -262,9 +393,10 @@
 #. module: account_payment_extension
 #: help:res.partner,payment_type_customer:0
 msgid "Payment type of the customer"
-msgstr "Tipo de Pagamento Cliente"
+msgstr "Tipo de Pagamento do Cliente"
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: view:account.move.line.payment:0
 msgid "Change payment entries"
 msgstr "Altere as entradas de pagamento"
@@ -389,14 +521,21 @@
 msgstr ""
 "Voce nao poderosos itens de aumento salarial em UMA Conta fazer tipo "
 "exibição."
+=======
+#: model:ir.actions.act_window,name:account_payment_extension.action_pay_payment_order_tree
+#: model:ir.ui.menu,name:account_payment_extension.menu_action_pay_payment_order_form
+msgid "Pay. payment order"
+msgstr "Ordem de Pagamento"
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: model:ir.actions.act_window,name:account_payment_extension.action_invoice_payments
 #: model:ir.ui.menu,name:account_payment_extension.menu_action_invoice_payments
 msgid "Invoice payments"
-msgstr "Fluxo de Caixa"
+msgstr "Contas a Pagar/Receber"
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: help:payment.mode,require_same_bank_account:0
 msgid ""
 "Ensure all lines in the payment order and the payment mode have the same "
@@ -404,6 +543,12 @@
 msgstr ""
 "Assegurar que todas as linhas na ordem de pagamento eo modo de pagamento têm "
 "o mesmo número de conta."
+=======
+#: model:ir.actions.act_window,name:account_payment_extension.action_done_payments
+#: model:ir.ui.menu,name:account_payment_extension.menu_action_done_payments
+msgid "Done payments"
+msgstr "Baixa de Pagar/Receber"
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: sql_constraint:account.invoice:0
@@ -432,9 +577,34 @@
 msgstr "Extrato Bancário"
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: constraint:account.move.line:0
 msgid "You can not create journal items on closed account."
 msgstr "Você. Nao poderosos itens Criação de salários por Conta datados."
+=======
+#: help:res.partner,payment_type_supplier:0
+msgid "Payment type of the supplier"
+msgstr "Tipo de Pagamento para o fornecedor"
+
+#. module: account_payment_extension
+#: constraint:ir.model:0
+msgid ""
+"The Object name must start with x_ and not contain any special character !"
+msgstr ""
+"O Nome do objeto deve começar com x_ e não deve conter caracteres especiais !"
+
+#. module: account_payment_extension
+#: model:ir.model,name:account_payment_extension.model_account_move_line
+msgid "Journal Items"
+msgstr "Itens do Diário"
+
+#. module: account_payment_extension
+#: help:account.move.line,received_check:0
+msgid ""
+"To write down that a check in paper support has been received, for example."
+msgstr ""
+"To write down that a check in paper support has been received, for example."
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: model:ir.model,name:account_payment_extension.model_account_invoice
@@ -442,6 +612,7 @@
 msgstr "Documento Fiscal"
 
 #. module: account_payment_extension
+<<<<<<< TREE
 #: view:account.move.line.payment:0
 #: view:payment.order:0
 msgid "Cancel"
@@ -601,8 +772,86 @@
 #: help:payment.order.create,show_refunds:0
 msgid "Indicates if search should include refunds."
 msgstr "Indica se a pesquisa deve incluir devoluções."
+=======
+#: view:account.move.line:0
+msgid "Narration"
+msgstr "Narrativa"
+
+#. module: account_payment_extension
+#: model:ir.model,name:account_payment_extension.model_res_partner
+msgid "Partner"
+msgstr "Parceiro"
+>>>>>>> MERGE-SOURCE
 
 #. module: account_payment_extension
 #: field:account.move.line,received_check:0
 msgid "Received check"
 msgstr "Received check"
+<<<<<<< TREE
+=======
+
+#. module: account_payment_extension
+#: wizard_view:populate_payment_ext,init:0
+msgid "Search Payment lines"
+msgstr "Pesquisar Linhas de Pagamento"
+
+#. module: account_payment_extension
+#: sql_constraint:ir.model.fields:0
+msgid "Size of the field can never be less than 1 !"
+msgstr "O Tamanho do campo numca deve ser menor do que 1!"
+
+#. module: account_payment_extension
+#: help:payment.order,create_account_moves:0
+msgid ""
+"Indicates when account moves should be created for order payment lines. "
+"\"Bank Statement\" will wait until user introduces those payments in bank a "
+"bank statement. \"Direct Payment\" will mark all payment lines as payied "
+"once the order is done."
+msgstr ""
+"Indicates when account moves should be created for order payment lines. "
+"\"Bank Statement\" will wait until user introduces those payments in bank a "
+"bank statement. \"Direct Payment\" will mark all payment lines as payied "
+"once the order is done."
+
+#. module: account_payment_extension
+#: model:ir.module.module,description:account_payment_extension.module_meta_information
+msgid ""
+"Account payment extension.\n"
+"\n"
+"This module extends the account_payment module with a lot of features:\n"
+"    * Extension of payment types: The payment type has a translated name and "
+"note that can be shown in the invoices.\n"
+"    * Two default payment types for partners (client and supplier).\n"
+"    * Automatic selection of payment type in invoices. Now an invoice can "
+"have a payment term (30 days, 30/60 days, ...) and a payment type (cash, "
+"bank transfer, ...).\n"
+"    * A default check field in partner bank accounts. The default partner "
+"bank accounts are selected in invoices and payments.\n"
+"    * New menu/tree/forms to see payments to receive and payments to pay.\n"
+"    * The payments show tree editable fields: Due date, bank account and a "
+"check field (for example to write down if a bank check in paper support has "
+"been received).\n"
+"    * Two types of payment orders: Payable payment orders (from supplier "
+"invoices) and receivable payment orders (from client invoices). So we can "
+"make payment orders to receive the payments of our client invoices. Each "
+"payment order type has its own sequence.\n"
+"    * The payment orders allow negative payment amounts. So we can have "
+"payment orders for supplier invoices (pay money) and refund supplier "
+"invoices (return or receive money). Or for client invoices (receive money) "
+"and refund client invoices (return or pay money).\n"
+"    * Payment orders: Selected invoices are filtered by payment type, the "
+"second message communication can be set at the same time for several "
+"invoices.\n"
+"Based on previous work of Pablo Rocandio & Zikzakmedia (version for 4.2).\n"
+msgstr ""
+
+#. module: account_payment_extension
+#: wizard_field:populate_payment_ext,init,show_refunds:0
+msgid "Show Refunds"
+msgstr "Mostrar Devoluções"
+
+#. module: account_payment_extension
+#: help:populate_payment_ext,init,show_refunds:0
+msgid "Indicates if search should include refunds."
+msgstr "Indica se a pesquisa deve incluir devoluções."
+>>>>>>> MERGE-SOURCE

=== added file 'account_payment_extension/res_partner.py'
--- account_payment_extension/res_partner.py	1970-01-01 00:00:00 +0000
+++ account_payment_extension/res_partner.py	2014-02-17 16:33:43 +0000
@@ -0,0 +1,83 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com)
+#                    All Rights Reserved.Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
+# AvanzOSC, Avanzed Open Source Consulting
+# Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
+# Copyright (C) 2013 Akretion Ltda ME (www.akretion.com) All Rights Reserved
+# Renato Lima <renato.lima@xxxxxxxxxxxxxxx>
+# $Id$
+#
+# 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 orm, fields
+
+
+class res_partner(orm.Model):
+    _inherit = 'res.partner'
+    _columns = {
+        'payment_type_customer': fields.property(
+            'payment.type', type='many2one', relation='payment.type',
+            string='Customer Payment Type', method=True, view_load=True,
+            help="Payment type of the customer"),
+        'payment_type_supplier': fields.property(
+            'payment.type', type='many2one', relation='payment.type',
+            string='Supplier Payment Type', method=True, view_load=True,
+            help="Payment type of the supplier"),
+    }
+
+
+class res_partner_bank(orm.Model):
+    _inherit = 'res.partner.bank'
+
+    def create(self, cr, uid, vals, context=None):
+        if vals.get('default_bank') and vals.get('partner_id') and \
+        vals.get('state'):
+            sql = """UPDATE res_partner_bank SET
+                    default_bank = '0'
+                WHERE
+                    partner_id = %i
+                    AND default_bank = true
+                    AND state='%s'""" % (vals['partner_id'], vals['state'])
+            cr.execute(sql)
+        return super(res_partner_bank, self).create(
+            cr, uid, vals, context=context)
+
+    def write(self, cr, uid, ids, vals, context=None):
+        if 'default_bank' in vals and vals['default_bank']:
+            partner_bank = self.pool.get('res.partner.bank').browse(
+                cr, uid, ids)[0]
+            partner_id = partner_bank.partner_id.id
+            if 'state' in vals and vals['state']:
+                state = vals['state']
+            else:
+                state = partner_bank.state
+            sql = """UPDATE res_partner_bank SET
+                        default_bank='0'
+                    WHERE
+                        partner_id = %i
+                        AND default_bank = true
+                        AND state = '%s'
+                        AND id <> %i""" % (partner_id, state, ids[0])
+            cr.execute(sql)
+        return super(res_partner_bank, self).write(
+            cr, uid, ids, vals, context=context)
+
+    _columns = {
+        'default_bank': fields.boolean('Default'),
+    }
\ No newline at end of file

=== added file 'account_payment_extension/res_partner_view.xml'
--- account_payment_extension/res_partner_view.xml	1970-01-01 00:00:00 +0000
+++ account_payment_extension/res_partner_view.xml	2014-02-17 16:33:43 +0000
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+            <!--
+        ========================================================================================================
+            PARTNERS - default bank
+        ========================================================================================================
+        -->
+        <record model="ir.ui.view" id="view_partner_form">
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="account.view_partner_property_form"/>
+            <field name="arch" type="xml">
+                <field name="acc_number" position="after">
+                      <field name="default_bank"/>
+                </field>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="view_partner_form2">
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="account.view_partner_property_form"/>
+            <field name="arch" type="xml">
+                <tree string="Bank Details" position="inside">
+                    <field name="default_bank"/>
+                </tree>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="view_partner_form3">
+            <field name="name">view.partner.form3</field>
+            <field name="model">res.partner.bank</field>
+            <field name="inherit_id" ref="base.view_partner_bank_form"/>
+            <field name="arch" type="xml">
+                <field name="acc_number" position="after">
+                    <field name="default_bank"/>
+                </field>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="view_partner_bank_tree">
+            <field name="name">view.partner.bank.tree </field>
+            <field name="model">res.partner.bank</field>
+            <field name="inherit_id" ref="base.view_partner_bank_tree"/>
+            <field name="arch" type="xml">
+                <field name="partner_id" position="before">
+                    <field name="default_bank"/>
+                </field>
+            </field>
+        </record>
+
+
+        <!--
+        ====================================================================================================
+            PARTNERS - payment type
+        ====================================================================================================
+        -->
+        <record model="ir.ui.view" id="view_payment_type_res_partner_form1">
+            <field name="name">res.partner.form.payment_type1</field>
+            <field name="model">res.partner</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="account.view_partner_property_form"/>
+            <field name="priority" eval="20"/>
+            <field name="arch" type="xml">
+                <field name="property_account_receivable" position="after">
+                    <field name="payment_type_customer" widget="selection"/>
+                </field>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="view_payment_type_res_partner_form2">
+            <field name="name">res.partner.form.payment_type2</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="account.view_partner_property_form"/>
+            <field name="priority" eval="20"/>
+            <field name="arch" type="xml">
+                <field name="property_account_payable" position="after">
+                    <field name="payment_type_supplier" widget="selection"/>
+                </field>
+            </field>
+        </record>
+
+    </data>
+</openerp>
\ No newline at end of file

=== added directory 'account_payment_extension/test'
=== added file 'account_payment_extension/test/__init__.py'
--- account_payment_extension/test/__init__.py	1970-01-01 00:00:00 +0000
+++ account_payment_extension/test/__init__.py	2014-02-17 16:33:43 +0000
@@ -0,0 +1,26 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com)
+#                    All Rights Reserved.Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
+# AvanzOSC, Avanzed Open Source Consulting
+# Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
+# Copyright (C) 2013 Akretion Ltda ME (www.akretion.com) All Rights Reserved
+# Renato Lima <renato.lima@xxxxxxxxxxxxxxx>
+# $Id$
+#
+# 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/>.
+#
+##############################################################################

=== modified file 'account_payment_extension/wizard/__init__.py'
--- account_payment_extension/wizard/__init__.py	2013-03-11 09:20:35 +0000
+++ account_payment_extension/wizard/__init__.py	2014-02-17 16:33:43 +0000
@@ -24,7 +24,10 @@
 ##############################################################################
 
 import account_payment_order
+<<<<<<< TREE
 import account_move_line_payment
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 
+=======
+>>>>>>> MERGE-SOURCE

=== modified file 'account_payment_extension/wizard/account_payment_order.py'
--- account_payment_extension/wizard/account_payment_order.py	2013-09-12 11:23:15 +0000
+++ account_payment_extension/wizard/account_payment_order.py	2014-02-17 16:33:43 +0000
@@ -91,12 +91,24 @@
         elif not show_refunds:
             domain += [('debit', '>', 0)]
         if payment.mode:
+<<<<<<< TREE
             domain += [('payment_type', '=', payment.mode.type.id)]
         domain += ['|',('date_maturity','<',search_due_date),('date_maturity','=',False)]
+=======
+            domain += [ ('payment_type','=',payment.mode.type.id) ]
+
+        domain += ['|',('date_maturity','<=',search_due_date),('date_maturity','=',False)]
+>>>>>>> MERGE-SOURCE
         line_ids = line_obj.search(cr, uid, domain, order='date_maturity', context=context)
         selected_ids = []
+<<<<<<< TREE
         if amount > 0.0:
             # If user specified an amount, search what moves match the criteria
+=======
+        if amount > 0.0:
+            # If user specified an amount, search what moves match the criteria taking into account
+            # if payment mode allows bank account to be null.
+>>>>>>> MERGE-SOURCE
             for line in pool.get('account.move.line').browse(cr, uid, line_ids, context):
                 if abs(line.amount_to_pay) <= amount:
                     amount -= abs(line.amount_to_pay)

=== modified file 'account_payment_extension/wizard/account_payment_order_view.xml'
--- account_payment_extension/wizard/account_payment_order_view.xml	2012-11-25 07:59:40 +0000
+++ account_payment_extension/wizard/account_payment_order_view.xml	2014-02-17 16:33:43 +0000
@@ -1,13 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <openerp>
     <data>
-    
+
 
 
         <record id="view_create_payment_extension_order" model="ir.ui.view">
             <field name="name">payment.extension.order.create.form</field>
             <field name="model">payment.order.create</field>
-            <field name="type">form</field>
             <field name="inherit_id" ref="account_payment.view_create_payment_order"/>
             <field name="arch" type="xml">
                 <field name="duedate" position="after">
@@ -16,11 +15,11 @@
                 </field>
             </field>
         </record>
-     <!-- FORM LIST-->
+
+        <!-- FORM LIST-->
         <record id="view_create_payment_extension_order_lines" model="ir.ui.view">
             <field name="name">payment.extension.order.create.form</field>
             <field name="model">payment.order.create</field>
-            <field name="type">form</field>
             <field name="inherit_id" ref="account_payment.view_create_payment_order_lines"/>
             <field name="arch" type="xml">
 				<xpath expr="//field[@name='entries']/.." position="replace">
@@ -34,7 +33,6 @@
             </field>
         </record>
 
-    
      <!-- ACCION -->
         <record id="action_create_payment_extension_order" model="ir.actions.act_window">
             <field name="name">Seleccionar facturas a Pagar/Cobrar</field>
@@ -44,8 +42,8 @@
             <field name="view_mode">form</field>
             <field name="view_id" ref="view_create_payment_extension_order"/>
             <field name="target">new</field>
+            <field name="context">{'record_id': active_id}</field>
         </record>
-        
-    
+
     </data>
 </openerp>

=== 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:33:43 +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:33:43 +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:33:43 +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:33:43 +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:33:43 +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:33:43 +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:33:43 +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>

=== added directory 'account_voucher_cash_basis'
=== added file 'account_voucher_cash_basis/AUTHORS.txt'
--- account_voucher_cash_basis/AUTHORS.txt	1970-01-01 00:00:00 +0000
+++ account_voucher_cash_basis/AUTHORS.txt	2014-02-17 16:33:43 +0000
@@ -0,0 +1,1 @@
+Lorenzo Battistini <lorenzo.battistini@xxxxxxxxxxx>

=== added file 'account_voucher_cash_basis/__init__.py'
--- account_voucher_cash_basis/__init__.py	1970-01-01 00:00:00 +0000
+++ account_voucher_cash_basis/__init__.py	2014-02-17 16:33:43 +0000
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2012 Domsense s.r.l. (<http://www.domsense.com>).
+#    Copyright (C) 2012-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_voucher
+import company

=== added file 'account_voucher_cash_basis/__openerp__.py'
--- account_voucher_cash_basis/__openerp__.py	1970-01-01 00:00:00 +0000
+++ account_voucher_cash_basis/__openerp__.py	2014-02-17 16:33:43 +0000
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>).
+#    Copyright (C) 2012-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/>.
+#
+##############################################################################
+
+
+{
+    "name": "Cash basis extensions for vouchers",
+    "version": "1.0",
+    'category': 'Hidden/Dependency',
+    "depends": ["account_voucher"],
+    "author": "Agile Business Group",
+    "description": """
+In some countries, under certain conditions, companies can apply the cash basis.
+The cash basis means businesses may account for VAT as payment comes in from
+their customers.
+It is easier to manage than the normal method, which forces businesses to
+account for VAT based on invoices issued, regardless of whether or not the money has come in.
+The key advantage to accounting for VAT on a cash basis is the cashflow benefit
+to your business.
+The effect of the cash basis is that you only become liable for VAT when you
+have actually received payment, so you don't have to fund the VAT on your debtors.
+This is particularly helpful in a startup situation and in the case of an
+expanding business.
+
+This module gathers all the basic functionalities that allow to handle the
+cash basis.
+    """,
+    'website': 'http://www.agilebg.com',
+    'init_xml': [],
+    'data': [
+        'company_view.xml',
+        ],
+    'demo': [],
+    'installable': True,
+    'active': False,
+}

=== added file 'account_voucher_cash_basis/account_voucher.py'
--- account_voucher_cash_basis/account_voucher.py	1970-01-01 00:00:00 +0000
+++ account_voucher_cash_basis/account_voucher.py	2014-02-17 16:33:43 +0000
@@ -0,0 +1,167 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2012 Domsense s.r.l. (<http://www.domsense.com>).
+#    Copyright (C) 2012-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 _
+import openerp.addons.decimal_precision as dp
+
+class account_voucher(orm.Model):
+    _inherit = "account.voucher"
+    
+    _columns = {
+        'line_total': fields.float('Lines Total', digits_compute=dp.get_precision('Account'), readonly=True),
+        }
+    
+    def balance_move(self, cr, uid, move_id, context=None):
+        currency_obj = self.pool.get('res.currency')
+        move = self.pool.get('account.move').browse(cr, uid, move_id, context)
+        amount = 0.0
+        for line in move.line_id:
+            amount += line.debit - line.credit
+        amount = currency_obj.round(cr, uid, move.company_id.currency_id, amount)
+        # check if balance differs for more than 1 decimal according to account decimal precision
+        if  abs(amount * 10 ** dp.get_precision('Account')(cr)[1]) > 1:
+            raise orm.except_orm(_('Error'), _('The generated payment entry is unbalanced for more than 1 decimal'))
+        if not currency_obj.is_zero(cr, uid, move.company_id.currency_id, amount):
+            for line in move.line_id:
+                # adjust the first move line that's not receivable, payable or liquidity
+                if line.account_id.type != 'receivable' and line.account_id.type != 'payable' and line.account_id.type != 'liquidity':
+                    if line.credit:
+                        line.write({
+                            'credit': line.credit + amount,
+                            }, update_check=False)
+                    elif line.debit:
+                        line.write({
+                            'debit': line.debit - amount,
+                            }, update_check=False)
+                    if line.tax_amount:
+                        line.write({
+                            'tax_amount': line.tax_amount + amount,
+                            }, update_check=False)
+                    break
+        return amount
+        
+    def voucher_move_line_create(self, cr, uid, voucher_id, line_total,
+        move_id, company_currency, current_currency, context=None):
+        res = super(account_voucher,self).voucher_move_line_create(cr, uid, voucher_id, line_total, move_id, company_currency, current_currency, context)
+        self.write(cr, uid, voucher_id, {'line_total': res[0]}, context)
+        return res
+        
+    def get_invoice_total(self, invoice):
+        res = 0.0
+        for inv_move_line in invoice.move_id.line_id:
+            if inv_move_line.account_id.type in ('receivable','payable'):
+                res += inv_move_line.debit or inv_move_line.credit # can both be presents?
+        return res
+        
+    def get_invoice_total_currency(self, invoice):
+        res = 0.0
+        for inv_move_line in invoice.move_id.line_id:
+            if inv_move_line.account_id.type in ('receivable','payable'):
+                res += abs(inv_move_line.amount_currency)
+        return res
+        
+    def allocated_amounts_grouped_by_invoice(self, cr, uid, voucher, context=None):
+        '''
+        
+        this method builds a dictionary in the following form
+        
+        {
+            first_invoice_id: {
+                'allocated': 120.0,
+                'total': 120.0,
+                'total_currency': 0.0,
+                'write-off': 20.0,
+                'allocated_currency': 0.0,
+                'foreign_currency_id': False, # int
+                'currency-write-off': 0.0,
+                }
+            second_invoice_id: {
+                'allocated': 50.0,
+                'total': 100.0,
+                'total_currency': 0.0,
+                'write-off': 0.0,
+                'allocated_currency': 0.0,
+                'foreign_currency_id': False,
+                'currency-write-off': 0.0,
+                }
+        }
+        
+        every amout is expressed in company currency.
+        
+        In order to compute cashed amount correctly, write-off will be subtract to reconciled amount.
+        If more than one invoice is paid with this voucher, we distribute write-off equally (if allowed)
+        
+        '''
+        res={}
+        company_currency = super(account_voucher,self)._get_company_currency(
+            cr, uid, voucher.id, context)
+        current_currency = super(account_voucher,self)._get_current_currency(
+            cr, uid, voucher.id, context)
+        for line in voucher.line_ids:
+            if line.amount and line.move_line_id and line.move_line_id.invoice:
+                if not line.move_line_id.invoice.id in res:
+                    res[line.move_line_id.invoice.id] = {
+                        'allocated': 0.0,
+                        'total': 0.0,
+                        'total_currency': 0.0,
+                        'write-off': 0.0,
+                        'allocated_currency': 0.0,
+                        'foreign_currency_id': False,
+                        'currency-write-off': 0.0,
+                        }
+                current_amount = line.amount
+                if company_currency != current_currency:
+                    current_amount = super(account_voucher,self)._convert_amount(
+                        cr, uid, line.amount, voucher.id, context)
+                    res[line.move_line_id.invoice.id][
+                        'allocated_currency'
+                        ] += line.amount
+                    res[line.move_line_id.invoice.id][
+                        'foreign_currency_id'
+                        ] = current_currency
+                    res[line.move_line_id.invoice.id][
+                        'total_currency'
+                        ] = self.get_invoice_total_currency(line.move_line_id.invoice)
+                res[line.move_line_id.invoice.id][
+                    'allocated'
+                    ] += current_amount
+                res[line.move_line_id.invoice.id][
+                    'total'
+                    ] = self.get_invoice_total(line.move_line_id.invoice)
+        if res:
+            write_off_per_invoice = voucher.line_total / len(res)
+            if not voucher.company_id.allow_distributing_write_off and  len(res) > 1 and write_off_per_invoice:
+                raise orm.except_orm(_('Error'), _(
+                    'You are trying to pay with write-off more than one invoice and distributing write-off is not allowed. See company settings.'))
+            if voucher.type == 'payment' or voucher.type == 'purchase':
+                write_off_per_invoice = - write_off_per_invoice
+            for inv_id in res:
+                res[inv_id]['write-off'] = write_off_per_invoice
+            if company_currency != current_currency:
+                curr_write_off_per_invoice = voucher.writeoff_amount / len(res)
+                if voucher.type == 'payment' or voucher.type == 'purchase':
+                    curr_write_off_per_invoice = - curr_write_off_per_invoice
+                for inv_id in res:
+                    res[inv_id]['currency-write-off'] = curr_write_off_per_invoice
+        return res

=== added file 'account_voucher_cash_basis/company.py'
--- account_voucher_cash_basis/company.py	1970-01-01 00:00:00 +0000
+++ account_voucher_cash_basis/company.py	2014-02-17 16:33:43 +0000
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>).
+#    Copyright (C) 2012-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 res_company(orm.Model):
+    _inherit = "res.company"
+    _columns = {
+        'vat_on_payment': fields.boolean('VAT on payment treatment'),
+        'allow_distributing_write_off': fields.boolean('Allow distributing write-off', help="If not set, paying several 'cash basis' invoices with same voucher with write-off won't be allowed. If set, write-off will be distributed equally over invoices"),
+        }
+    
+class account_config_settings(orm.TransientModel):
+    _inherit = 'account.config.settings'
+    _columns = {
+        'vat_on_payment': fields.related(
+            'company_id', 'vat_on_payment',
+            type='boolean',
+            string="VAT on payment treatment"),
+        'allow_distributing_write_off': fields.related(
+            'company_id', 'allow_distributing_write_off',
+            type="boolean",
+            string="Allow distributing write-off",
+            help="If not set, paying several 'cash basis' invoices with same voucher with write-off won't be allowed. If set, write-off will be distributed equally over invoices"),
+    }
+    
+    def onchange_company_id(self, cr, uid, ids, company_id, context=None):
+        res = super(account_config_settings, self).onchange_company_id(cr, uid, ids, company_id, context=context)
+        if company_id:
+            company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
+            res['value'].update({
+                'vat_on_payment': company.vat_on_payment, 
+                'allow_distributing_write_off': company.allow_distributing_write_off,
+                })
+        else: 
+            res['value'].update({
+                'vat_on_payment': False, 
+                'allow_distributing_write_off': False,
+                })
+        return res

=== added file 'account_voucher_cash_basis/company_view.xml'
--- account_voucher_cash_basis/company_view.xml	1970-01-01 00:00:00 +0000
+++ account_voucher_cash_basis/company_view.xml	2014-02-17 16:33:43 +0000
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_account_config_settings" model="ir.ui.view">
+            <field name="name">view_account_config_settings</field>
+            <field name="model">account.config.settings</field>
+            <field name="inherit_id" ref="account.view_account_config_settings"/>
+            <field name="arch" type="xml">
+                <xpath expr="/form/group[5]/div" position="inside">
+                    <div>
+                        <field name="allow_distributing_write_off" class="oe_inline"/>
+                        <label for="allow_distributing_write_off"/>
+                    </div>
+                </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>

=== added directory 'account_voucher_cash_basis/i18n'
=== added file 'account_voucher_cash_basis/i18n/account_voucher_cash_basis.pot'
--- account_voucher_cash_basis/i18n/account_voucher_cash_basis.pot	1970-01-01 00:00:00 +0000
+++ account_voucher_cash_basis/i18n/account_voucher_cash_basis.pot	2014-02-17 16:33:43 +0000
@@ -0,0 +1,74 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* account_voucher_cash_basis
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-21 09:21+0000\n"
+"PO-Revision-Date: 2013-10-21 09:21+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_voucher_cash_basis
+#: field:account.voucher,line_total:0
+msgid "Lines Total"
+msgstr ""
+
+#. module: account_voucher_cash_basis
+#: help:account.config.settings,allow_distributing_write_off:0
+#: help:res.company,allow_distributing_write_off:0
+msgid "If not set, paying several 'cash basis' invoices with same voucher with write-off won't be allowed. If set, write-off will be distributed equally over invoices"
+msgstr ""
+
+#. module: account_voucher_cash_basis
+#: model:ir.model,name:account_voucher_cash_basis.model_account_config_settings
+msgid "account.config.settings"
+msgstr ""
+
+#. module: account_voucher_cash_basis
+#: code:addons/account_voucher_cash_basis/account_voucher.py:44
+#, python-format
+msgid "The generated payment entry is unbalanced for more than 1 decimal"
+msgstr ""
+
+#. module: account_voucher_cash_basis
+#: model:ir.model,name:account_voucher_cash_basis.model_account_voucher
+msgid "Accounting Voucher"
+msgstr ""
+
+#. module: account_voucher_cash_basis
+#: model:ir.model,name:account_voucher_cash_basis.model_res_company
+msgid "Companies"
+msgstr ""
+
+#. module: account_voucher_cash_basis
+#: field:account.config.settings,allow_distributing_write_off:0
+#: field:res.company,allow_distributing_write_off:0
+msgid "Allow distributing write-off"
+msgstr ""
+
+#. module: account_voucher_cash_basis
+#: code:addons/account_voucher_cash_basis/account_voucher.py:155
+#, python-format
+msgid "You are trying to pay with write-off more than one invoice and distributing write-off is not allowed. See company settings."
+msgstr ""
+
+#. module: account_voucher_cash_basis
+#: code:addons/account_voucher_cash_basis/account_voucher.py:44
+#: code:addons/account_voucher_cash_basis/account_voucher.py:155
+#, python-format
+msgid "Error"
+msgstr ""
+
+#. module: account_voucher_cash_basis
+#: field:account.config.settings,vat_on_payment:0
+#: field:res.company,vat_on_payment:0
+msgid "VAT on payment treatment"
+msgstr ""
+

=== added directory 'account_voucher_display_writeoff/i18n'
=== added file 'account_voucher_display_writeoff/i18n/account_voucher_display_writeoff.pot'
--- account_voucher_display_writeoff/i18n/account_voucher_display_writeoff.pot	1970-01-01 00:00:00 +0000
+++ account_voucher_display_writeoff/i18n/account_voucher_display_writeoff.pot	2014-02-17 16:33:43 +0000
@@ -0,0 +1,27 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* account_voucher_display_writeoff
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-21 09:21+0000\n"
+"PO-Revision-Date: 2013-10-21 09:21+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_voucher_display_writeoff
+#: view:account.voucher:0
+msgid "Write-Off"
+msgstr ""
+
+#. module: account_voucher_display_writeoff
+#: model:ir.model,name:account_voucher_display_writeoff.model_account_voucher
+msgid "Accounting Voucher"
+msgstr ""
+

=== added directory 'account_voucher_supplier_invoice_number'
=== added file 'account_voucher_supplier_invoice_number/AUTHORS.txt'
--- account_voucher_supplier_invoice_number/AUTHORS.txt	1970-01-01 00:00:00 +0000
+++ account_voucher_supplier_invoice_number/AUTHORS.txt	2014-02-17 16:33:43 +0000
@@ -0,0 +1,1 @@
+Lorenzo Battistini <lorenzo.battistini@xxxxxxxxxxx>

=== added file 'account_voucher_supplier_invoice_number/__init__.py'
--- account_voucher_supplier_invoice_number/__init__.py	1970-01-01 00:00:00 +0000
+++ account_voucher_supplier_invoice_number/__init__.py	2014-02-17 16:33:43 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#    
+#    Copyright (C) 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 voucher

=== added file 'account_voucher_supplier_invoice_number/__openerp__.py'
--- account_voucher_supplier_invoice_number/__openerp__.py	1970-01-01 00:00:00 +0000
+++ account_voucher_supplier_invoice_number/__openerp__.py	2014-02-17 16:33:43 +0000
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#    
+#    Copyright (C) 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/>.
+#
+##############################################################################
+
+{
+    'name': "Supplier invoice number in payment vouchers",
+    'version': '0.1',
+    'category': 'Accounting & Finance',
+    'description': """
+This module adds the supplier invoice number to (Supplier Payment) voucher lines. So that it's more easy to find the right invoice we are going to pay.
+""",
+    'author': 'Agile Business Group',
+    'website': 'http://www.agilebg.com',
+    'license': 'AGPL-3',
+    "depends" : ['account_voucher'],
+    "data" : [
+        'voucher_view.xml',
+        ],
+    'test' : [
+        'test/purchase_payment.yml',
+    ],
+    "demo" : [],
+    "active": False,
+    "installable": True
+}

=== added directory 'account_voucher_supplier_invoice_number/i18n'
=== added file 'account_voucher_supplier_invoice_number/i18n/account_voucher_supplier_invoice_number.pot'
--- account_voucher_supplier_invoice_number/i18n/account_voucher_supplier_invoice_number.pot	1970-01-01 00:00:00 +0000
+++ account_voucher_supplier_invoice_number/i18n/account_voucher_supplier_invoice_number.pot	2014-02-17 16:33:43 +0000
@@ -0,0 +1,32 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* account_voucher_supplier_invoice_number
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-21 09:22+0000\n"
+"PO-Revision-Date: 2013-10-21 09:22+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_voucher_supplier_invoice_number
+#: model:ir.model,name:account_voucher_supplier_invoice_number.model_account_voucher
+msgid "Accounting Voucher"
+msgstr ""
+
+#. module: account_voucher_supplier_invoice_number
+#: field:account.voucher.line,supplier_invoice_number:0
+msgid "Supplier Invoice Number"
+msgstr ""
+
+#. module: account_voucher_supplier_invoice_number
+#: model:ir.model,name:account_voucher_supplier_invoice_number.model_account_voucher_line
+msgid "Voucher Lines"
+msgstr ""
+

=== added directory 'account_voucher_supplier_invoice_number/test'
=== added file 'account_voucher_supplier_invoice_number/test/purchase_payment.yml'
--- account_voucher_supplier_invoice_number/test/purchase_payment.yml	1970-01-01 00:00:00 +0000
+++ account_voucher_supplier_invoice_number/test/purchase_payment.yml	2014-02-17 16:33:43 +0000
@@ -0,0 +1,63 @@
+-
+  Create an invoice for the partner Seagate with amount 450.0
+-
+  !python {model: account.invoice}: |
+    context.update({'type': 'in_invoice'})
+-
+  !record {model: account.invoice, id: account_invoice_0}:
+    account_id: account.a_pay
+    company_id: base.main_company
+    currency_id: base.EUR
+    supplier_invoice_number: '2013/003864'
+    invoice_line:
+      - account_id: account.a_expense
+        name: '[PCSC234] PC Assemble SC234'
+        price_unit: 450.0
+        quantity: 1.0
+        product_id: product.product_product_3
+        uos_id: product.product_uom_unit
+    journal_id: account.expenses_journal
+    partner_id: base.res_partner_19
+
+-
+  I check that the invoice is in draft state
+-
+  !assert {model: account.invoice, id: account_invoice_0}:
+    - state == 'draft'
+
+-
+  I make the invoice in Open state
+-
+  !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_0}
+
+-
+  I will create and post an account voucher of amount 450.0 for the partner Seagate.
+-
+  !python {model: account.voucher}: |
+    import netsvc
+    vals = {}
+    res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_19"), ref('account.bank_journal'), 0.0, 1, ttype='payment', date=False)
+    vals = {
+        'account_id': ref('account.cash'),
+        'amount': 450.0,
+        'company_id': ref('base.main_company'),
+        'journal_id': ref('account.bank_journal'),
+        'partner_id': ref('base.res_partner_19'),
+        'period_id': ref('account.period_8'),
+        'type': 'payment',
+    }
+    if not res['value']['line_dr_ids']:
+      res['value']['line_dr_ids'] = [{'type': 'dr', 'account_id': ref('account.a_pay'),}]
+    res['value']['line_dr_ids'][0]['amount'] = 450.0
+    vals['line_dr_ids'] = [(0,0,i) for i in res['value']['line_dr_ids']]
+    id = self.create(cr, uid, vals)
+    voucher = self.browse(cr, uid, id)
+    assert (voucher.state=='draft'), "Voucher is not in draft state"
+    wf_service = netsvc.LocalService("workflow")
+    wf_service.trg_validate(uid, 'account.voucher', voucher.id, 'proforma_voucher', cr)
+    assert (voucher.line_ids[0].supplier_invoice_number == '2013/003864'), 'wrong supplier_invoice_number'
+-
+  Finally i will Confirm the state of the invoice is paid
+-
+  !assert {model: account.invoice, id: account_invoice_0}:
+    - state == 'paid'

=== added file 'account_voucher_supplier_invoice_number/voucher.py'
--- account_voucher_supplier_invoice_number/voucher.py	1970-01-01 00:00:00 +0000
+++ account_voucher_supplier_invoice_number/voucher.py	2014-02-17 16:33:43 +0000
@@ -0,0 +1,65 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#    
+#    Copyright (C) 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 tools.translate import _
+
+class voucher_line(orm.Model):
+    _inherit = 'account.voucher.line'
+    
+    def get_suppl_inv_num(self, cr, uid, move_line_id, context=None):
+        move_line = self.pool.get('account.move.line').browse(cr, uid, move_line_id, context)
+        return (move_line.invoice and move_line.invoice.supplier_invoice_number or '')
+    
+    def _get_supplier_invoice_number(self, cr, uid, ids, name, args, context=None):
+        res={}
+        for line in self.browse(cr, uid, ids, context):
+            res[line.id] = ''
+            if line.move_line_id:
+                res[line.id] = self.get_suppl_inv_num(cr, uid,
+                    line.move_line_id.id, context=context)
+        return res
+    
+    _columns = {
+        'supplier_invoice_number': fields.function(_get_supplier_invoice_number,
+            type='char', size=64, string="Supplier Invoice Number"),
+        }
+
+class voucher(orm.Model):
+    _inherit = 'account.voucher'
+    
+    def recompute_voucher_lines(self, cr, uid, ids, partner_id, journal_id, price,
+        currency_id, ttype, date, context=None):
+        res = super(voucher,self).recompute_voucher_lines(cr, uid, ids, partner_id,
+            journal_id, price,
+            currency_id, ttype, date, context=context)
+        line_obj = self.pool.get('account.voucher.line')
+        if res.get('value') and res['value'].get('line_cr_ids'):
+            for vals in res['value']['line_cr_ids']:
+                if vals.get('move_line_id'):
+                    vals['supplier_invoice_number'] = line_obj.get_suppl_inv_num(
+                        cr, uid, vals['move_line_id'], context=context)
+        if res.get('value') and res['value'].get('line_dr_ids'):
+            for vals in res['value']['line_dr_ids']:
+                if vals.get('move_line_id'):
+                    vals['supplier_invoice_number'] = line_obj.get_suppl_inv_num(
+                        cr, uid, vals['move_line_id'], context=context)
+        return res

=== added file 'account_voucher_supplier_invoice_number/voucher_view.xml'
--- account_voucher_supplier_invoice_number/voucher_view.xml	1970-01-01 00:00:00 +0000
+++ account_voucher_supplier_invoice_number/voucher_view.xml	2014-02-17 16:33:43 +0000
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+        <!-- Supplier Payment -->
+        <record model="ir.ui.view" id="view_vendor_payment_form">
+            <field name="name">account.voucher.payment.form</field>
+            <field name="model">account.voucher</field>
+            <field name="inherit_id" ref="account_voucher.view_vendor_payment_form"></field>
+            <field name="arch" type="xml">
+                <xpath expr="/form/sheet/notebook/page/field[@name='line_dr_ids']/tree/field[@name='move_line_id']" position="after">
+                    <field name="supplier_invoice_number" />
+                </xpath>
+                <xpath expr="/form/sheet/notebook/page/field[@name='line_cr_ids']/tree/field[@name='move_line_id']" position="after">
+                    <field name="supplier_invoice_number" />
+                </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>

=== added directory 'account_voucher_tax_filter/i18n'
=== added file 'account_voucher_tax_filter/i18n/account_voucher_tax_filter.pot'
--- account_voucher_tax_filter/i18n/account_voucher_tax_filter.pot	1970-01-01 00:00:00 +0000
+++ account_voucher_tax_filter/i18n/account_voucher_tax_filter.pot	2014-02-17 16:33:43 +0000
@@ -0,0 +1,50 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* account_voucher_tax_filter
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-21 09:22+0000\n"
+"PO-Revision-Date: 2013-10-21 09:22+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_voucher_tax_filter
+#: view:account.voucher:0
+msgid "[\n"
+"                    ('company_id', '=', company_id), ('parent_id', '=', False),\n"
+"                    ('type_tax_use', 'in', ['purchase', 'all'])\n"
+"                    ]"
+msgstr ""
+
+#. module: account_voucher_tax_filter
+#: view:account.voucher:0
+msgid "[\n"
+"                    ('company_id', '=', company_id), ('parent_id', '=', False),\n"
+"                    ('type_tax_use', 'in', ['sale', 'all'])\n"
+"                    ]"
+msgstr ""
+
+#. module: account_voucher_tax_filter
+#: view:account.voucher:0
+msgid "(\n"
+"                        [('company_id', '=', company_id), ('parent_id', '=', False)] +\n"
+"                        (\n"
+"                           type == 'sale' and [('type_tax_use', 'in', ['sale', 'all'])]\n"
+"                           or type == 'purchase' and [('type_tax_use', 'in', ['purchase', 'all'])]\n"
+"                           or []\n"
+"                        )\n"
+"                    )"
+msgstr ""
+
+#. module: account_voucher_tax_filter
+#: view:account.voucher:0
+msgid "many2one"
+msgstr ""
+

=== modified file 'nan_account_bank_statement/account_statement_view.xml'
--- nan_account_bank_statement/account_statement_view.xml	2012-01-20 10:41:21 +0000
+++ nan_account_bank_statement/account_statement_view.xml	2014-02-17 16:33:43 +0000
@@ -31,7 +31,7 @@
 		<field name="type">form</field>
 		<field name="inherit_id" ref="account.view_bank_statement_form"/>
 		<field name="arch" type="xml">
-			<xpath expr="/form/notebook/page[@name='statement_line_ids']/field[@name='line_ids']/form/field[@name='sequence']" position="after">
+			<xpath expr="/form/sheet/notebook/page[@name='statement_line_ids']/field[@name='line_ids']/form/group/field[@name='sequence']" position="after">
 				<field name="search_by"/>
 				<group colspan="2" col="2">
 					<button name="button_reconcile_search"  string="_Search" type="object" icon="gtk-find" attrs="{'invisible': [('voucher_id','!=',False)]}"/>
@@ -46,7 +46,7 @@
 		<field name="type">form</field>
 		<field name="inherit_id" ref="account.view_bank_statement_form"/>
 		<field name="arch" type="xml">
-			<xpath expr="/form/notebook/page[@name='statement_line_ids']/field[@name='line_ids']/tree/field[@name='amount']" position="after">
+			<xpath expr="/form/sheet/notebook/page[@name='statement_line_ids']/field[@name='line_ids']/tree/field[@name='amount']" position="after">
 				<button name="%(action_statement_line_split_wizard)d" string="Split" type="action" icon="terp-stock_effects-object-colorize"/>
 			</xpath>
 		</field>

=== modified file 'nan_account_bank_statement/i18n/nan_account_bank_statement.pot'
--- nan_account_bank_statement/i18n/nan_account_bank_statement.pot	2012-01-20 10:41:21 +0000
+++ nan_account_bank_statement/i18n/nan_account_bank_statement.pot	2014-02-17 16:33:43 +0000
@@ -4,10 +4,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: OpenERP Server 6.0.1\n"
-"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
-"POT-Creation-Date: 2011-03-27 01:57+0000\n"
-"PO-Revision-Date: 2011-03-27 01:57+0000\n"
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-21 09:23+0000\n"
+"PO-Revision-Date: 2013-10-21 09:23+0000\n"
 "Last-Translator: <>\n"
 "Language-Team: \n"
 "MIME-Version: 1.0\n"
@@ -18,301 +18,280 @@
 #. module: nan_account_bank_statement
 #: field:account.bank.statement.line,search_by:0
 msgid "Search By"
-msgstr "Search By"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: selection:account.bank.statement.line,search_by:0
 msgid "Invoice Origin"
-msgstr "Invoice Origin"
+msgstr ""
 
 #. module: nan_account_bank_statement
-#: code:addons/nan_account_bank_statement/account_statement.py:654
+#: code:addons/nan_account_bank_statement/account_statement.py:683
 #, python-format
 msgid "Company Check Error"
-msgstr "Company Check Error"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: selection:account.bank.statement.line,search_by:0
 msgid "Payment Order"
-msgstr "Payment Order"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: selection:account.bank.statement.line,search_by:0
 msgid "None"
-msgstr "None"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: view:account.bank.statement.line.data:0
 msgid "Statement Line Data"
-msgstr "Statement Line Data"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: selection:account.bank.statement.line,search_by:0
 msgid "Reference and Amount"
-msgstr "Reference and Amount"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: selection:account.bank.statement.line,search_by:0
 msgid "Vat and Amount"
-msgstr "Vat and Amount"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: help:account.bank.statement.line.rule,sequence:0
 msgid "Rules will be applied in the order defined by this Sequence and will stop in the first matching rule."
-msgstr "Rules will be applied in the order defined by this Sequence and will stop in the first matching rule."
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: field:account.bank.statement.line.data,line_id:0
 msgid "Statement Line"
-msgstr "Statement Line"
+msgstr ""
 
 #. module: nan_account_bank_statement
-#: code:addons/nan_account_bank_statement/account_statement.py:243
+#: code:addons/nan_account_bank_statement/account_statement.py:247
 #, python-format
 msgid "Search by VAT error"
-msgstr "Search by VAT error"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: model:ir.ui.menu,name:nan_account_bank_statement.menu_configuration_bank_statement
 msgid "Bank Statements"
-msgstr "Bank Statements"
+msgstr ""
 
 #. module: nan_account_bank_statement
-#: code:addons/nan_account_bank_statement/account_statement.py:253
+#: code:addons/nan_account_bank_statement/account_statement.py:257
 #, python-format
 msgid "You cannot search by invoice number because it seems this line has not been imported from a bank statement file. The system expected an \"invoice_number\" key in the line with amount %(amount).2f in statement %(statement)s."
-msgstr "You cannot search by invoice number because it seems this line has not been imported from a bank statement file. The system expected an \"invoice_number\" key in the line with amount %(amount).2f in statement %(statement)s."
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: view:account.bank.statement.split.line.wizard:0
 msgid "Split Line Wizard"
-msgstr "Split Line Wizard"
+msgstr ""
 
 #. module: nan_account_bank_statement
-#: code:addons/nan_account_bank_statement/account_statement.py:233
+#: code:addons/nan_account_bank_statement/account_statement.py:237
 #, python-format
 msgid "Search by reference error"
-msgstr "Search by reference error"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: model:ir.model,name:nan_account_bank_statement.model_account_bank_statement_line_data
 msgid "account.bank.statement.line.data"
-msgstr "account.bank.statement.line.data"
-
-#. module: nan_account_bank_statement
-#: model:ir.module.module,shortdesc:nan_account_bank_statement.module_meta_information
-msgid "nan_account_bank_statement"
-msgstr "nan_account_bank_statement"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: field:account.bank.statement.line.rule,company_id:0
 msgid "Company"
-msgstr "Company"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: constraint:account.bank.statement.line.rule:0
 msgid "Company Check Error."
-msgstr "Company Check Error."
-
-#. module: nan_account_bank_statement
-#: model:ir.module.module,description:nan_account_bank_statement.module_meta_information
-msgid "This enhances standard bank statements by:\n"
-"\n"
-"- Adding a new button in statement lines to split the line in two.\n"
-"- Adding key/value information in statement lines which can later be used by other modules for automatically finding move lines to be reconciled."
-msgstr "This enhances standard bank statements by:\n"
-"\n"
-"- Adding a new button in statement lines to split the line in two.\n"
-"- Adding key/value information in statement lines which can later be used by other modules for automatically finding move lines to be reconciled."
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: view:account.bank.statement.line.rule:0
 msgid "Statement Line Rule"
-msgstr "Statement Line Rule"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: selection:account.bank.statement.line,search_by:0
 msgid "Invoice Number"
-msgstr "Invoice Number"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: model:ir.actions.act_window,name:nan_account_bank_statement.action_statement_line_split_wizard
 msgid "action.statement.line.split.wizard"
-msgstr "action.statement.line.split.wizard"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: field:account.bank.statement.line.data,key:0
 #: field:account.bank.statement.line.rule,key:0
 msgid "Key"
-msgstr "Key"
+msgstr ""
 
 #. module: nan_account_bank_statement
-#: code:addons/nan_account_bank_statement/account_statement.py:253
-#: code:addons/nan_account_bank_statement/account_statement.py:263
+#: code:addons/nan_account_bank_statement/account_statement.py:257
+#: code:addons/nan_account_bank_statement/account_statement.py:267
 #, python-format
 msgid "Search by invoice error"
-msgstr "Search by invoice error"
+msgstr ""
 
 #. module: nan_account_bank_statement
-#: code:addons/nan_account_bank_statement/account_statement.py:263
+#: code:addons/nan_account_bank_statement/account_statement.py:267
 #, python-format
 msgid "You cannot search by invoice origin because it seems this line has not been imported from a bank statement file. The system expected an \"invoice_origin\" key in the line with amount %(amount).2f in statement %(statement)s."
-msgstr "You cannot search by invoice origin because it seems this line has not been imported from a bank statement file. The system expected an \"invoice_origin\" key in the line with amount %(amount).2f in statement %(statement)s."
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: field:account.bank.statement.line.rule,account_id:0
 msgid "Account"
-msgstr "Account"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: help:account.bank.statement.line,data_ids:0
 msgid "Data related to the line, usually extracted/imported from a file provided by the bank or another partner."
-msgstr "Data related to the line, usually extracted/imported from a file provided by the bank or another partner."
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: view:account.bank.statement.split.line.wizard:0
 msgid "_Cancel"
-msgstr "_Cancel"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: help:account.bank.statement.line.rule,expression:0
 msgid "If the value of the given Key contains this Expression, Account and Partner will be used for that statement line."
-msgstr "If the value of the given Key contains this Expression, Account and Partner will be used for that statement line."
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: help:account.bank.statement.line.rule,account_id:0
 msgid "Account to be used if expression matches."
-msgstr "Account to be used if expression matches."
+msgstr ""
 
 #. module: nan_account_bank_statement
-#: code:addons/nan_account_bank_statement/account_statement.py:233
+#: code:addons/nan_account_bank_statement/account_statement.py:237
 #, python-format
 msgid "You cannot search by reference because it seems this line has not been imported from a bank statement file. The system expected a \"reference\" key in the line with amount %(amount).2f in statement %(statement)s."
-msgstr "You cannot search by reference because it seems this line has not been imported from a bank statement file. The system expected a \"reference\" key in the line with amount %(amount).2f in statement %(statement)s."
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: view:account.bank.statement:0
 msgid "_Search"
-msgstr "_Search"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: view:account.bank.statement.split.line.wizard:0
 msgid "_Accept"
-msgstr "_Accept"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: model:ir.model,name:nan_account_bank_statement.model_account_bank_statement_line
 msgid "Bank Statement Line"
-msgstr "Bank Statement Line"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: field:account.bank.statement.line.data,value:0
 msgid "Value"
-msgstr "Value"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: help:account.bank.statement.line.rule,partner_id:0
 msgid "Partner to be used if expression matches"
-msgstr "Partner to be used if expression matches"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: view:account.bank.statement:0
 msgid "Split"
-msgstr "Split"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: selection:account.bank.statement.line,search_by:0
 #: field:account.bank.statement.split.line.wizard,amount:0
 msgid "Amount"
-msgstr "Amount"
+msgstr ""
 
 #. module: nan_account_bank_statement
-#: code:addons/nan_account_bank_statement/account_statement.py:243
+#: code:addons/nan_account_bank_statement/account_statement.py:247
 #, python-format
 msgid "You cannot search by VAT because it seems this line has not been imported from a bank statement file. The system expected a \"vat\" key in the line with amount %(amount).2f in statement %(statement)s."
-msgstr "You cannot search by VAT because it seems this line has not been imported from a bank statement file. The system expected a \"vat\" key in the line with amount %(amount).2f in statement %(statement)s."
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: sql_constraint:account.bank.statement.line.data:0
 msgid "Key-value pairs must be unique per statement line."
-msgstr "Key-value pairs must be unique per statement line."
-
-#. module: nan_account_bank_statement
-#: constraint:account.bank.statement.line:0
-msgid "The amount of the voucher must be the same amount as the one on the statement line"
-msgstr "The amount of the voucher must be the same amount as the one on the statement line"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: model:ir.model,name:nan_account_bank_statement.model_account_bank_statement_split_line_wizard
 msgid "account.bank.statement.split.line.wizard"
-msgstr "account.bank.statement.split.line.wizard"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: field:account.bank.statement.line.rule,expression:0
 msgid "Expression"
-msgstr "Expression"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: selection:account.bank.statement.line,search_by:0
 msgid "All"
-msgstr "All"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: field:account.bank.statement.line,data_ids:0
 msgid "Related Data"
-msgstr "Related Data"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: field:account.bank.statement.line.rule,sequence:0
 msgid "Sequence"
-msgstr "Sequence"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: help:account.bank.statement.line.rule,key:0
 msgid "Key in statement line data that should match the given Expression."
-msgstr "Key in statement line data that should match the given Expression."
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: help:account.bank.statement.line.rule,company_id:0
 msgid "Company in which this rule should apply."
-msgstr "Company in which this rule should apply."
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: selection:account.bank.statement.line,search_by:0
 #: model:ir.model,name:nan_account_bank_statement.model_account_bank_statement
 msgid "Bank Statement"
-msgstr "Bank Statement"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: selection:account.bank.statement.line,search_by:0
 #: model:ir.actions.act_window,name:nan_account_bank_statement.action_statement_line_rules
 #: model:ir.ui.menu,name:nan_account_bank_statement.menu_statement_line_rule
 msgid "Statement Line Rules"
-msgstr "Statement Line Rules"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: view:account.bank.statement:0
 msgid "S_plit"
-msgstr "S_plit"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: field:account.bank.statement.line.rule,partner_id:0
 msgid "Partner"
-msgstr "Partner"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: field:account.bank.statement,total_amount:0
 msgid "Total Amount"
-msgstr "Total Amount"
+msgstr ""
 
 #. module: nan_account_bank_statement
 #: model:ir.model,name:nan_account_bank_statement.model_account_bank_statement_line_rule
 msgid "account.bank.statement.line.rule"
-msgstr "account.bank.statement.line.rule"
+msgstr ""
 
 #. module: nan_account_bank_statement
-#: code:addons/nan_account_bank_statement/account_statement.py:654
+#: code:addons/nan_account_bank_statement/account_statement.py:683
 #, python-format
 msgid "Company for account %(account)s does not match rule's company for rule %(rule)s."
-msgstr "Company for account %(account)s does not match rule's company for rule %(rule)s."
+msgstr ""
 

=== modified file 'paydays/i18n/paydays.pot'
--- paydays/i18n/paydays.pot	2010-12-28 12:41:15 +0000
+++ paydays/i18n/paydays.pot	2014-02-17 16:33:43 +0000
@@ -4,10 +4,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: OpenERP Server 5.0.1\n"
-"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
-"POT-Creation-Date: 2009-09-05 14:26:09+0000\n"
-"PO-Revision-Date: 2009-09-05 14:26:09+0000\n"
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-21 09:23+0000\n"
+"PO-Revision-Date: 2013-10-21 09:23+0000\n"
 "Last-Translator: <>\n"
 "Language-Team: \n"
 "MIME-Version: 1.0\n"
@@ -16,23 +16,18 @@
 "Plural-Forms: \n"
 
 #. module: paydays
-#: model:ir.module.module,shortdesc:paydays.module_meta_information
-msgid "Paydays"
-msgstr ""
-
-#. module: paydays
 #: help:account.payment.term,payment_days:0
 msgid "If a company has more than one payment days in a month you should fill them in this field and set 'Day of the Month' field in line to zero. For example, if a company pays the 5th and 20th days of the month you should write '5-20' here."
 msgstr ""
 
 #. module: paydays
-#: constraint:ir.ui.view:0
-msgid "Invalid XML for View Architecture!"
+#: constraint:account.payment.term:0
+msgid "Error: Payment days field format is not valid."
 msgstr ""
 
 #. module: paydays
-#: model:ir.module.module,description:paydays.module_meta_information
-msgid "This module allows setting more than one payment days in payment terms."
+#: model:ir.model,name:paydays.model_account_payment_term
+msgid "Payment Term"
 msgstr ""
 
 #. module: paydays

=== modified file 'purchase_payment/i18n/purchase_payment.pot'
--- purchase_payment/i18n/purchase_payment.pot	2010-12-20 20:55:38 +0000
+++ purchase_payment/i18n/purchase_payment.pot	2014-02-17 16:33:43 +0000
@@ -4,10 +4,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: OpenERP Server 6.0.0-rc1\n"
-"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
-"POT-Creation-Date: 2010-12-20 20:22:04+0000\n"
-"PO-Revision-Date: 2010-12-20 20:22:04+0000\n"
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-21 09:25+0000\n"
+"PO-Revision-Date: 2013-10-21 09:25+0000\n"
 "Last-Translator: <>\n"
 "Language-Team: \n"
 "MIME-Version: 1.0\n"
@@ -16,95 +16,58 @@
 "Plural-Forms: \n"
 
 #. module: purchase_payment
-#: model:ir.module.module,shortdesc:purchase_payment.module_meta_information
-msgid "Purchase Payment Type and Terms"
-msgstr ""
-
-#. module: purchase_payment
-#: model:ir.module.module,description:purchase_payment.module_meta_information
-msgid "Adds payment info to the purchase process.\n"
-"\n"
-"Adds payment type, terms, and bank account to the purchase orders.\n"
-"\n"
-"Allows to set different default payment terms for purchases (the partners\n"
-"will have payment terms and supplier payment terms).\n"
-"\n"
-"The payment terms, payment type and bank account default values for the\n"
-"purchase will be taken from the partner.\n"
-"\n"
-"Invoices created from purchase orders, or from pickings related to purchase\n"
-"orders, will inherit this payment info from the payment order.\n"
-""
-msgstr ""
-
-#. module: purchase_payment
-#: constraint:ir.ui.view:0
-msgid "Invalid XML for View Architecture!"
-msgstr "Invalid XML for View Architecture!"
-
-#. module: purchase_payment
-#: constraint:ir.model:0
-msgid "The Object name must start with x_ and not contain any special character !"
-msgstr "The Object name must start with x_ and not contain any special character !"
+#: field:purchase.order,payment_type:0
+msgid "Payment type"
+msgstr ""
 
 #. module: purchase_payment
 #: field:purchase.order,partner_bank:0
 msgid "Bank Account"
-msgstr "Bank Account"
+msgstr ""
 
 #. module: purchase_payment
 #: field:purchase.order,payment_term:0
 #: field:res.partner,property_payment_term_supplier:0
 msgid "Payment Term"
-msgstr "Payment Term"
-
-#. module: purchase_payment
-#: field:purchase.order,payment_type:0
-msgid "Payment type"
-msgstr "Payment type"
+msgstr ""
 
 #. module: purchase_payment
 #: model:ir.model,name:purchase_payment.model_purchase_order
 msgid "Purchase Order"
-msgstr "Purchase Order"
+msgstr ""
 
 #. module: purchase_payment
 #: help:res.partner,property_payment_term_supplier:0
 msgid "This payment term will be used instead of the default one for the current partner on purchases"
-msgstr "This payment term will be used instead of the default one for the current partner on purchases"
+msgstr ""
 
 #. module: purchase_payment
 #: help:purchase.order,payment_term:0
 msgid "The payment terms. They will be transferred to the invoice."
-msgstr "The payment terms. They will be transferred to the invoice."
+msgstr ""
 
 #. module: purchase_payment
 #: model:ir.model,name:purchase_payment.model_account_invoice
 msgid "Invoice"
-msgstr "Invoice"
+msgstr ""
 
 #. module: purchase_payment
 #: model:ir.model,name:purchase_payment.model_stock_picking
 msgid "Picking List"
-msgstr "Picking List"
+msgstr ""
 
 #. module: purchase_payment
 #: help:purchase.order,payment_type:0
 msgid "The type of payment. It will be transferred to the invoice."
-msgstr "The type of payment. It will be transferred to the invoice."
+msgstr ""
 
 #. module: purchase_payment
 #: model:ir.model,name:purchase_payment.model_res_partner
 msgid "Partner"
-msgstr "Partner"
+msgstr ""
 
 #. module: purchase_payment
 #: help:purchase.order,partner_bank:0
 msgid "The bank account to pay to or to be paid from. It will be transferred to the invoice."
-msgstr "The bank account to pay to or to be paid from. It will be transferred to the invoice."
-
-#. module: purchase_payment
-#: sql_constraint:ir.model.fields:0
-msgid "Size of the field can never be less than 1 !"
-msgstr "Size of the field can never be less than 1 !"
+msgstr ""
 

=== modified file 'sale_payment/__init__.py' (properties changed: +x to -x)
=== modified file 'sale_payment/__openerp__.py' (properties changed: +x to -x)
=== modified file 'sale_payment/i18n/ca.po' (properties changed: +x to -x)
=== modified file 'sale_payment/i18n/es.po' (properties changed: +x to -x)
=== modified file 'sale_payment/i18n/fr_BE.po' (properties changed: +x to -x)
=== modified file 'sale_payment/i18n/sale_payment.pot' (properties changed: +x to -x)
--- sale_payment/i18n/sale_payment.pot	2010-07-06 05:10:58 +0000
+++ sale_payment/i18n/sale_payment.pot	2014-02-17 16:33:43 +0000
@@ -4,10 +4,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: OpenERP Server 5.0.0\n"
-"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
-"POT-Creation-Date: 2009-01-25 00:57:54+0000\n"
-"PO-Revision-Date: 2009-01-25 00:57:54+0000\n"
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-21 09:25+0000\n"
+"PO-Revision-Date: 2013-10-21 09:25+0000\n"
 "Last-Translator: <>\n"
 "Language-Team: \n"
 "MIME-Version: 1.0\n"
@@ -16,8 +16,8 @@
 "Plural-Forms: \n"
 
 #. module: sale_payment
-#: constraint:ir.ui.view:0
-msgid "Invalid XML for View Architecture!"
+#: field:sale.order,payment_type:0
+msgid "Payment type"
 msgstr ""
 
 #. module: sale_payment
@@ -26,8 +26,8 @@
 msgstr ""
 
 #. module: sale_payment
-#: field:sale.order,payment_type:0
-msgid "Payment type"
+#: help:sale.order,payment_type:0
+msgid "The type of payment. It will be transferred to the invoice"
 msgstr ""
 
 #. module: sale_payment
@@ -36,7 +36,12 @@
 msgstr ""
 
 #. module: sale_payment
-#: help:sale.order,payment_type:0
-msgid "The type of payment. It will be transferred to the invoice"
+#: model:ir.model,name:sale_payment.model_stock_picking
+msgid "Picking List"
+msgstr ""
+
+#. module: sale_payment
+#: model:ir.model,name:sale_payment.model_sale_order
+msgid "Sales Order"
 msgstr ""
 

=== modified file 'sale_payment/sale_payment.py' (properties changed: +x to -x)
--- sale_payment/sale_payment.py	2010-12-20 20:49:08 +0000
+++ sale_payment/sale_payment.py	2014-02-17 16:33:43 +0000
@@ -31,9 +31,9 @@
         'partner_bank': fields.many2one('res.partner.bank','Bank Account', select=True, help='The bank account to pay to or to be paid from. It will be transferred to the invoice'),
     }
 
-    def onchange_partner_id(self, cr, uid, ids, part):
+    def onchange_partner_id(self, cr, uid, ids, part, context=None):
         """Copy partner data in the sale order, including payment_type and acc_number"""
-        result = super(sale_order, self).onchange_partner_id(cr, uid, ids, part)
+        result = super(sale_order, self).onchange_partner_id(cr, uid, ids, part, context=context)
         paytype_id = False
         if part:
             partner = self.pool.get('res.partner').browse(cr, uid, part)

=== modified file 'sale_payment/sale_payment_view.xml' (properties changed: +x to -x)

Follow ups