diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index ed63db6cd9..ea0f6d333e 100644 --- a/fieldservice_account/__manifest__.py +++ b/fieldservice_account/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Field Service - Accounting", "summary": "Track invoices linked to Field Service orders", - "version": "12.0.3.1.1", + "version": "13.0.1.0.0", "category": "Field Service", "author": "Open Source Integrators, Odoo Community Association (OCA)", "website": "https://github.com/OCA/field-service", diff --git a/fieldservice_account/models/account_invoice.py b/fieldservice_account/models/account_invoice.py index 6ef1e1900d..3c8a0652db 100644 --- a/fieldservice_account/models/account_invoice.py +++ b/fieldservice_account/models/account_invoice.py @@ -1,12 +1,12 @@ -# Copyright (C) 2018 - TODAY, Open Source Integrators +# Copyright (C) 2018, Open Source Integrators # Copyright 2019 Akretion # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, fields, models -class AccountInvoice(models.Model): - _inherit = "account.invoice" +class AccountMove(models.Model): + _inherit = "account.move" fsm_order_ids = fields.Many2many( "fsm.order", @@ -24,7 +24,6 @@ def _compute_fsm_order_count(self): for invoice in self: invoice.fsm_order_count = len(invoice.fsm_order_ids) - @api.multi def action_view_fsm_orders(self): action = self.env.ref("fieldservice.action_fsm_dash_order").read()[0] if self.fsm_order_count > 1: diff --git a/fieldservice_account/models/account_invoice_line.py b/fieldservice_account/models/account_invoice_line.py index 216d104ecc..574852ef01 100644 --- a/fieldservice_account/models/account_invoice_line.py +++ b/fieldservice_account/models/account_invoice_line.py @@ -4,7 +4,7 @@ from odoo import fields, models -class AccountInvoiceLine(models.Model): - _inherit = "account.invoice.line" +class AccountMoveLine(models.Model): + _inherit = "account.move.line" fsm_order_id = fields.Many2one("fsm.order", string="FSM Order") diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index b3b931285e..3cd58c84b0 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -7,7 +7,7 @@ class FSMOrder(models.Model): _inherit = "fsm.order" invoice_ids = fields.Many2many( - "account.invoice", + "account.move", "fsm_order_account_invoice_rel", "fsm_order_id", "invoice_id", @@ -22,12 +22,11 @@ def _compute_account_invoice_count(self): for order in self: order.invoice_count = len(order.invoice_ids) - @api.multi def action_view_invoices(self): - action = self.env.ref("account.action_invoice_tree").read()[0] + action = self.env.ref("account.action_move_out_invoice_type").read()[0] if self.invoice_count > 1: action["domain"] = [("id", "in", self.invoice_ids.ids)] elif self.invoice_ids: - action["views"] = [(self.env.ref("account.invoice_form").id, "form")] + action["views"] = [(self.env.ref("account.view_move_form").id, "form")] action["res_id"] = self.invoice_ids[0].id return action diff --git a/fieldservice_account/security/ir.model.access.csv b/fieldservice_account/security/ir.model.access.csv index f6792aef64..e8e0566f22 100644 --- a/fieldservice_account/security/ir.model.access.csv +++ b/fieldservice_account/security/ir.model.access.csv @@ -1,2 +1,2 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_account_invoice_line_fsm_user,account.invoice.line.fsm.user,model_account_invoice_line,fieldservice.group_fsm_user,1,1,1,1 +access_account_move_line_fsm_user,account.move.line.fsm.user,model_account_move_line,fieldservice.group_fsm_user,1,1,1,1 diff --git a/fieldservice_account/tests/test_fsm_account.py b/fieldservice_account/tests/test_fsm_account.py index dd703ed846..adc57bf95f 100644 --- a/fieldservice_account/tests/test_fsm_account.py +++ b/fieldservice_account/tests/test_fsm_account.py @@ -9,8 +9,8 @@ def setUp(self): super(FSMAccountCase, self).setUp() self.Wizard = self.env["fsm.wizard"] self.WorkOrder = self.env["fsm.order"] - self.AccountInvoice = self.env["account.invoice"] - self.AccountInvoiceLine = self.env["account.invoice.line"] + self.AccountInvoice = self.env["account.move"] + self.AccountInvoiceLine = self.env["account.move.line"] # create a Res Partner self.test_partner = self.env["res.partner"].create( {"name": "Test Partner", "phone": "123", "email": "tp@email.com"} diff --git a/fieldservice_account/views/account_invoice.xml b/fieldservice_account/views/account_invoice.xml index a3853ed00d..66f015779a 100644 --- a/fieldservice_account/views/account_invoice.xml +++ b/fieldservice_account/views/account_invoice.xml @@ -1,8 +1,8 @@ FSM order.invoice.form - account.invoice - + account.move +