From 196234c05eeced79b9cc2096dff6651b1ab6d645 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Mon, 30 Jan 2017 11:44:07 +0100 Subject: [PATCH] [10.0][account_operating_unit]Add support for cash basis. Migrate to v10 nomenclature (#55) * Add support for cash basis. Migrate to v10 nomenclature * Remove apply_taxes from the create method, as in v10 this parameter is not accepted in the created method --- account_operating_unit/models/account_journal.py | 4 ++-- account_operating_unit/models/account_move.py | 9 +++++---- account_operating_unit/models/account_payment.py | 2 +- account_operating_unit/models/company.py | 6 +++--- account_operating_unit/models/invoice.py | 6 +++--- account_operating_unit/report/account_invoice_report.py | 2 +- .../tests/test_payment_operating_unit.py | 2 +- .../wizard/account_financial_report.py | 2 +- account_operating_unit/wizard/account_report_common.py | 2 +- .../wizard/account_report_trial_balance.py | 2 +- 10 files changed, 19 insertions(+), 18 deletions(-) diff --git a/account_operating_unit/models/account_journal.py b/account_operating_unit/models/account_journal.py index 474473033c..aac87cb468 100644 --- a/account_operating_unit/models/account_journal.py +++ b/account_operating_unit/models/account_journal.py @@ -2,8 +2,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 openerp import api, fields, models, _ -from openerp.exceptions import UserError +from odoo import api, fields, models, _ +from odoo.exceptions import UserError class AccountJournal(models.Model): diff --git a/account_operating_unit/models/account_move.py b/account_operating_unit/models/account_move.py index 53b553785f..8c8680fde1 100644 --- a/account_operating_unit/models/account_move.py +++ b/account_operating_unit/models/account_move.py @@ -2,9 +2,9 @@ # © 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 openerp.tools.translate import _ -from openerp import api, fields, models -from openerp.exceptions import UserError +from odoo.tools.translate import _ +from odoo import api, fields, models +from odoo.exceptions import UserError class AccountMoveLine(models.Model): @@ -21,7 +21,8 @@ def create(self, vals): move = self.env['account.move'].browse(vals['move_id']) if move.operating_unit_id: vals['operating_unit_id'] = move.operating_unit_id.id - return super(AccountMoveLine, self).create(vals) + _super = super(AccountMoveLine, self) + return _super.create(vals) @api.model def _query_get(self, domain=None): diff --git a/account_operating_unit/models/account_payment.py b/account_operating_unit/models/account_payment.py index a6517b8534..9a7497459a 100644 --- a/account_operating_unit/models/account_payment.py +++ b/account_operating_unit/models/account_payment.py @@ -2,7 +2,7 @@ # © 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 openerp import api, fields, models, _ +from odoo import api, fields, models, _ class AccountPayment(models.Model): diff --git a/account_operating_unit/models/company.py b/account_operating_unit/models/company.py index 248d9eb0ec..f3c2b8ee0b 100644 --- a/account_operating_unit/models/company.py +++ b/account_operating_unit/models/company.py @@ -2,9 +2,9 @@ # © 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 openerp import api, fields, models -from openerp.tools.translate import _ -from openerp.exceptions import UserError +from odoo import api, fields, models +from odoo.tools.translate import _ +from odoo.exceptions import UserError class ResCompany(models.Model): diff --git a/account_operating_unit/models/invoice.py b/account_operating_unit/models/invoice.py index f442b24ff8..b67c0e5555 100644 --- a/account_operating_unit/models/invoice.py +++ b/account_operating_unit/models/invoice.py @@ -2,9 +2,9 @@ # © 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 openerp import api, fields, models -from openerp.exceptions import ValidationError -from openerp.tools.translate import _ +from odoo import api, fields, models +from odoo.exceptions import ValidationError +from odoo.tools.translate import _ class AccountInvoice(models.Model): diff --git a/account_operating_unit/report/account_invoice_report.py b/account_operating_unit/report/account_invoice_report.py index 24b35d43d9..c61958213a 100644 --- a/account_operating_unit/report/account_invoice_report.py +++ b/account_operating_unit/report/account_invoice_report.py @@ -2,7 +2,7 @@ # © 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 openerp import fields, models +from odoo import fields, models class AccountInvoiceReport(models.Model): diff --git a/account_operating_unit/tests/test_payment_operating_unit.py b/account_operating_unit/tests/test_payment_operating_unit.py index 7f0d65bda5..d6a8bee2f7 100644 --- a/account_operating_unit/tests/test_payment_operating_unit.py +++ b/account_operating_unit/tests/test_payment_operating_unit.py @@ -2,7 +2,7 @@ # © 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 openerp.addons.account_operating_unit.tests import\ +from odoo.addons.account_operating_unit.tests import\ test_account_operating_unit as test_ou import time diff --git a/account_operating_unit/wizard/account_financial_report.py b/account_operating_unit/wizard/account_financial_report.py index cf0cec4ede..defd7e4844 100644 --- a/account_operating_unit/wizard/account_financial_report.py +++ b/account_operating_unit/wizard/account_financial_report.py @@ -2,7 +2,7 @@ # © 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 openerp import fields, models +from odoo import fields, models class AccountingReport(models.TransientModel): diff --git a/account_operating_unit/wizard/account_report_common.py b/account_operating_unit/wizard/account_report_common.py index e345eeb640..835e8f5ba8 100644 --- a/account_operating_unit/wizard/account_report_common.py +++ b/account_operating_unit/wizard/account_report_common.py @@ -2,7 +2,7 @@ # © 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 openerp import fields, models +from odoo import fields, models class AccountCommonReport(models.TransientModel): diff --git a/account_operating_unit/wizard/account_report_trial_balance.py b/account_operating_unit/wizard/account_report_trial_balance.py index f38d759c60..b8bf6a31ac 100644 --- a/account_operating_unit/wizard/account_report_trial_balance.py +++ b/account_operating_unit/wizard/account_report_trial_balance.py @@ -2,7 +2,7 @@ # © 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 openerp import fields, models +from odoo import fields, models class AccountBalanceReport(models.TransientModel):