mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
Merge pull request #212 from Eficent/11.0-mig-account_mass_reconcile_by_purchase_line
[11.0][mig] account mass reconcile by purchase line
This commit is contained in:
@@ -1,38 +1,35 @@
|
||||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
|
||||
:target: https://www.gnu.org/licenses/agpl
|
||||
:alt: License: AGPL-3
|
||||
|
||||
==============
|
||||
Mass Reconcile
|
||||
==============
|
||||
======================
|
||||
Account Mass Reconcile
|
||||
======================
|
||||
|
||||
This is a shared work between Akretion and Camptocamp
|
||||
in order to provide:
|
||||
- reconciliation facilities for big volume of transactions
|
||||
- setup different profiles of reconciliation by account
|
||||
- each profile can use many methods of reconciliation
|
||||
- this module is also a base to create others
|
||||
reconciliation methods which can plug in the profiles
|
||||
- a profile a reconciliation can be run manually
|
||||
or by a cron
|
||||
- monitoring of reconciliation runs with an history
|
||||
which keep track of the reconciled Journal items
|
||||
|
||||
- Reconciliation facilities for big volume of transactions.
|
||||
- Setup different profiles of reconciliation by account.
|
||||
- Each profile can use many methods of reconciliation.
|
||||
- This module is also a base to create others
|
||||
reconciliation methods which can plug in the profiles.
|
||||
- A profile a reconciliation can be run manually
|
||||
or by a cron.
|
||||
- Monitoring of reconciliation runs with an history
|
||||
which keep track of the reconciled Journal items.
|
||||
|
||||
2 simple reconciliation methods are integrated
|
||||
in this module, the simple reconciliations works
|
||||
on 2 lines (1 debit / 1 credit) and do not allow
|
||||
partial reconcilation, they also match on 1 key,
|
||||
partial reconciliation, they also match on 1 key,
|
||||
partner or Journal item name.
|
||||
|
||||
This module combines both the ``account_easy_reconcile``
|
||||
and the``account_advanced_reconcile`` modules
|
||||
from previous versions.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
Go to 'Invoicing/Periodic Processing/Reconciliation/Mass Automatic Reconcile' to start a
|
||||
new mass reconcile.
|
||||
Go to 'Invoicing / Adviser / Mass Automatic Reconcile' to start a new mass
|
||||
reconcile.
|
||||
|
||||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||
:alt: Try me on Runbot
|
||||
@@ -50,6 +47,11 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
Credits
|
||||
=======
|
||||
|
||||
Images
|
||||
------
|
||||
|
||||
* Odoo Community Association: `Icon <https://odoo-community.org/logo.png>`_.
|
||||
|
||||
Contributors
|
||||
------------
|
||||
* Sébastien Beau <sebastien.beau@akretion.com>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Mass Reconcile",
|
||||
"name": "Account Mass Reconcile",
|
||||
"version": "11.0.1.0.0",
|
||||
"depends": [
|
||||
"account_invoicing",
|
||||
|
||||
@@ -173,7 +173,7 @@ class MassReconcileAdvanced(models.AbstractModel):
|
||||
opp_matchers = self._opposite_matchers(opposite_move_line)
|
||||
for matcher in matchers:
|
||||
try:
|
||||
opp_matcher = opp_matchers.next()
|
||||
opp_matcher = next(opp_matchers)
|
||||
except StopIteration:
|
||||
# if you fall here, you probably missed to put a `yield`
|
||||
# in `_opposite_matchers()`
|
||||
|
||||
@@ -60,8 +60,11 @@ class MassReconcileBase(models.AbstractModel):
|
||||
)
|
||||
return ["account_move_line.{}".format(col) for col in aml_cols]
|
||||
|
||||
def _selection_columns(self):
|
||||
return self._base_columns()
|
||||
|
||||
def _select_query(self, *args, **kwargs):
|
||||
return "SELECT %s" % ', '.join(self._base_columns())
|
||||
return "SELECT %s" % ', '.join(self._selection_columns())
|
||||
|
||||
def _from_query(self, *args, **kwargs):
|
||||
return ("FROM account_move_line ")
|
||||
|
||||
BIN
account_mass_reconcile/static/description/icon.png
Normal file
BIN
account_mass_reconcile/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
@@ -10,7 +10,7 @@
|
||||
<header>
|
||||
<button name="run_reconcile" class="oe_highlight"
|
||||
string="Start Auto Reconciliation" type="object"/>
|
||||
<button icon="STOCK_JUMP_TO" name="last_history_reconcile"
|
||||
<button icon="fa-share" name="last_history_reconcile"
|
||||
string="Display items reconciled on the last run"
|
||||
type="object"/>
|
||||
</header>
|
||||
@@ -25,7 +25,7 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="unreconciled_count"/>
|
||||
<button icon="STOCK_JUMP_TO" name="open_unreconcile"
|
||||
<button icon="fa-share" name="open_unreconcile"
|
||||
string="Go to unreconciled items" type="object"/>
|
||||
</group>
|
||||
</group>
|
||||
@@ -38,7 +38,7 @@
|
||||
<field name="history_ids" nolabel="1">
|
||||
<tree string="Automatic Mass Reconcile History">
|
||||
<field name="date"/>
|
||||
<button icon="STOCK_JUMP_TO" name="open_reconcile"
|
||||
<button icon="fa-share" name="open_reconcile"
|
||||
string="Go to reconciled items" type="object"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -58,9 +58,8 @@ The lines should have the same amount (with the write-off) and the same referenc
|
||||
<group colspan="2" col="2">
|
||||
<separator colspan="4" string="Advanced. Partner and Ref"/>
|
||||
<label string="Match multiple debit vs multiple credit entries. Allow partial reconciliation.
|
||||
The lines should have the partner, the credit entry ref. is matched vs the debit entry ref. or name." colspan="4"/>
|
||||
The lines should have the same partner, and the credit entry ref. is matched with the debit entry ref. or name." colspan="4"/>
|
||||
</group>
|
||||
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
@@ -84,7 +83,7 @@ The lines should have the partner, the credit entry ref. is matched vs the debit
|
||||
<field name="unreconciled_count"/>
|
||||
<button icon="gtk-ok" name="run_reconcile" colspan="4"
|
||||
string="Start Auto Reconcilation" type="object"/>
|
||||
<button icon="STOCK_JUMP_TO" name="last_history_reconcile" colspan="2"
|
||||
<button icon="fa-share" name="last_history_reconcile" colspan="2"
|
||||
string="Display items reconciled on the last run" type="object"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<header>
|
||||
<button name="open_reconcile"
|
||||
string="Go to reconciled items"
|
||||
icon="STOCK_JUMP_TO" type="object"/>
|
||||
icon="fa-share" type="object"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<group>
|
||||
@@ -62,7 +62,7 @@
|
||||
<tree string="Automatic Mass Reconcile History">
|
||||
<field name="mass_reconcile_id"/>
|
||||
<field name="date"/>
|
||||
<button icon="STOCK_JUMP_TO" name="open_reconcile"
|
||||
<button icon="fa-share" name="open_reconcile"
|
||||
string="Go to reconciled items" type="object"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
65
account_mass_reconcile_by_purchase_line/README.rst
Normal file
65
account_mass_reconcile_by_purchase_line/README.rst
Normal file
@@ -0,0 +1,65 @@
|
||||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
|
||||
:target: https://www.gnu.org/licenses/agpl
|
||||
:alt: License: AGPL-3
|
||||
|
||||
=======================================
|
||||
Account Mass Reconcile by Purchase Line
|
||||
=======================================
|
||||
|
||||
This module extends the functionality of account_mass_reconcile and
|
||||
allow an user to reconcile debits and credits of an Account
|
||||
using the PO Line and Product as key fields. This type of
|
||||
reconciliation is to be used in the context of the Perpetual Inventory
|
||||
accounting system, with the accrual account '*Goods Received Not Invoiced*'.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
To use this module, you need to:
|
||||
|
||||
* Go to 'Accounting / Adviser / Mass Automatic Reconcile'.
|
||||
|
||||
* Create a new reconciliation profile, and select a new configuration entry
|
||||
with type 'Advanced. Product, purchase order line'.
|
||||
|
||||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||
:alt: Try me on Runbot
|
||||
:target: https://runbot.odoo-community.org/runbot/98/11.0
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues
|
||||
<https://github.com/OCA/bank-statement-reconcile/issues>`_. In case of trouble, please
|
||||
check there if your issue has already been reported. If you spotted it first,
|
||||
help us smashing it by providing a detailed and welcomed feedback.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Images
|
||||
------
|
||||
|
||||
* Odoo Community Association: `Icon <https://odoo-community.org/logo.png>`_.
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
* Jordi Ballester Alomar <jordi.ballester@eficent.com>
|
||||
* Miquel Raïch <miquel.raich@eficent.com>
|
||||
* Lois Rilo <lois.rilo@eficent.com>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
.. image:: https://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: https://odoo-community.org
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.
|
||||
|
||||
To contribute to this module, please visit https://odoo-community.org.
|
||||
1
account_mass_reconcile_by_purchase_line/__init__.py
Normal file
1
account_mass_reconcile_by_purchase_line/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
21
account_mass_reconcile_by_purchase_line/__manifest__.py
Normal file
21
account_mass_reconcile_by_purchase_line/__manifest__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# © 2015-18 Eficent Business and IT Consulting Services S.L. (www.eficent.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
{
|
||||
"name": "Account Mass Reconcile by Purchase Line",
|
||||
"summary": "Allows to reconcile based on the PO line",
|
||||
"version": "11.0.1.0.0",
|
||||
"author": "Eficent, "
|
||||
"Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/bank-statement-reconcile",
|
||||
"category": "Finance",
|
||||
"depends": ["account_mass_reconcile",
|
||||
"account_move_line_purchase_info"
|
||||
],
|
||||
"license": "AGPL-3",
|
||||
"data": [
|
||||
"views/mass_reconcile.xml",
|
||||
],
|
||||
"installable": True,
|
||||
"auto_install": False,
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_mass_reconcile_by_purchase_line
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \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_mass_reconcile_by_purchase_line
|
||||
#: model:ir.ui.view,arch_db:account_mass_reconcile_by_purchase_line.account_mass_reconcile_form
|
||||
msgid "Advanced. Purchase Order Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_mass_reconcile_by_purchase_line
|
||||
#: model:ir.model.fields,field_description:account_mass_reconcile_by_purchase_line.field_mass_reconcile_advanced_by_purchase_line_create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_mass_reconcile_by_purchase_line
|
||||
#: model:ir.model.fields,field_description:account_mass_reconcile_by_purchase_line.field_mass_reconcile_advanced_by_purchase_line_create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_mass_reconcile_by_purchase_line
|
||||
#: model:ir.model.fields,field_description:account_mass_reconcile_by_purchase_line.field_mass_reconcile_advanced_by_purchase_line_display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_mass_reconcile_by_purchase_line
|
||||
#: model:ir.model.fields,field_description:account_mass_reconcile_by_purchase_line.field_mass_reconcile_advanced_by_purchase_line_id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_mass_reconcile_by_purchase_line
|
||||
#: model:ir.model.fields,field_description:account_mass_reconcile_by_purchase_line.field_mass_reconcile_advanced_by_purchase_line___last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_mass_reconcile_by_purchase_line
|
||||
#: model:ir.model.fields,field_description:account_mass_reconcile_by_purchase_line.field_mass_reconcile_advanced_by_purchase_line_write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_mass_reconcile_by_purchase_line
|
||||
#: model:ir.model.fields,field_description:account_mass_reconcile_by_purchase_line.field_mass_reconcile_advanced_by_purchase_line_write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_mass_reconcile_by_purchase_line
|
||||
#: model:ir.ui.view,arch_db:account_mass_reconcile_by_purchase_line.account_mass_reconcile_form
|
||||
msgid "Match multiple debit vs multiple credit entries. Allow partial reconciliation. The lines should have the same partner, product and PO lines to be reconciled."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_mass_reconcile_by_purchase_line
|
||||
#: model:ir.model,name:account_mass_reconcile_by_purchase_line.model_mass_reconcile_advanced
|
||||
msgid "mass.reconcile.advanced"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_mass_reconcile_by_purchase_line
|
||||
#: model:ir.model,name:account_mass_reconcile_by_purchase_line.model_mass_reconcile_advanced_by_purchase_line
|
||||
msgid "mass.reconcile.advanced.by.purchase.line"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_mass_reconcile_by_purchase_line
|
||||
#: model:ir.model,name:account_mass_reconcile_by_purchase_line.model_account_mass_reconcile_method
|
||||
msgid "reconcile method for account_mass_reconcile"
|
||||
msgstr ""
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
from . import mass_reconcile
|
||||
from . import base_advanced_reconciliation
|
||||
from . import advanced_reconciliation
|
||||
@@ -0,0 +1,29 @@
|
||||
# © 2015-18 Eficent Business and IT Consulting Services S.L. (www.eficent.com)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class MassReconcileAdvancedByPurchaseLine(models.TransientModel):
|
||||
_name = 'mass.reconcile.advanced.by.purchase.line'
|
||||
_inherit = 'mass.reconcile.advanced'
|
||||
|
||||
@staticmethod
|
||||
def _skip_line(move_line):
|
||||
"""
|
||||
When True is returned on some conditions, the credit move line
|
||||
will be skipped for reconciliation. Can be inherited to
|
||||
skip on some conditions. ie: ref or partner_id is empty.
|
||||
"""
|
||||
return not (move_line.get('product_id') and
|
||||
move_line.get('purchase_line_id'))
|
||||
|
||||
@staticmethod
|
||||
def _matchers(move_line):
|
||||
return (('product_id', move_line['product_id']),
|
||||
('purchase_line_id', move_line['purchase_line_id']))
|
||||
|
||||
@staticmethod
|
||||
def _opposite_matchers(move_line):
|
||||
yield ('product_id', move_line['product_id'])
|
||||
yield ('purchase_line_id', move_line['purchase_line_id'])
|
||||
@@ -0,0 +1,14 @@
|
||||
# © 2015-18 Eficent Business and IT Consulting Services S.L. (www.eficent.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class MassReconcileAdvanced(models.AbstractModel):
|
||||
_inherit = 'mass.reconcile.advanced'
|
||||
|
||||
def _selection_columns(self):
|
||||
aml_cols = super(MassReconcileAdvanced, self)._selection_columns()
|
||||
aml_cols.append('account_move_line.purchase_line_id')
|
||||
aml_cols.append('account_move_line.product_id')
|
||||
return aml_cols
|
||||
@@ -0,0 +1,16 @@
|
||||
# © 2015-18 Eficent Business and IT Consulting Services S.L. (www.eficent.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountMassReconcileMethod(models.Model):
|
||||
_inherit = 'account.mass.reconcile.method'
|
||||
|
||||
def _selection_name(self):
|
||||
methods = super(AccountMassReconcileMethod, self)._selection_name()
|
||||
methods += [
|
||||
('mass.reconcile.advanced.by.purchase.line',
|
||||
'Advanced. Product, purchase order line.'),
|
||||
]
|
||||
return methods
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="account_mass_reconcile_form" model="ir.ui.view">
|
||||
<field name="name">account.mass.reconcile.form</field>
|
||||
<field name="priority">20</field>
|
||||
<field name="model">account.mass.reconcile</field>
|
||||
<field name="inherit_id" ref="account_mass_reconcile.account_mass_reconcile_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<page name="information" position="inside">
|
||||
<group colspan="2" col="2">
|
||||
<separator colspan="4" string="Advanced. Purchase Order Line"/>
|
||||
<label string="Match multiple debit vs multiple credit entries. Allow partial reconciliation.
|
||||
The lines should have the same partner, product and PO lines to be reconciled." colspan="4"/>
|
||||
</group>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
1
oca_dependencies.txt
Normal file
1
oca_dependencies.txt
Normal file
@@ -0,0 +1 @@
|
||||
account-financial-tools
|
||||
Reference in New Issue
Block a user