diff --git a/account_advanced_reconcile_transaction_by_purchase_line/README.rst b/account_advanced_reconcile_transaction_by_purchase_line/README.rst new file mode 100644 index 00000000..fa5b8110 --- /dev/null +++ b/account_advanced_reconcile_transaction_by_purchase_line/README.rst @@ -0,0 +1,67 @@ +.. image:: https://img.shields.io/badge/license-AGPLv3-blue.svg + :target: https://www.gnu.org/licenses/agpl.html + :alt: License: AGPL-3 + +======================================================= +Account Advanced Reconcile Transaction by Purchase Line +======================================================= + +This module will allow a user to reconcile debits and credits of an Account +using the PO Line, Product and Partner 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 +===== + +* Go to 'Invoicing / Periodic Processing / Reconciliation / Easy Automatic + Reconciliation'. + +* Create a new reconciliation profile, and select a new configuration entry + with type 'Advanced. GR/IR Key as partner, 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/8.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Contributors +------------ + +* Jordi Ballester Alomar + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://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 http://odoo-community.org. \ No newline at end of file diff --git a/account_advanced_reconcile_transaction_by_purchase_line/__init__.py b/account_advanced_reconcile_transaction_by_purchase_line/__init__.py index e19ad65a..c3085bd2 100644 --- a/account_advanced_reconcile_transaction_by_purchase_line/__init__.py +++ b/account_advanced_reconcile_transaction_by_purchase_line/__init__.py @@ -1,23 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Romain Deheele. Copyright Camptocamp SA -# -# 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 . -# -############################################################################## +# © 2015 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 . import easy_reconcile -from . import base_advanced_reconciliation -from . import advanced_reconciliation +from . import models +from . import wizards diff --git a/account_advanced_reconcile_transaction_by_purchase_line/__openerp__.py b/account_advanced_reconcile_transaction_by_purchase_line/__openerp__.py index b9d10e92..7e5c4f2f 100644 --- a/account_advanced_reconcile_transaction_by_purchase_line/__openerp__.py +++ b/account_advanced_reconcile_transaction_by_purchase_line/__openerp__.py @@ -1,40 +1,21 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Romain Deheele. Copyright Camptocamp SA -# -# 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 . -# -############################################################################## +# © 2015 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': 'Advanced Reconcile Transaction by Purchase Line', - 'description': """ -Advanced reconciliation method for the module account_advanced_reconcile -======================================================================== -Reconcile rules with transaction_ref - -""", - 'version': '1.0.1', - 'author': "Camptocamp,Odoo Community Association (OCA)", - 'category': 'Finance', - 'website': 'http://www.camptocamp.com', - 'depends': ['account_advanced_reconcile', - 'account_move_line_purchase_info'], - 'data': ['easy_reconcile_view.xml'], - 'demo': [], - 'test': [], # To be ported or migrate to unit tests or scenarios - 'auto_install': False, - 'installable': True, - 'images': [] - } +{ + "name": "Account Advanced Reconcile Transaction by Purchase Line", + "summary": "Allows to reconcile based on the PO line", + "version": "8.0.1.0.0", + "author": "Eficent Business and IT Consulting Services S.L., " + "Odoo Community Association (OCA)", + "website": "http://www.eficent.com", + "category": "Generic", + "depends": ["account_advanced_reconcile", + "account_move_line_purchase_info" + ], + "license": "AGPL-3", + "data": [ + "views/easy_reconcile_view.xml", + ], + 'installable': True, +} diff --git a/account_advanced_reconcile_transaction_by_purchase_line/base_advanced_reconciliation.py b/account_advanced_reconcile_transaction_by_purchase_line/base_advanced_reconciliation.py deleted file mode 100644 index 74502d31..00000000 --- a/account_advanced_reconcile_transaction_by_purchase_line/base_advanced_reconciliation.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Romain Deheele -# Copyright 2013 Camptocamp SA -# -# 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 . -# -############################################################################## - -from openerp import models, api - - -class EasyReconcileAdvanced(models.AbstractModel): - - _inherit = 'easy.reconcile.advanced' - - @api.model - def _base_columns(self): - """ Mandatory columns for move lines queries - An extra column aliased as ``key`` should be defined - in each query.""" - aml_cols = super(EasyReconcileAdvanced, self)._base_columns() - aml_cols.append('account_move_line.purchase_line_id') - aml_cols.append('account_move_line.product_id') - return aml_cols diff --git a/account_advanced_reconcile_transaction_by_purchase_line/easy_reconcile.py b/account_advanced_reconcile_transaction_by_purchase_line/easy_reconcile.py deleted file mode 100644 index 8267d441..00000000 --- a/account_advanced_reconcile_transaction_by_purchase_line/easy_reconcile.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Romain Deheele -# Copyright 2013 Camptocamp SA -# -# 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 . -# -############################################################################## -from openerp import models, api - - -class AccountEasyReconcileMethod(models.Model): - - _inherit = 'account.easy.reconcile.method' - - @api.model - def _get_all_rec_method(self): - methods = super(AccountEasyReconcileMethod, self).\ - _get_all_rec_method() - methods += [ - ('easy.reconcile.advanced.by.purchase.line', - 'Advanced. GR/IR Key as partner, product, purchase order line.'), - ] - return methods diff --git a/account_advanced_reconcile_transaction_by_purchase_line/models/__init__.py b/account_advanced_reconcile_transaction_by_purchase_line/models/__init__.py new file mode 100644 index 00000000..83a65fd0 --- /dev/null +++ b/account_advanced_reconcile_transaction_by_purchase_line/models/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# © 2015 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 . import easy_reconcile +from . import base_advanced_reconciliation diff --git a/account_advanced_reconcile_transaction_by_purchase_line/models/base_advanced_reconciliation.py b/account_advanced_reconcile_transaction_by_purchase_line/models/base_advanced_reconciliation.py new file mode 100644 index 00000000..8da51d24 --- /dev/null +++ b/account_advanced_reconcile_transaction_by_purchase_line/models/base_advanced_reconciliation.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# © 2015 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 openerp import models, api + + +class EasyReconcileAdvanced(models.AbstractModel): + + _inherit = 'easy.reconcile.advanced' + + @api.model + def _base_columns(self): + """ Mandatory columns for move lines queries + An extra column aliased as ``key`` should be defined + in each query.""" + aml_cols = super(EasyReconcileAdvanced, self)._base_columns() + aml_cols.append('account_move_line.purchase_line_id') + aml_cols.append('account_move_line.product_id') + return aml_cols diff --git a/account_advanced_reconcile_transaction_by_purchase_line/models/easy_reconcile.py b/account_advanced_reconcile_transaction_by_purchase_line/models/easy_reconcile.py new file mode 100644 index 00000000..edb445bc --- /dev/null +++ b/account_advanced_reconcile_transaction_by_purchase_line/models/easy_reconcile.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# © 2015 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 openerp import models, api + + +class AccountEasyReconcileMethod(models.Model): + + _inherit = 'account.easy.reconcile.method' + + @api.model + def _get_all_rec_method(self): + methods = super(AccountEasyReconcileMethod, self).\ + _get_all_rec_method() + methods += [ + ('easy.reconcile.advanced.by.purchase.line', + 'Advanced. GR/IR Key as partner, product, purchase order line.'), + ] + return methods diff --git a/account_advanced_reconcile_transaction_by_purchase_line/easy_reconcile_view.xml b/account_advanced_reconcile_transaction_by_purchase_line/views/easy_reconcile_view.xml similarity index 100% rename from account_advanced_reconcile_transaction_by_purchase_line/easy_reconcile_view.xml rename to account_advanced_reconcile_transaction_by_purchase_line/views/easy_reconcile_view.xml diff --git a/account_advanced_reconcile_transaction_by_purchase_line/wizards/__init__.py b/account_advanced_reconcile_transaction_by_purchase_line/wizards/__init__.py new file mode 100644 index 00000000..79933302 --- /dev/null +++ b/account_advanced_reconcile_transaction_by_purchase_line/wizards/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2015 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 . import advanced_reconciliation diff --git a/account_advanced_reconcile_transaction_by_purchase_line/advanced_reconciliation.py b/account_advanced_reconcile_transaction_by_purchase_line/wizards/advanced_reconciliation.py similarity index 52% rename from account_advanced_reconcile_transaction_by_purchase_line/advanced_reconciliation.py rename to account_advanced_reconcile_transaction_by_purchase_line/wizards/advanced_reconciliation.py index 6c74cb9e..1525d472 100644 --- a/account_advanced_reconcile_transaction_by_purchase_line/advanced_reconciliation.py +++ b/account_advanced_reconcile_transaction_by_purchase_line/wizards/advanced_reconciliation.py @@ -1,22 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Romain Deheele. Copyright Camptocamp SA -# -# 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 . -# -############################################################################## +# © 2015 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 openerp import models, api @@ -34,7 +18,7 @@ class EasyReconcileAdvancedTransactionByPurchaseLine(models.TransientModel): skip on some conditions. ie: ref or partner_id is empty. """ return not move_line.get('partner_id') and move_line.get( - 'product_id') and move_line.get('purchase_line_id') + 'product_id') and move_line.get('purchase_line_id') @api.model def _matchers(self, move_line):