mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[ADD]account_mass_reconcile_by_sale_line
This commit is contained in:
63
account_mass_reconcile_by_sale_line/README.rst
Normal file
63
account_mass_reconcile_by_sale_line/README.rst
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
.. 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 Sale Line
|
||||||
|
===================================
|
||||||
|
|
||||||
|
This module extends the functionality of account_mass_reconcile and
|
||||||
|
allow an user to reconcile debits and credits of an Account
|
||||||
|
using the SO 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, sale 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
|
||||||
|
------------
|
||||||
|
|
||||||
|
* Aaron Henriquez <ahenriquez@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_sale_line/__init__.py
Normal file
1
account_mass_reconcile_by_sale_line/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import models
|
||||||
21
account_mass_reconcile_by_sale_line/__manifest__.py
Normal file
21
account_mass_reconcile_by_sale_line/__manifest__.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Copyright 2020 ForgeFlow S.L.
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "Account Mass Reconcile by Sale Line",
|
||||||
|
"summary": "Allows to reconcile based on the SO line",
|
||||||
|
"version": "11.0.1.0.0",
|
||||||
|
"author": "ForgeFlow S.L., "
|
||||||
|
"Odoo Community Association (OCA)",
|
||||||
|
"website": "https://github.com/OCA/bank-statement-reconcile",
|
||||||
|
"category": "Finance",
|
||||||
|
"depends": ["account_mass_reconcile",
|
||||||
|
"account_move_line_sale_info"
|
||||||
|
],
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"data": [
|
||||||
|
"views/mass_reconcile.xml",
|
||||||
|
],
|
||||||
|
"installable": True,
|
||||||
|
"auto_install": False,
|
||||||
|
}
|
||||||
3
account_mass_reconcile_by_sale_line/models/__init__.py
Normal file
3
account_mass_reconcile_by_sale_line/models/__init__.py
Normal file
@@ -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.sale.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('sale_line_id'))
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _matchers(move_line):
|
||||||
|
return (('product_id', move_line['product_id']),
|
||||||
|
('sale_line_id', move_line['sale_line_id']))
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _opposite_matchers(move_line):
|
||||||
|
yield ('product_id', move_line['product_id'])
|
||||||
|
yield ('sale_line_id', move_line['sale_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.sale_line_id')
|
||||||
|
aml_cols.append('account_move_line.product_id')
|
||||||
|
return aml_cols
|
||||||
16
account_mass_reconcile_by_sale_line/models/mass_reconcile.py
Normal file
16
account_mass_reconcile_by_sale_line/models/mass_reconcile.py
Normal file
@@ -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.sale.line',
|
||||||
|
'Advanced. Product, sale order line.'),
|
||||||
|
]
|
||||||
|
return methods
|
||||||
BIN
account_mass_reconcile_by_sale_line/static/description/icon.png
Normal file
BIN
account_mass_reconcile_by_sale_line/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
18
account_mass_reconcile_by_sale_line/views/mass_reconcile.xml
Normal file
18
account_mass_reconcile_by_sale_line/views/mass_reconcile.xml
Normal file
@@ -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. Sale Order Line"/>
|
||||||
|
<label string="Match multiple debit vs multiple credit entries. Allow partial reconciliation.
|
||||||
|
The lines should have the same partner, product and SO lines to be reconciled." colspan="4"/>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user