mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[MIG] account_mass_reconcile: Init mgration to 10.0
This commit is contained in:
committed by
Florian da Costa
parent
49591d0d78
commit
e295dbc56e
@@ -36,7 +36,7 @@ new mass reconcile.
|
||||
|
||||
.. 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
|
||||
:target: https://runbot.odoo-community.org/runbot/98/10.0
|
||||
|
||||
|
||||
Bug Tracker
|
||||
@@ -68,6 +68,7 @@ Contributors
|
||||
* Laetitia Gangloff <laetitia.gangloff@acsone.eu>
|
||||
* Frédéric Clémenti <frederic.clementi@camptocamp.com>
|
||||
* Damien Crier <damien.crier@camptocamp.com>
|
||||
* Akim Juillerat <akim.juillerat@camptocamp.com>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
{
|
||||
"name": "Mass Reconcile",
|
||||
"version": "9.0.1.0.0",
|
||||
"depends": ["account", "account_full_reconcile"],
|
||||
"version": "10.0.1.0.0",
|
||||
"depends": ["account"],
|
||||
"author": "Akretion,Camptocamp,Odoo Community Association (OCA)",
|
||||
"website": "http://www.akretion.com/",
|
||||
"category": "Finance",
|
||||
@@ -18,6 +18,6 @@
|
||||
],
|
||||
'license': 'AGPL-3',
|
||||
"auto_install": False,
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# © 2010 Sébastien Beau
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, api
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class MassReconcileAdvancedRef(models.TransientModel):
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
import logging
|
||||
|
||||
from openerp import models, api
|
||||
from odoo import models, api
|
||||
from itertools import product
|
||||
from openerp.tools.translate import _
|
||||
from odoo.tools.translate import _
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# © 2010 Sébastien Beau
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, api, fields
|
||||
from openerp.tools.safe_eval import safe_eval
|
||||
from odoo import _, models, api, fields
|
||||
from odoo.tools.safe_eval import safe_eval
|
||||
from operator import itemgetter
|
||||
|
||||
|
||||
@@ -149,16 +149,18 @@ class MassReconcileBase(models.AbstractModel):
|
||||
"""
|
||||
self.ensure_one()
|
||||
ml_obj = self.env['account.move.line']
|
||||
line_ids = [l['id'] for l in lines]
|
||||
below_writeoff, sum_debit, sum_credit = self._below_writeoff_limit(
|
||||
lines, self.write_off
|
||||
)
|
||||
rec_date = self._get_rec_date(lines, self.date_base_on)
|
||||
line_rs = ml_obj.browse([l['id'] for l in lines]).with_context(
|
||||
date_p=rec_date,
|
||||
comment=_('Automatic Write Off'))
|
||||
if below_writeoff:
|
||||
if sum_credit > sum_debit:
|
||||
writeoff_account = self.account_profit_id
|
||||
else:
|
||||
writeoff_account = self.account_lost_id
|
||||
line_rs = ml_obj.browse(line_ids)
|
||||
line_rs.reconcile(
|
||||
writeoff_acc_id=writeoff_account,
|
||||
writeoff_journal_id=self.journal_id
|
||||
@@ -176,7 +178,6 @@ class MassReconcileBase(models.AbstractModel):
|
||||
writeoff_account = self.income_exchange_account_id
|
||||
else:
|
||||
writeoff_account = self.expense_exchange_account_id
|
||||
line_rs = ml_obj.browse(line_ids)
|
||||
line_rs.reconcile(
|
||||
writeoff_acc_id=writeoff_account,
|
||||
writeoff_journal_id=self.journal_id
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from datetime import datetime
|
||||
from openerp import models, api, fields, _
|
||||
from openerp.exceptions import Warning as UserError
|
||||
from openerp import sql_db
|
||||
from odoo import models, api, fields, _
|
||||
from odoo.exceptions import Warning as UserError
|
||||
from odoo import sql_db
|
||||
|
||||
import logging
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# © 2012-2016 Camptocamp SA (Guewen Baconnier, Damien Crier, Matthieu Dietrich)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, api, fields, _
|
||||
from odoo import models, api, fields, _
|
||||
|
||||
|
||||
class MassReconcileHistory(models.Model):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# © 2014-2016 Camptocamp SA (Leonardo Pistone, Damien Crier, Matthieu Dietrich)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, fields
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class AccountConfigSettings(models.TransientModel):
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# © 2010 Sébastien Beau
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, api
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class MassReconcileSimple(models.AbstractModel):
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# © 2014-2016 Camptocamp SA (Damien Crier)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp.tests import common
|
||||
from openerp import tools
|
||||
from openerp.modules import get_module_resource
|
||||
from odoo.tests import common
|
||||
from odoo import tools
|
||||
from odoo.modules import get_module_resource
|
||||
|
||||
|
||||
class TestOnChange(common.TransactionCase):
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# © 2014-2016 Camptocamp SA (Damien Crier)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp.tests import common
|
||||
from openerp import fields, exceptions, tools
|
||||
from openerp.modules import get_module_resource
|
||||
from odoo.tests import common
|
||||
from odoo import fields, exceptions, tools
|
||||
from odoo.modules import get_module_resource
|
||||
|
||||
|
||||
class TestReconcile(common.TransactionCase):
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# © 2014-2016 Camptocamp SA (Damien Crier)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp.tests import common
|
||||
from openerp import fields, tools
|
||||
from openerp.modules import get_module_resource
|
||||
from odoo.tests import common
|
||||
from odoo import fields, tools
|
||||
from odoo.modules import get_module_resource
|
||||
|
||||
|
||||
class TestReconcileHistory(common.TransactionCase):
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# © 2014-2016 Camptocamp SA (Damien Crier)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp.tests import common
|
||||
from openerp import fields, tools
|
||||
from openerp.modules import get_module_resource
|
||||
from odoo.tests import common
|
||||
from odoo import fields, tools
|
||||
from odoo.modules import get_module_resource
|
||||
|
||||
|
||||
class TestScenarioReconcile(common.TransactionCase):
|
||||
@@ -64,7 +64,7 @@ class TestScenarioReconcile(common.TransactionCase):
|
||||
}
|
||||
)
|
||||
# validate invoice
|
||||
invoice.signal_workflow('invoice_open')
|
||||
invoice.action_invoice_open()
|
||||
self.assertEqual('open', invoice.state)
|
||||
|
||||
# create bank_statement
|
||||
@@ -161,7 +161,7 @@ class TestScenarioReconcile(common.TransactionCase):
|
||||
}
|
||||
)
|
||||
# validate invoice
|
||||
invoice.signal_workflow('invoice_open')
|
||||
invoice.action_invoice_open()
|
||||
self.assertEqual('open', invoice.state)
|
||||
|
||||
# create bank_statement
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<odoo>
|
||||
<!-- account.mass.reconcile view -->
|
||||
<record id="account_mass_reconcile_form" model="ir.ui.view">
|
||||
<field name="name">account.mass.reconcile.form</field>
|
||||
@@ -138,7 +136,6 @@ The lines should have the partner, the credit entry ref. is matched vs the debit
|
||||
id="menu_mass_reconcile"
|
||||
parent="account.menu_finance_entries"/>
|
||||
|
||||
</data>
|
||||
|
||||
<data noupdate="1">
|
||||
|
||||
@@ -157,4 +154,4 @@ The lines should have the partner, the credit entry ref. is matched vs the debit
|
||||
|
||||
</data>
|
||||
|
||||
</openerp>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user