diff --git a/account_operating_unit/README.rst b/account_operating_unit/README.rst index 4e802b1e8e..1d3a847ee0 100644 --- a/account_operating_unit/README.rst +++ b/account_operating_unit/README.rst @@ -85,7 +85,7 @@ Usage .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/213/10.0 + :target: https://runbot.odoo-community.org/runbot/213/11.0 Known issues / Roadmap ====================== @@ -119,6 +119,8 @@ Contributors * Jordi Ballester Alomar * Aarón Henríquez * Serpent Consulting Services Pvt. Ltd. +* WilldooIT Pty Ltd +* Michael Villamar Maintainer ---------- diff --git a/account_operating_unit/__init__.py b/account_operating_unit/__init__.py index a647cd034c..06448aae56 100644 --- a/account_operating_unit/__init__.py +++ b/account_operating_unit/__init__.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from . import models from . import wizard from . import report diff --git a/account_operating_unit/__manifest__.py b/account_operating_unit/__manifest__.py index 9eaee8e0ac..179f15cdc8 100644 --- a/account_operating_unit/__manifest__.py +++ b/account_operating_unit/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2016-17 Eficent Business and IT Consulting Services S.L. # © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). @@ -6,9 +5,10 @@ "name": 'Accounting with Operating Units', "summary": "Introduces Operating Unit fields in invoices and " "Accounting Entries with clearing account", - "version": "10.0.1.1.0", + "version": "11.0.1.0.0", "author": "Eficent, " "Serpent Consulting Services Pvt. Ltd.," + "WilldooIT Pty Ltd," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/operating-unit", "category": "Accounting & Finance", @@ -24,7 +24,6 @@ "views/account_invoice_report_view.xml", "views/report_financial.xml", "views/report_trialbalance.xml", - "views/report_agedpartnerbalance.xml", "wizard/account_report_common_view.xml", "wizard/account_financial_report_view.xml", "wizard/account_report_trial_balance_view.xml", diff --git a/account_operating_unit/models/__init__.py b/account_operating_unit/models/__init__.py index f1237de449..a3df860d0f 100644 --- a/account_operating_unit/models/__init__.py +++ b/account_operating_unit/models/__init__.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from . import company from . import account_journal from . import account_move diff --git a/account_operating_unit/models/account_journal.py b/account_operating_unit/models/account_journal.py index aac87cb468..cfe8c9fbbb 100644 --- a/account_operating_unit/models/account_journal.py +++ b/account_operating_unit/models/account_journal.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from odoo import api, fields, models, _ from odoo.exceptions import UserError diff --git a/account_operating_unit/models/account_move.py b/account_operating_unit/models/account_move.py index c59c190df4..a6e75b185c 100644 --- a/account_operating_unit/models/account_move.py +++ b/account_operating_unit/models/account_move.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from odoo.tools.translate import _ from odoo import api, fields, models from odoo.exceptions import UserError @@ -114,7 +112,7 @@ def post(self): # Create balancing entries for un-balanced OU's. ou_balances = self._check_ou_balance(move) amls = [] - for ou_id in ou_balances.keys(): + for ou_id in list(ou_balances.keys()): # If the OU is already balanced, then do not continue if move.company_id.currency_id.is_zero(ou_balances[ou_id]): continue diff --git a/account_operating_unit/models/account_payment.py b/account_operating_unit/models/account_payment.py index 3dc2d1dcf1..c466f445a3 100644 --- a/account_operating_unit/models/account_payment.py +++ b/account_operating_unit/models/account_payment.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from odoo import api, fields, models, _ @@ -47,7 +45,7 @@ def _get_dst_liquidity_aml_dict_vals(self): if self.currency_id != self.company_id.currency_id: dst_liquidity_aml_dict.update({ 'currency_id': self.currency_id.id, - 'amount_currency': self.amount, + 'amount_currency': -self.amount, }) dst_liquidity_aml_dict.update({ @@ -62,11 +60,6 @@ def _get_transfer_debit_aml_dict_vals(self): 'account_id': self.company_id.transfer_account_id.id, 'journal_id': self.destination_journal_id.id } - if self.currency_id != self.company_id.currency_id: - transfer_debit_aml_dict.update({ - 'currency_id': self.currency_id.id, - 'amount_currency': -self.amount, - }) transfer_debit_aml_dict.update({ 'operating_unit_id': self.journal_id.operating_unit_id.id or False diff --git a/account_operating_unit/models/company.py b/account_operating_unit/models/company.py index f3c2b8ee0b..f007bb419f 100644 --- a/account_operating_unit/models/company.py +++ b/account_operating_unit/models/company.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from odoo import api, fields, models from odoo.tools.translate import _ from odoo.exceptions import UserError diff --git a/account_operating_unit/models/invoice.py b/account_operating_unit/models/invoice.py index 44b96c2f16..e6c6f9f7cd 100644 --- a/account_operating_unit/models/invoice.py +++ b/account_operating_unit/models/invoice.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from odoo import api, fields, models from odoo.exceptions import ValidationError from odoo.tools.translate import _ diff --git a/account_operating_unit/report/__init__.py b/account_operating_unit/report/__init__.py index 5be7018e74..828ca7dd4d 100644 --- a/account_operating_unit/report/__init__.py +++ b/account_operating_unit/report/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from . import account_invoice_report diff --git a/account_operating_unit/report/account_invoice_report.py b/account_operating_unit/report/account_invoice_report.py index c61958213a..8eec126a27 100644 --- a/account_operating_unit/report/account_invoice_report.py +++ b/account_operating_unit/report/account_invoice_report.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from odoo import fields, models diff --git a/account_operating_unit/tests/__init__.py b/account_operating_unit/tests/__init__.py index 9ef001663c..071cbac008 100644 --- a/account_operating_unit/tests/__init__.py +++ b/account_operating_unit/tests/__init__.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from . import test_account_operating_unit from . import test_invoice_operating_unit from . import test_cross_ou_journal_entry diff --git a/account_operating_unit/tests/test_account_operating_unit.py b/account_operating_unit/tests/test_account_operating_unit.py index e73ac94d56..c347d251c6 100644 --- a/account_operating_unit/tests/test_account_operating_unit.py +++ b/account_operating_unit/tests/test_account_operating_unit.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from odoo.addons.account.tests.account_test_classes import AccountingTestCase diff --git a/account_operating_unit/tests/test_cross_ou_journal_entry.py b/account_operating_unit/tests/test_cross_ou_journal_entry.py index 566cbab64c..6f03dfb686 100644 --- a/account_operating_unit/tests/test_cross_ou_journal_entry.py +++ b/account_operating_unit/tests/test_cross_ou_journal_entry.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from . import test_account_operating_unit as test_ou diff --git a/account_operating_unit/tests/test_invoice_operating_unit.py b/account_operating_unit/tests/test_invoice_operating_unit.py index b7f7a3b10a..9a8ca988f8 100644 --- a/account_operating_unit/tests/test_invoice_operating_unit.py +++ b/account_operating_unit/tests/test_invoice_operating_unit.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from . import test_account_operating_unit as test_ou diff --git a/account_operating_unit/tests/test_operating_unit_security.py b/account_operating_unit/tests/test_operating_unit_security.py index 17cd77b0cc..8cfc5ab232 100644 --- a/account_operating_unit/tests/test_operating_unit_security.py +++ b/account_operating_unit/tests/test_operating_unit_security.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + from . import test_account_operating_unit as test_ou diff --git a/account_operating_unit/tests/test_payment_operating_unit.py b/account_operating_unit/tests/test_payment_operating_unit.py index 13f9cf6a11..ed957457af 100644 --- a/account_operating_unit/tests/test_payment_operating_unit.py +++ b/account_operating_unit/tests/test_payment_operating_unit.py @@ -1,10 +1,7 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. -# © 2016 Serpent Consulting Services Pvt. Ltd. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -from odoo.addons.account_operating_unit.tests import ( + +from odoo.addons.account_operating_unit.tests import\ test_account_operating_unit as test_ou - ) # noqa import time @@ -29,9 +26,9 @@ def test_payment_from_invoice(self): 'payment_method_id': self.payment_method_manual_in.id }) - register_payments.create_payment() + register_payments.create_payments() payment = self.payment_model.search([], order="id desc", limit=1) - self.assertAlmostEquals(payment.amount, 115000) + self.assertAlmostEqual(payment.amount, 115000) self.assertEqual(payment.state, 'posted') self.assertEqual(self.invoice.state, 'paid') diff --git a/account_operating_unit/views/account_journal_view.xml b/account_operating_unit/views/account_journal_view.xml index a97bd68ff2..3893eff179 100644 --- a/account_operating_unit/views/account_journal_view.xml +++ b/account_operating_unit/views/account_journal_view.xml @@ -9,7 +9,8 @@ + groups="operating_unit.group_multi_operating_unit" + attrs="{'invisible':[('type','not in', ['bank', 'cash'])]}"/> diff --git a/account_operating_unit/views/account_move_view.xml b/account_operating_unit/views/account_move_view.xml index d881f0408a..22fd12770b 100644 --- a/account_operating_unit/views/account_move_view.xml +++ b/account_operating_unit/views/account_move_view.xml @@ -14,19 +14,6 @@ - - account.move.line.form2 - account.move.line - - - - - - - - account.move.line.tree account.move.line diff --git a/account_operating_unit/views/invoice_view.xml b/account_operating_unit/views/invoice_view.xml index b9bd6e866a..c6ebfd981f 100644 --- a/account_operating_unit/views/invoice_view.xml +++ b/account_operating_unit/views/invoice_view.xml @@ -46,7 +46,7 @@ - [('company_id', '=', parent.company_id), '|', ('operating_unit_ids', 'in', [operating_unit]), ('operating_unit_ids', '=', False)] + [('company_id', '=', parent.company_id), '|', ('operating_unit_ids', '=', context.get('operating_unit', False)), ('operating_unit_ids', '=', False)] @@ -54,7 +54,7 @@ - [('company_id', '=', parent.company_id), '|', ('operating_unit_ids', 'in', [operating_unit]), ('operating_unit_ids', '=', False)] + [('company_id', '=', parent.company_id), '|', ('operating_unit_ids', '=', context.get('operating_unit', False)), ('operating_unit_ids', '=', False)] @@ -75,7 +75,7 @@ - [('company_id', '=', parent.company_id), '|', ('operating_unit_ids', 'in', [operating_unit]), ('operating_unit_ids', '=', False)] + [('company_id', '=', parent.company_id), '|', ('operating_unit_ids', '=', context.get('operating_unit', False)), ('operating_unit_ids', '=', False)] diff --git a/account_operating_unit/views/report_agedpartnerbalance.xml b/account_operating_unit/views/report_agedpartnerbalance.xml index d8c6eced3d..0d3a36aa0a 100644 --- a/account_operating_unit/views/report_agedpartnerbalance.xml +++ b/account_operating_unit/views/report_agedpartnerbalance.xml @@ -3,8 +3,8 @@