From ee665a8a7eeb3ca1d68621b409f48f9e25c0586d Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Wed, 16 Jan 2019 11:22:28 -0700 Subject: [PATCH 01/99] [ADD] Beta implementation of fieldservice_account --- fieldservice_account/__init__.py | 4 + fieldservice_account/__manifest__.py | 29 ++ fieldservice_account/data/time_products.xml | 29 ++ fieldservice_account/models/__init__.py | 9 + .../models/account_invoice.py | 45 ++ .../models/analytic_account.py | 24 + fieldservice_account/models/fsm_location.py | 13 + fieldservice_account/models/fsm_order.py | 104 ++++ fieldservice_account/readme/CONFIGURE.rst | 2 + fieldservice_account/readme/CONTRIBUTORS.rst | 1 + fieldservice_account/readme/CREDITS.rst | 3 + fieldservice_account/readme/DESCRIPTION.rst | 4 + fieldservice_account/readme/INSTALL.rst | 1 + fieldservice_account/readme/USAGE.rst | 12 + .../static/description/icon.png | Bin 0 -> 17808 bytes .../static/description/index.html | 451 ++++++++++++++++++ fieldservice_account/views/fsm_location.xml | 18 + fieldservice_account/views/fsm_order.xml | 42 ++ 18 files changed, 791 insertions(+) create mode 100644 fieldservice_account/__init__.py create mode 100644 fieldservice_account/__manifest__.py create mode 100644 fieldservice_account/data/time_products.xml create mode 100644 fieldservice_account/models/__init__.py create mode 100644 fieldservice_account/models/account_invoice.py create mode 100644 fieldservice_account/models/analytic_account.py create mode 100644 fieldservice_account/models/fsm_location.py create mode 100644 fieldservice_account/models/fsm_order.py create mode 100644 fieldservice_account/readme/CONFIGURE.rst create mode 100644 fieldservice_account/readme/CONTRIBUTORS.rst create mode 100644 fieldservice_account/readme/CREDITS.rst create mode 100644 fieldservice_account/readme/DESCRIPTION.rst create mode 100644 fieldservice_account/readme/INSTALL.rst create mode 100644 fieldservice_account/readme/USAGE.rst create mode 100644 fieldservice_account/static/description/icon.png create mode 100644 fieldservice_account/static/description/index.html create mode 100644 fieldservice_account/views/fsm_location.xml create mode 100644 fieldservice_account/views/fsm_order.xml diff --git a/fieldservice_account/__init__.py b/fieldservice_account/__init__.py new file mode 100644 index 0000000000..631bd4893a --- /dev/null +++ b/fieldservice_account/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py new file mode 100644 index 0000000000..c01759d963 --- /dev/null +++ b/fieldservice_account/__manifest__.py @@ -0,0 +1,29 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Field Service - Accounting', + 'summary': 'Track employee time and invoice for Field Service Orders', + 'version': '11.0.0.0.1', + 'category': 'Field Service', + 'author': 'Open Source Integrators, Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/field-service', + 'depends': [ + 'fieldservice', + 'hr_timesheet', + 'analytic', + 'account', + 'product', + ], + 'data': [ + 'views/fsm_location.xml', + 'views/fsm_order.xml', + 'data/time_products.xml', + ], + 'application': False, + 'license': 'AGPL-3', + 'development_status': 'Beta', + 'maintainers': [ + 'osimallen', + ], +} diff --git a/fieldservice_account/data/time_products.xml b/fieldservice_account/data/time_products.xml new file mode 100644 index 0000000000..91a4940700 --- /dev/null +++ b/fieldservice_account/data/time_products.xml @@ -0,0 +1,29 @@ + + + + + FSM Travel Time + + service + + + Travel time for Field Service Employees + + + FSM Regular Time + + service + + + Regular time for Field Service Employees + + + FSM Overtime + + service + + + Overtime for Field Service Employees + + + diff --git a/fieldservice_account/models/__init__.py b/fieldservice_account/models/__init__.py new file mode 100644 index 0000000000..a1af9b159a --- /dev/null +++ b/fieldservice_account/models/__init__.py @@ -0,0 +1,9 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import ( + account_invoice, + analytic_account, + fsm_location, + fsm_order +) diff --git a/fieldservice_account/models/account_invoice.py b/fieldservice_account/models/account_invoice.py new file mode 100644 index 0000000000..9b09335304 --- /dev/null +++ b/fieldservice_account/models/account_invoice.py @@ -0,0 +1,45 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models +from odoo.exceptions import ValidationError + + +class AccountInvoiceLine(models.Model): + _inherit = "account.invoice.line" + + fsm_order_id = fields.Many2one('fsm.order', string='FSM Order') + + @api.model + def create(self, vals): + order = self.env['fsm.order'].browse(vals.get('fsm_order_id')) + if order: + if order.location_id.analytic_account_id: + vals['account_analytic_id'] = order.location_id.\ + analytic_account_id.id + else: + raise ValidationError("No analytic account" + + " set on the order's Location") + + return super().create(vals) + + @api.onchange('product_id', 'quantity') + def onchange_product_id(self): + for line in self: + if line.fsm_order_id: + partner = line.fsm_order_id.person_id.partner_id + fpos = partner.property_account_position_id + prices = partner.property_product_pricelist + tmpl = line.product_id.product_tmpl_id + if line.product_id: + accounts = tmpl.get_product_accounts() + cost = prices.get_product_price(product=line.product_id, + quantity=line.quantity, + partner=partner, + date=False, + uom_id=False) + line.price_unit = cost + line.account_id = accounts['expense'] + line.invoice_line_tax_ids = fpos.\ + map_tax(tmpl.supplier_taxes_id) + line.name = line.product_id.name diff --git a/fieldservice_account/models/analytic_account.py b/fieldservice_account/models/analytic_account.py new file mode 100644 index 0000000000..e73c057fe8 --- /dev/null +++ b/fieldservice_account/models/analytic_account.py @@ -0,0 +1,24 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models +from odoo.exceptions import ValidationError + + +class AccountAnalyticLine(models.Model): + _inherit = 'account.analytic.line' + + fsm_order_id = fields.Many2one('fsm.order', string='FSM Order') + product_id = fields.Many2one('product.product', string='Time Type') + + @api.model + def create(self, vals): + order = self.env['fsm.order'].browse(vals.get('fsm_order_id')) + if order: + if order.location_id.analytic_account_id: + vals['account_id'] = order.location_id.analytic_account_id.id + else: + raise ValidationError("No analytic account set " + + "on the order's Location") + + return super().create(vals) diff --git a/fieldservice_account/models/fsm_location.py b/fieldservice_account/models/fsm_location.py new file mode 100644 index 0000000000..4e6ba202bd --- /dev/null +++ b/fieldservice_account/models/fsm_location.py @@ -0,0 +1,13 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields + +from odoo.addons.base_geoengine import geo_model + + +class FSMLocation(geo_model.GeoModel): + _inherit = 'fsm.location' + + analytic_account_id = fields.Many2one('account.analytic.account', + string='Analytic Account') diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py new file mode 100644 index 0000000000..0d5f82f37d --- /dev/null +++ b/fieldservice_account/models/fsm_order.py @@ -0,0 +1,104 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields + +from odoo.addons.base_geoengine import geo_model + + +class FSMOrder(geo_model.GeoModel): + _inherit = 'fsm.order' + + contractor_cost_ids = fields.One2many('account.invoice.line', + 'fsm_order_id', + string='Contractor Costs') + employee_timesheet_ids = fields.One2many('account.analytic.line', + "fsm_order_id", + string='Employee Timesheets') + total_cost = fields.Float(compute='_compute_total_cost', + string='Total Cost') + + employee = fields.Boolean(compute='_compute_employee') + + def _compute_employee(self): + user = self.env['res.users'].browse(self.env.uid) + for order in self: + if user.employee_ids: + order.employee = True + + @api.depends('employee_timesheet_ids', 'contractor_cost_ids') + def _compute_total_cost(self): + for order in self: + order.total_cost = 0.0 + for line in order.employee_timesheet_ids: + for emp in line.user_id.employee_ids: + rate = emp.timesheet_cost + continue + order.total_cost += line.unit_amount * rate + for cost in order.contractor_cost_ids: + order.total_cost += cost.price_unit * cost.quantity + + def action_complete(self): + for order in self: + if order.contractor_cost_ids: + order._create_vendor_bill() + if order.employee_timesheet_ids: + order._create_customer_invoice() + return super().action_complete() + + def _create_vendor_bill(self): + jrnl = self.env['account.journal'].search([('type', '=', 'purchase'), + ('active', '=', True), ], + limit=1) + fpos = self.customer_id.property_account_position_id + vals = { + 'partner_id': self.person_id.partner_id.id, + 'type': 'in_invoice', + 'journal_id': jrnl.id or False, + 'fiscal_position_id': fpos.id or False + } + + bill = self.env['account.invoice'].sudo().create(vals) + for line in self.contractor_cost_ids: + line.invoice_id = bill + bill.compute_taxes() + + def _create_customer_invoice(self): + jrnl = self.env['account.journal'].search([('type', '=', 'sale'), + ('active', '=', True), ], + limit=1) + fpos = self.customer_id.property_account_position_id + vals = { + 'partner_id': self.customer_id.id, + 'type': 'out_invoice', + 'journal_id': jrnl.id or False, + 'fiscal_position_id': fpos.id or False + } + + invoice = self.env['account.invoice'].sudo().create(vals) + + for line in self.employee_timesheet_ids: + price_list = invoice.partner_id.property_product_pricelist + price = price_list.get_product_price(product=line.product_id, + quantity=line.unit_amount, + partner=invoice.partner_id, + date=False, + uom_id=False) + template = line.product_id.product_tmpl_id + accounts = template.get_product_accounts() + account = accounts['income'] + + vals = { + 'product_id': line.product_id.id, + 'account_analytic_id': line.account_id.id, + 'quantity': line.unit_amount, + 'name': line.name, + 'price_unit': price, + 'account_id': account.id, + 'invoice_id': invoice.id, + } + time_cost = self.env['account.invoice.line'].create(vals) + taxes = template.taxes_id + time_cost.invoice_line_tax_ids = fpos.map_tax(taxes) + time_cost.invoice_id = invoice + invoice.compute_taxes() diff --git a/fieldservice_account/readme/CONFIGURE.rst b/fieldservice_account/readme/CONFIGURE.rst new file mode 100644 index 0000000000..d0cc8207cf --- /dev/null +++ b/fieldservice_account/readme/CONFIGURE.rst @@ -0,0 +1,2 @@ +No configuration is necessary for this module + diff --git a/fieldservice_account/readme/CONTRIBUTORS.rst b/fieldservice_account/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..0cb97e90a4 --- /dev/null +++ b/fieldservice_account/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Michael Allen diff --git a/fieldservice_account/readme/CREDITS.rst b/fieldservice_account/readme/CREDITS.rst new file mode 100644 index 0000000000..0eff0acf4e --- /dev/null +++ b/fieldservice_account/readme/CREDITS.rst @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +* Open Source Integrators diff --git a/fieldservice_account/readme/DESCRIPTION.rst b/fieldservice_account/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..127d578738 --- /dev/null +++ b/fieldservice_account/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module adds the ability to track employee time and contractor +costs for Field Service Orders. It also adds functionality to create +a customer invoice and a vendor bill when a Field Service Order is +completed. diff --git a/fieldservice_account/readme/INSTALL.rst b/fieldservice_account/readme/INSTALL.rst new file mode 100644 index 0000000000..54fea7becb --- /dev/null +++ b/fieldservice_account/readme/INSTALL.rst @@ -0,0 +1 @@ +No special installation instructions diff --git a/fieldservice_account/readme/USAGE.rst b/fieldservice_account/readme/USAGE.rst new file mode 100644 index 0000000000..9d51edb5f2 --- /dev/null +++ b/fieldservice_account/readme/USAGE.rst @@ -0,0 +1,12 @@ +To use the module: + +On a field service order, open the "Accounting" tab. Depending on +whether the logged in user or an employee or not, they will see +either a place to enter timesheet records or contractor costs. + +The total cost of the order is calculated based on the entries in +the employee timesheet entries and contractor costs. + +When an order is completed, a customer invoice will be generated for +the employee time and the contractor costs. A vendor bill will be +created for the contractor costs. diff --git a/fieldservice_account/static/description/icon.png b/fieldservice_account/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..955674d8f0b8c47de3ffa9db25cb109fbe4a1091 GIT binary patch literal 17808 zcmeHvc;{H3sucZElF-G)hC-+rdy@|cVP3o7ETY&& zJl-5>)T;P#Y>Z2k74p9gK&J2CJC5%@{WsV@`$(=#w|Cf>44L@opuIqTY_XMpYif9< zJEhZ)*(Ciawd2E4g!g{`tf-6DV*W@FZ!b&?uih_mMpBM%8|x61r3D=Pkjl)*LT52YNq;hIj5|udFA)RjvAIV zR;k3*$i5qSsi6bcd50k9_J$d6qZe5$CLIT#a*i*=wkVz%dgiqH(oe=68=3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KhW?Nd85wzJlx#0ijShXJW?6qNFT5WHgX*`4 znAw6(otBnuX*CHI7J32YAFrpeFe*%n?tiX`q=R&agxqy8y^(5Q$_ZB`XM!tI*GZbX z(X#_0LZp6h^6*3~mEHhT0b`4Yup6AXVlpn+Q7tknyZpxvuEohyH{$F=!8mZnEQAjI zQ46(s-Yaz;wNUgv&W5ThKB{W3(9dUm{iObJMRL?`A=vQt%jg)l{#&O4GI+#Kwjew0nySosF+@T>xBYngWHD;bxF;7b-%>cT74(~!j za)0gM!|>0eyS75X+B()YfAk)l$Phu_s10UQ8K<;`o;##M&SgtTuC$&4T{~TLYh~dK zLm$LxbZ^z;{Wl*6GW5?iFeeetYLG-nRdM6TR)K?1<#+hD&;m{|(ME|BrHBci#pV0oF(@prIFR=LEDdC|` z$6e@>ZBk~p1x{c}1ap=W1^2W?Z=AMy=;mO76+#5-nyl4XmK<5P7YCL|M_(NIF>`>^ z*RLK*lO8nwDMbFyjM$-Z6Jc-2q&bOb^^g1dhQG`X-*=g!K5kpSk08tH`uba$AEu(3 gUHh>HCdQ7*k1fAW1vhU(MTsEtw^U^Fq)ngxAO8EYHUIzs literal 0 HcmV?d00001 diff --git a/fieldservice_account/static/description/index.html b/fieldservice_account/static/description/index.html new file mode 100644 index 0000000000..8008c0e9ff --- /dev/null +++ b/fieldservice_account/static/description/index.html @@ -0,0 +1,451 @@ + + + + + + +Field Service - Distribution + + + +
+

Field Service - Distribution

+ + +

Beta License: AGPL-3 OCA/field-service Translate me on Weblate Try me on Runbot

+

This module allows you to manage your distribution network (of water, +electricity, gaz, telephone, bandwidth) by setting the distribution parent on a +field service location.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  • Go to Field Service > Master Data > Locations
  • +
  • Create or select a location
  • +
  • In the ???Others??? tab, you can set a location as a distribution location
  • +
  • On another location, below the Parent location, you can set the parent +distribution location that distributes to the current location
  • +
+
+
+

Known issues / Roadmap

+

The roadmap of the Field Service application is documented on +Github.

+
+
+

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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Open Source Integrators
  • +
+
+ +
+

Other credits

+

The development of this module has been financially supported by:

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainer:

+

max3903

+

This module is part of the OCA/field-service project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/fieldservice_account/views/fsm_location.xml b/fieldservice_account/views/fsm_location.xml new file mode 100644 index 0000000000..410f797e34 --- /dev/null +++ b/fieldservice_account/views/fsm_location.xml @@ -0,0 +1,18 @@ + + + + + fsm.location.form.accounting + fsm.location + + + + + + + + + + + + diff --git a/fieldservice_account/views/fsm_order.xml b/fieldservice_account/views/fsm_order.xml new file mode 100644 index 0000000000..052e775fa8 --- /dev/null +++ b/fieldservice_account/views/fsm_order.xml @@ -0,0 +1,42 @@ + + + + fsm.order.form.accounting + fsm.order + + {'default_fsm_order_id':active_id} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 617d20ba5f72044f2747e854d7594133003c00fe Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Wed, 16 Jan 2019 11:46:33 -0700 Subject: [PATCH 02/99] [FIX]PYLint errors --- fieldservice_account/models/fsm_order.py | 34 ++++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index 0d5f82f37d..8f5027f701 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -52,11 +52,11 @@ def _create_vendor_bill(self): limit=1) fpos = self.customer_id.property_account_position_id vals = { - 'partner_id': self.person_id.partner_id.id, - 'type': 'in_invoice', - 'journal_id': jrnl.id or False, - 'fiscal_position_id': fpos.id or False - } + 'partner_id': self.person_id.partner_id.id, + 'type': 'in_invoice', + 'journal_id': jrnl.id or False, + 'fiscal_position_id': fpos.id or False + } bill = self.env['account.invoice'].sudo().create(vals) for line in self.contractor_cost_ids: @@ -69,11 +69,11 @@ def _create_customer_invoice(self): limit=1) fpos = self.customer_id.property_account_position_id vals = { - 'partner_id': self.customer_id.id, - 'type': 'out_invoice', - 'journal_id': jrnl.id or False, - 'fiscal_position_id': fpos.id or False - } + 'partner_id': self.customer_id.id, + 'type': 'out_invoice', + 'journal_id': jrnl.id or False, + 'fiscal_position_id': fpos.id or False + } invoice = self.env['account.invoice'].sudo().create(vals) @@ -89,13 +89,13 @@ def _create_customer_invoice(self): account = accounts['income'] vals = { - 'product_id': line.product_id.id, - 'account_analytic_id': line.account_id.id, - 'quantity': line.unit_amount, - 'name': line.name, - 'price_unit': price, - 'account_id': account.id, - 'invoice_id': invoice.id, + 'product_id': line.product_id.id, + 'account_analytic_id': line.account_id.id, + 'quantity': line.unit_amount, + 'name': line.name, + 'price_unit': price, + 'account_id': account.id, + 'invoice_id': invoice.id, } time_cost = self.env['account.invoice.line'].create(vals) taxes = template.taxes_id From 2fe88623f518c6baafdec878bb30f1ccd16b3759 Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Thu, 17 Jan 2019 10:28:29 -0700 Subject: [PATCH 03/99] [ENH]Fixed issues from Max's review and implemented feedback changes --- fieldservice_account/README.rst | 120 ++++++++++++++++++ fieldservice_account/__manifest__.py | 1 + .../models/account_invoice.py | 8 +- .../models/analytic_account.py | 2 +- fieldservice_account/models/fsm_order.py | 58 +++++++-- fieldservice_account/readme/CONFIGURE.rst | 4 +- .../static/description/index.html | 84 ++++++------ .../views/account_invoice_view.xml | 24 ++++ fieldservice_account/views/fsm_order.xml | 10 +- 9 files changed, 259 insertions(+), 52 deletions(-) create mode 100644 fieldservice_account/README.rst create mode 100644 fieldservice_account/views/account_invoice_view.xml diff --git a/fieldservice_account/README.rst b/fieldservice_account/README.rst new file mode 100644 index 0000000000..213359e7ba --- /dev/null +++ b/fieldservice_account/README.rst @@ -0,0 +1,120 @@ +========================== +Field Service - Accounting +========================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github + :target: https://github.com/OCA/field-service/tree/11.0/fieldservice_account + :alt: OCA/field-service +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/field-service-11-0/field-service-11-0-fieldservice_account + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/264/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds the ability to track employee time and contractor +costs for Field Service Orders. It also adds functionality to create +a customer invoice and a vendor bill when a Field Service Order is +completed. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +No special installation instructions + +Configuration +============= + +To configure this module, you need to: + +* Go to Field Service > Master Data > Locations +* Create or select a location and set their analytic account + +Usage +===== + +To use the module: + +On a field service order, open the "Accounting" tab. Depending on +whether the logged in user or an employee or not, they will see +either a place to enter timesheet records or contractor costs. + +The total cost of the order is calculated based on the entries in +the employee timesheet entries and contractor costs. + +When an order is completed, a customer invoice will be generated for +the employee time and the contractor costs. A vendor bill will be +created for the contractor costs. + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Open Source Integrators + +Contributors +~~~~~~~~~~~~ + +* Michael Allen + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Open Source Integrators + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +.. |maintainer-osimallen| image:: https://github.com/osimallen.png?size=40px + :target: https://github.com/osimallen + :alt: osimallen + +Current `maintainer `__: + +|maintainer-osimallen| + +This module is part of the `OCA/field-service `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index c01759d963..f58bbb0228 100644 --- a/fieldservice_account/__manifest__.py +++ b/fieldservice_account/__manifest__.py @@ -19,6 +19,7 @@ 'views/fsm_location.xml', 'views/fsm_order.xml', 'data/time_products.xml', + 'views/account_invoice_view.xml', ], 'application': False, 'license': 'AGPL-3', diff --git a/fieldservice_account/models/account_invoice.py b/fieldservice_account/models/account_invoice.py index 9b09335304..a0276d738e 100644 --- a/fieldservice_account/models/account_invoice.py +++ b/fieldservice_account/models/account_invoice.py @@ -5,6 +5,12 @@ from odoo.exceptions import ValidationError +class AccountInvoice(models.Model): + _inherit = "account.invoice" + + fsm_order_id = fields.Many2one('fsm.order', string='FSM Order') + + class AccountInvoiceLine(models.Model): _inherit = "account.invoice.line" @@ -21,7 +27,7 @@ def create(self, vals): raise ValidationError("No analytic account" + " set on the order's Location") - return super().create(vals) + return super(AccountInvoiceLine, self).create(vals) @api.onchange('product_id', 'quantity') def onchange_product_id(self): diff --git a/fieldservice_account/models/analytic_account.py b/fieldservice_account/models/analytic_account.py index e73c057fe8..0baec34a07 100644 --- a/fieldservice_account/models/analytic_account.py +++ b/fieldservice_account/models/analytic_account.py @@ -21,4 +21,4 @@ def create(self, vals): raise ValidationError("No analytic account set " + "on the order's Location") - return super().create(vals) + return super(AccountAnalyticLine, self).create(vals) diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index 8f5027f701..ef19488cc0 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -17,8 +17,12 @@ class FSMOrder(geo_model.GeoModel): string='Employee Timesheets') total_cost = fields.Float(compute='_compute_total_cost', string='Total Cost') - employee = fields.Boolean(compute='_compute_employee') + is_billable = fields.Boolean(string='Bill Customer?') + contractor_total = fields.Float(compute='_compute_contractor_cost', + string='Contractor Cost Estimate') + employee_time_total = fields.Float(compute='_compute_employee_hours', + string='Total Employee Hours') def _compute_employee(self): user = self.env['res.users'].browse(self.env.uid) @@ -38,13 +42,28 @@ def _compute_total_cost(self): for cost in order.contractor_cost_ids: order.total_cost += cost.price_unit * cost.quantity + @api.depends('employee_timesheet_ids') + def _compute_employee_hours(self): + for order in self: + order.employee_time_total = 0.0 + for line in order.employee_timesheet_ids: + order.employee_time_total += line.unit_amount + + @api.depends('contractor_cost_ids') + def _compute_contractor_cost(self): + for order in self: + order.contractor_total = 0.0 + for cost in order.contractor_cost_ids: + order.contractor_total += cost.price_unit * cost.quantity + def action_complete(self): for order in self: - if order.contractor_cost_ids: + contractor = order.person_id.partner_id.supplier + if order.contractor_cost_ids and contractor: order._create_vendor_bill() - if order.employee_timesheet_ids: + if order.is_billable: order._create_customer_invoice() - return super().action_complete() + return super(FSMOrder, self).action_complete() def _create_vendor_bill(self): jrnl = self.env['account.journal'].search([('type', '=', 'purchase'), @@ -55,7 +74,8 @@ def _create_vendor_bill(self): 'partner_id': self.person_id.partner_id.id, 'type': 'in_invoice', 'journal_id': jrnl.id or False, - 'fiscal_position_id': fpos.id or False + 'fiscal_position_id': fpos.id or False, + 'fsm_order_id': self.id } bill = self.env['account.invoice'].sudo().create(vals) @@ -72,13 +92,14 @@ def _create_customer_invoice(self): 'partner_id': self.customer_id.id, 'type': 'out_invoice', 'journal_id': jrnl.id or False, - 'fiscal_position_id': fpos.id or False + 'fiscal_position_id': fpos.id or False, + 'fsm_order_id': self.id } invoice = self.env['account.invoice'].sudo().create(vals) + price_list = invoice.partner_id.property_product_pricelist for line in self.employee_timesheet_ids: - price_list = invoice.partner_id.property_product_pricelist price = price_list.get_product_price(product=line.product_id, quantity=line.unit_amount, partner=invoice.partner_id, @@ -100,5 +121,26 @@ def _create_customer_invoice(self): time_cost = self.env['account.invoice.line'].create(vals) taxes = template.taxes_id time_cost.invoice_line_tax_ids = fpos.map_tax(taxes) - time_cost.invoice_id = invoice + for cost in self.contractor_cost_ids: + price = price_list.get_product_price(product=cost.product_id, + quantity=cost.quantity, + partner=invoice.partner_id, + date=False, + uom_id=False) + template = cost.product_id.product_tmpl_id + accounts = template.get_product_accounts() + account = accounts['income'] + + vals = { + 'product_id': cost.product_id.id, + 'account_analytic_id': cost.account_analytic_id.id, + 'quantity': cost.quantity, + 'name': cost.name, + 'price_unit': price, + 'account_id': account.id, + 'invoice_id': invoice.id, + } + con_cost = self.env['account.invoice.line'].create(vals) + taxes = template.taxes_id + con_cost.invoice_line_tax_ids = fpos.map_tax(taxes) invoice.compute_taxes() diff --git a/fieldservice_account/readme/CONFIGURE.rst b/fieldservice_account/readme/CONFIGURE.rst index d0cc8207cf..ecc5d5f7a7 100644 --- a/fieldservice_account/readme/CONFIGURE.rst +++ b/fieldservice_account/readme/CONFIGURE.rst @@ -1,2 +1,4 @@ -No configuration is necessary for this module +To configure this module, you need to: +* Go to Field Service > Master Data > Locations +* Create or select a location and set their analytic account diff --git a/fieldservice_account/static/description/index.html b/fieldservice_account/static/description/index.html index 8008c0e9ff..af81833fe1 100644 --- a/fieldservice_account/static/description/index.html +++ b/fieldservice_account/static/description/index.html @@ -4,7 +4,7 @@ -Field Service - Distribution +Field Service - Accounting -
-

Field Service - Distribution

+
+

Field Service - Accounting

-

Beta License: AGPL-3 OCA/field-service Translate me on Weblate Try me on Runbot

-

This module allows you to manage your distribution network (of water, -electricity, gaz, telephone, bandwidth) by setting the distribution parent on a -field service location.

+

Beta License: AGPL-3 OCA/field-service Translate me on Weblate Try me on Runbot

+

This module adds the ability to track employee time and contractor +costs for Field Service Orders. It also adds functionality to create +a customer invoice and a vendor bill when a Field Service Order is +completed.

Table of contents

-
-

Usage

-

To use this module, you need to:

+
+

Installation

+

No special installation instructions

+
+
+

Configuration

+

To configure this module, you need to:

  • Go to Field Service > Master Data > Locations
  • -
  • Create or select a location
  • -
  • In the ???Others??? tab, you can set a location as a distribution location
  • -
  • On another location, below the Parent location, you can set the parent -distribution location that distributes to the current location
  • +
  • Create or select a location and set their analytic account
-
-

Known issues / Roadmap

-

The roadmap of the Field Service application is documented on -Github.

+
+

Usage

+

To use the module:

+

On a field service order, open the ???Accounting??? tab. Depending on +whether the logged in user or an employee or not, they will see +either a place to enter timesheet records or contractor costs.

+

The total cost of the order is calculated based on the entries in +the employee timesheet entries and contractor costs.

+

When an order is completed, a customer invoice will be generated for +the employee time and the contractor costs. A vendor bill will be +created for the contractor costs.

-

Bug Tracker

+

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.

+feedback.

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Open Source Integrators
-

Other credits

+

Other credits

The development of this module has been financially supported by:

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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.

Current maintainer:

-

max3903

-

This module is part of the OCA/field-service project on GitHub.

+

osimallen

+

This module is part of the OCA/field-service project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/fieldservice_account/views/account_invoice_view.xml b/fieldservice_account/views/account_invoice_view.xml new file mode 100644 index 0000000000..59804c6ced --- /dev/null +++ b/fieldservice_account/views/account_invoice_view.xml @@ -0,0 +1,24 @@ + + + + account.invoice.form + account.invoice + + + + + + + + + + account.invoice.form + account.invoice + + + + + + + + diff --git a/fieldservice_account/views/fsm_order.xml b/fieldservice_account/views/fsm_order.xml index 052e775fa8..c809b03aa4 100644 --- a/fieldservice_account/views/fsm_order.xml +++ b/fieldservice_account/views/fsm_order.xml @@ -9,7 +9,7 @@ - + @@ -20,6 +20,7 @@ + @@ -32,11 +33,14 @@ - + + + + + - \ No newline at end of file From 3f43ed109b9f1797055d1dba28b7db9d368cb536 Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Thu, 17 Jan 2019 13:34:07 -0700 Subject: [PATCH 04/99] [FIX] PyLint Errors --- fieldservice_account/models/account_invoice.py | 6 +++--- fieldservice_account/models/analytic_account.py | 6 +++--- fieldservice_account/views/account_invoice_view.xml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fieldservice_account/models/account_invoice.py b/fieldservice_account/models/account_invoice.py index a0276d738e..40e8ff5f97 100644 --- a/fieldservice_account/models/account_invoice.py +++ b/fieldservice_account/models/account_invoice.py @@ -1,7 +1,7 @@ # Copyright (C) 2018 - TODAY, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models +from odoo import api, fields, models, _ from odoo.exceptions import ValidationError @@ -24,8 +24,8 @@ def create(self, vals): vals['account_analytic_id'] = order.location_id.\ analytic_account_id.id else: - raise ValidationError("No analytic account" + - " set on the order's Location") + raise ValidationError(_("No analytic account" + + " set on the order's Location")) return super(AccountInvoiceLine, self).create(vals) diff --git a/fieldservice_account/models/analytic_account.py b/fieldservice_account/models/analytic_account.py index 0baec34a07..5388f0b7f9 100644 --- a/fieldservice_account/models/analytic_account.py +++ b/fieldservice_account/models/analytic_account.py @@ -1,7 +1,7 @@ # Copyright (C) 2018 - TODAY, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models +from odoo import api, fields, models, _ from odoo.exceptions import ValidationError @@ -18,7 +18,7 @@ def create(self, vals): if order.location_id.analytic_account_id: vals['account_id'] = order.location_id.analytic_account_id.id else: - raise ValidationError("No analytic account set " + - "on the order's Location") + raise ValidationError(_("No analytic account set " + + "on the order's Location")) return super(AccountAnalyticLine, self).create(vals) diff --git a/fieldservice_account/views/account_invoice_view.xml b/fieldservice_account/views/account_invoice_view.xml index 59804c6ced..7da3c8b1f2 100644 --- a/fieldservice_account/views/account_invoice_view.xml +++ b/fieldservice_account/views/account_invoice_view.xml @@ -1,7 +1,7 @@ - - account.invoice.form + + account.invoice.form.fsm.contractor account.invoice @@ -11,8 +11,8 @@ - - account.invoice.form + + account.invoice.form.fsm.customer account.invoice From 5182471da443874667340c9cc73be0d707223aa5 Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Fri, 18 Jan 2019 12:52:21 -0700 Subject: [PATCH 05/99] [FIX]Minor fixes to views and data --- fieldservice_account/data/time_products.xml | 6 +++--- fieldservice_account/views/fsm_location.xml | 6 ++++-- fieldservice_account/views/fsm_order.xml | 5 ++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fieldservice_account/data/time_products.xml b/fieldservice_account/data/time_products.xml index 91a4940700..c78d8894d1 100644 --- a/fieldservice_account/data/time_products.xml +++ b/fieldservice_account/data/time_products.xml @@ -3,7 +3,7 @@ FSM Travel Time - + service @@ -11,7 +11,7 @@ FSM Regular Time - + service @@ -19,7 +19,7 @@ FSM Overtime - + service diff --git a/fieldservice_account/views/fsm_location.xml b/fieldservice_account/views/fsm_location.xml index 410f797e34..bead4f1d56 100644 --- a/fieldservice_account/views/fsm_location.xml +++ b/fieldservice_account/views/fsm_location.xml @@ -8,8 +8,10 @@ - - + + + + diff --git a/fieldservice_account/views/fsm_order.xml b/fieldservice_account/views/fsm_order.xml index c809b03aa4..cbcbfd56a0 100644 --- a/fieldservice_account/views/fsm_order.xml +++ b/fieldservice_account/views/fsm_order.xml @@ -21,7 +21,7 @@ - + @@ -33,8 +33,7 @@ - - + From d2a549e4ba375869aadb0c968175c0608ae9b6ad Mon Sep 17 00:00:00 2001 From: Sandip Mangukiya Date: Sat, 19 Jan 2019 06:58:00 -0800 Subject: [PATCH 06/99] [FIX]add validation while adding contractor cost values without providing field service person --- fieldservice_account/models/account_invoice.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fieldservice_account/models/account_invoice.py b/fieldservice_account/models/account_invoice.py index 40e8ff5f97..db9dae898b 100644 --- a/fieldservice_account/models/account_invoice.py +++ b/fieldservice_account/models/account_invoice.py @@ -33,7 +33,10 @@ def create(self, vals): def onchange_product_id(self): for line in self: if line.fsm_order_id: - partner = line.fsm_order_id.person_id.partner_id + partner = line.fsm_order_id.person_id and\ + line.fsm_order_id.person_id.partner_id or False + if not partner: + raise ValidationError(_("Please set field service person")) fpos = partner.property_account_position_id prices = partner.property_product_pricelist tmpl = line.product_id.product_tmpl_id From 1c9c6218db2ad00a06712d61e9359e980d8691a3 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Thu, 31 Jan 2019 10:37:43 -0600 Subject: [PATCH 07/99] [IMP] fieldservice_account --- fieldservice_account/__manifest__.py | 6 ++-- fieldservice_account/models/fsm_order.py | 28 ++++++++++++----- fieldservice_account/views/account.xml | 30 +++++++++++++++++++ .../views/account_invoice_view.xml | 3 +- fieldservice_account/views/fsm_order.xml | 24 ++++++++++++--- 5 files changed, 76 insertions(+), 15 deletions(-) create mode 100644 fieldservice_account/views/account.xml diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index f58bbb0228..ec3b57552b 100644 --- a/fieldservice_account/__manifest__.py +++ b/fieldservice_account/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Field Service - Accounting', 'summary': 'Track employee time and invoice for Field Service Orders', - 'version': '11.0.0.0.1', + 'version': '11.0.0.1.0', 'category': 'Field Service', 'author': 'Open Source Integrators, Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/field-service', @@ -16,12 +16,12 @@ 'product', ], 'data': [ + 'data/time_products.xml', + 'views/account.xml', 'views/fsm_location.xml', 'views/fsm_order.xml', - 'data/time_products.xml', 'views/account_invoice_view.xml', ], - 'application': False, 'license': 'AGPL-3', 'development_status': 'Beta', 'maintainers': [ diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index ef19488cc0..d1b2088393 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -5,6 +5,12 @@ from odoo.addons.base_geoengine import geo_model +ACCOUNT_STAGES = [('draft', 'Draft'), + ('review', 'Needs Review'), + ('confirmed', 'Confirmed'), + ('invoiced', 'Fully Invoiced'), + ('no', 'Nothing Invoiced')] + class FSMOrder(geo_model.GeoModel): _inherit = 'fsm.order' @@ -18,11 +24,13 @@ class FSMOrder(geo_model.GeoModel): total_cost = fields.Float(compute='_compute_total_cost', string='Total Cost') employee = fields.Boolean(compute='_compute_employee') - is_billable = fields.Boolean(string='Bill Customer?') contractor_total = fields.Float(compute='_compute_contractor_cost', string='Contractor Cost Estimate') employee_time_total = fields.Float(compute='_compute_employee_hours', string='Total Employee Hours') + account_stage = fields.Selection(ACCOUNT_STAGES, string='State', + default='draft', required=True, + readonly=True, store=True) def _compute_employee(self): user = self.env['res.users'].browse(self.env.uid) @@ -60,14 +68,13 @@ def action_complete(self): for order in self: contractor = order.person_id.partner_id.supplier if order.contractor_cost_ids and contractor: - order._create_vendor_bill() - if order.is_billable: - order._create_customer_invoice() + order.create_bills() + order.account_stage = 'review' return super(FSMOrder, self).action_complete() - def _create_vendor_bill(self): + def create_bills(self): jrnl = self.env['account.journal'].search([('type', '=', 'purchase'), - ('active', '=', True), ], + ('active', '=', True), ], limit=1) fpos = self.customer_id.property_account_position_id vals = { @@ -83,7 +90,10 @@ def _create_vendor_bill(self): line.invoice_id = bill bill.compute_taxes() - def _create_customer_invoice(self): + def account_confirm(self): + self.account_stage = 'confirmed' + + def account_create_invoice(self): jrnl = self.env['account.journal'].search([('type', '=', 'sale'), ('active', '=', True), ], limit=1) @@ -144,3 +154,7 @@ def _create_customer_invoice(self): taxes = template.taxes_id con_cost.invoice_line_tax_ids = fpos.map_tax(taxes) invoice.compute_taxes() + self.account_stage = 'invoiced' + + def account_no_invoice(self): + self.account_stage = 'no' diff --git a/fieldservice_account/views/account.xml b/fieldservice_account/views/account.xml new file mode 100644 index 0000000000..2dd6e6da23 --- /dev/null +++ b/fieldservice_account/views/account.xml @@ -0,0 +1,30 @@ + + + + + + Service Orders + fsm.order + form + tree,form + + +

+ No Field Service Orders to review. +

+
+
+ + + + + +
diff --git a/fieldservice_account/views/account_invoice_view.xml b/fieldservice_account/views/account_invoice_view.xml index 7da3c8b1f2..9404183a88 100644 --- a/fieldservice_account/views/account_invoice_view.xml +++ b/fieldservice_account/views/account_invoice_view.xml @@ -1,4 +1,4 @@ - + account.invoice.form.fsm.contractor @@ -21,4 +21,5 @@
+
diff --git a/fieldservice_account/views/fsm_order.xml b/fieldservice_account/views/fsm_order.xml index cbcbfd56a0..29c6a5f077 100644 --- a/fieldservice_account/views/fsm_order.xml +++ b/fieldservice_account/views/fsm_order.xml @@ -1,4 +1,4 @@ - + fsm.order.form.accounting @@ -6,8 +6,27 @@ {'default_fsm_order_id':active_id} + +
+ +
@@ -37,9 +56,6 @@
- - -
From 6b6c9c978d5d2f0fc9fb99940950c9704bf6dce7 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Fri, 1 Feb 2019 19:02:49 -0600 Subject: [PATCH 08/99] [FIX] fieldservice_account --- fieldservice_account/__manifest__.py | 2 +- fieldservice_account/models/account_invoice.py | 3 ++- fieldservice_account/models/fsm_order.py | 9 +++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index ec3b57552b..4969e72a7f 100644 --- a/fieldservice_account/__manifest__.py +++ b/fieldservice_account/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Field Service - Accounting', 'summary': 'Track employee time and invoice for Field Service Orders', - 'version': '11.0.0.1.0', + 'version': '11.0.0.2.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 db9dae898b..1254e638ee 100644 --- a/fieldservice_account/models/account_invoice.py +++ b/fieldservice_account/models/account_invoice.py @@ -36,7 +36,8 @@ def onchange_product_id(self): partner = line.fsm_order_id.person_id and\ line.fsm_order_id.person_id.partner_id or False if not partner: - raise ValidationError(_("Please set field service person")) + raise ValidationError( + _("Please set the field service worker")) fpos = partner.property_account_position_id prices = partner.property_product_pricelist tmpl = line.product_id.product_tmpl_id diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index d1b2088393..043be19544 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -66,9 +66,6 @@ def _compute_contractor_cost(self): def action_complete(self): for order in self: - contractor = order.person_id.partner_id.supplier - if order.contractor_cost_ids and contractor: - order.create_bills() order.account_stage = 'review' return super(FSMOrder, self).action_complete() @@ -91,7 +88,11 @@ def create_bills(self): bill.compute_taxes() def account_confirm(self): - self.account_stage = 'confirmed' + for order in self: + contractor = order.person_id.partner_id.supplier + if order.contractor_cost_ids and contractor: + order.create_bills() + order.account_stage = 'confirmed' def account_create_invoice(self): jrnl = self.env['account.journal'].search([('type', '=', 'sale'), From 2ae7f7fe96ff26c97e97dba26f146f9af9be43d3 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Fri, 8 Feb 2019 00:09:16 -0600 Subject: [PATCH 09/99] [FIX] No context field on ir.ui.view --- fieldservice_account/views/fsm_order.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/fieldservice_account/views/fsm_order.xml b/fieldservice_account/views/fsm_order.xml index 29c6a5f077..e6b96c6e49 100644 --- a/fieldservice_account/views/fsm_order.xml +++ b/fieldservice_account/views/fsm_order.xml @@ -4,7 +4,6 @@ fsm.order.form.accounting fsm.order - {'default_fsm_order_id':active_id}
+
From b207a14dcf6d7237a8b67a278d8b0dc4c9ee6d23 Mon Sep 17 00:00:00 2001 From: scampbell Date: Fri, 15 Mar 2019 18:29:16 -0700 Subject: [PATCH 13/99] [ADD] fieldservice_account: Vendor Bills Smart Button --- fieldservice_account/__manifest__.py | 1 + fieldservice_account/models/__init__.py | 3 ++- fieldservice_account/models/fsm_person.py | 33 +++++++++++++++++++++++ fieldservice_account/views/fsm_person.xml | 22 +++++++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 fieldservice_account/models/fsm_person.py create mode 100644 fieldservice_account/views/fsm_person.xml diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index 4969e72a7f..d32fef9111 100644 --- a/fieldservice_account/__manifest__.py +++ b/fieldservice_account/__manifest__.py @@ -20,6 +20,7 @@ 'views/account.xml', 'views/fsm_location.xml', 'views/fsm_order.xml', + 'views/fsm_person.xml', 'views/account_invoice_view.xml', ], 'license': 'AGPL-3', diff --git a/fieldservice_account/models/__init__.py b/fieldservice_account/models/__init__.py index a1af9b159a..3f074a7747 100644 --- a/fieldservice_account/models/__init__.py +++ b/fieldservice_account/models/__init__.py @@ -5,5 +5,6 @@ account_invoice, analytic_account, fsm_location, - fsm_order + fsm_order, + fsm_person, ) diff --git a/fieldservice_account/models/fsm_person.py b/fieldservice_account/models/fsm_person.py new file mode 100644 index 0000000000..c6bc245c7f --- /dev/null +++ b/fieldservice_account/models/fsm_person.py @@ -0,0 +1,33 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class FSMPerson(models.Model): + _inherit = 'fsm.person' + + bill_count = fields.Integer(string='Vendor Bills', + compute='_compute_vendor_bills') + + def _compute_vendor_bills(self): + count = 0 + bills = self.env['account.invoice'].search([]) + for bill in bills: + if bill.partner_id == self.partner_id: + count += 1 + self.bill_count = count + + @api.multi + def action_view_bills(self): + for bill in self: + action = self.env.ref('account.action_invoice_tree2').read()[0] + vendor_bills = self.env['account.invoice'].search( + [('partner_id', '=', bill.name)]) + if len(vendor_bills) == 0 or len(vendor_bills) > 1: + action['domain'] = [('id', 'in', vendor_bills.ids)] + elif vendor_bills: + action['views'] = [ + (self.env.ref('account.invoice_supplier_form').id, 'form')] + action['res_id'] = vendor_bills.id + return action diff --git a/fieldservice_account/views/fsm_person.xml b/fieldservice_account/views/fsm_person.xml new file mode 100644 index 0000000000..b8cc139340 --- /dev/null +++ b/fieldservice_account/views/fsm_person.xml @@ -0,0 +1,22 @@ + + + + + fsm.person.form + fsm.person + + +
+ +
+
+
+ +
From 171ccbc1cb67f4b4042c755a1006e4b57c397d1a Mon Sep 17 00:00:00 2001 From: Murtuza Saleh Date: Mon, 22 Apr 2019 19:08:36 +0530 Subject: [PATCH 14/99] [MIG][12.0] fieldservice_account --- fieldservice_account/README.rst | 11 +-- fieldservice_account/__init__.py | 1 - fieldservice_account/__manifest__.py | 2 +- fieldservice_account/data/time_products.xml | 25 +++--- fieldservice_account/models/__init__.py | 1 - .../models/account_invoice.py | 9 +-- .../models/analytic_account.py | 5 +- fieldservice_account/models/fsm_location.py | 6 +- fieldservice_account/models/fsm_order.py | 21 ++--- fieldservice_account/models/fsm_person.py | 20 ++--- fieldservice_account/readme/CONTRIBUTORS.rst | 1 + .../static/description/index.html | 7 +- .../views/account_invoice_view.xml | 3 +- fieldservice_account/views/fsm_location.xml | 6 +- fieldservice_account/views/fsm_order.xml | 81 ++++++++++++------- fieldservice_account/views/fsm_person.xml | 2 +- 16 files changed, 109 insertions(+), 92 deletions(-) diff --git a/fieldservice_account/README.rst b/fieldservice_account/README.rst index 213359e7ba..278e295c55 100644 --- a/fieldservice_account/README.rst +++ b/fieldservice_account/README.rst @@ -14,13 +14,13 @@ Field Service - Accounting :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github - :target: https://github.com/OCA/field-service/tree/11.0/fieldservice_account + :target: https://github.com/OCA/field-service/tree/12.0/fieldservice_account :alt: OCA/field-service .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/field-service-11-0/field-service-11-0-fieldservice_account + :target: https://translation.odoo-community.org/projects/field-service-12-0/field-service-12-0-fieldservice_account :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/264/11.0 + :target: https://runbot.odoo-community.org/runbot/264/12.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -70,7 +70,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -86,6 +86,7 @@ Contributors ~~~~~~~~~~~~ * Michael Allen +* Serpent Consulting Services Pvt. Ltd. Other credits ~~~~~~~~~~~~~ @@ -115,6 +116,6 @@ Current `maintainer `__: |maintainer-osimallen| -This module is part of the `OCA/field-service `_ project on GitHub. +This module is part of the `OCA/field-service `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fieldservice_account/__init__.py b/fieldservice_account/__init__.py index 631bd4893a..69f7babdfb 100644 --- a/fieldservice_account/__init__.py +++ b/fieldservice_account/__init__.py @@ -1,4 +1,3 @@ -# Copyright (C) 2018 - TODAY, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index d32fef9111..b3106f9be9 100644 --- a/fieldservice_account/__manifest__.py +++ b/fieldservice_account/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Field Service - Accounting', 'summary': 'Track employee time and invoice for Field Service Orders', - 'version': '11.0.0.2.0', + 'version': '12.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/data/time_products.xml b/fieldservice_account/data/time_products.xml index c78d8894d1..96a1a4bee3 100644 --- a/fieldservice_account/data/time_products.xml +++ b/fieldservice_account/data/time_products.xml @@ -5,25 +5,32 @@ FSM Travel Time service - - - Travel time for Field Service Employees + + + Travel time for Field Service + Employees + + FSM Regular Time service - - - Regular time for Field Service Employees + + + Regular time for Field Service + Employees + + FSM Overtime service - - - Overtime for Field Service Employees + + + Overtime for Field Service Employees + diff --git a/fieldservice_account/models/__init__.py b/fieldservice_account/models/__init__.py index 3f074a7747..eadfd63f77 100644 --- a/fieldservice_account/models/__init__.py +++ b/fieldservice_account/models/__init__.py @@ -1,4 +1,3 @@ -# Copyright (C) 2018 - TODAY, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import ( diff --git a/fieldservice_account/models/account_invoice.py b/fieldservice_account/models/account_invoice.py index ba6bb69978..ae3e402fc9 100644 --- a/fieldservice_account/models/account_invoice.py +++ b/fieldservice_account/models/account_invoice.py @@ -24,9 +24,8 @@ def create(self, vals): vals['account_analytic_id'] = order.location_id.\ analytic_account_id.id else: - raise ValidationError(_("No analytic account" + - " set on the order's Location")) - + raise ValidationError(_("No analytic account " + "set on the order's Location.")) return super(AccountInvoiceLine, self).create(vals) @api.onchange('product_id', 'quantity') @@ -37,7 +36,7 @@ def onchange_product_id(self): line.fsm_order_id.person_id.partner_id or False if not partner: raise ValidationError( - _("Please set the field service worker")) + _("Please set the field service worker.")) fpos = partner.property_account_position_id tmpl = line.product_id.product_tmpl_id if line.product_id: @@ -49,7 +48,7 @@ def onchange_product_id(self): order='min_qty DESC') line.price_unit = \ supinfo and supinfo[0].price or tmpl.standard_price - line.account_id = accounts['expense'] + line.account_id = accounts.get('expense', False) line.invoice_line_tax_ids = fpos.\ map_tax(tmpl.supplier_taxes_id) line.name = line.product_id.name diff --git a/fieldservice_account/models/analytic_account.py b/fieldservice_account/models/analytic_account.py index 5388f0b7f9..29861f3207 100644 --- a/fieldservice_account/models/analytic_account.py +++ b/fieldservice_account/models/analytic_account.py @@ -18,7 +18,6 @@ def create(self, vals): if order.location_id.analytic_account_id: vals['account_id'] = order.location_id.analytic_account_id.id else: - raise ValidationError(_("No analytic account set " + - "on the order's Location")) - + raise ValidationError(_("No analytic account set " + "on the order's Location.")) return super(AccountAnalyticLine, self).create(vals) diff --git a/fieldservice_account/models/fsm_location.py b/fieldservice_account/models/fsm_location.py index 4e6ba202bd..07d4f5c450 100644 --- a/fieldservice_account/models/fsm_location.py +++ b/fieldservice_account/models/fsm_location.py @@ -1,12 +1,10 @@ # Copyright (C) 2018 - TODAY, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import fields +from odoo import fields, models -from odoo.addons.base_geoengine import geo_model - -class FSMLocation(geo_model.GeoModel): +class FSMLocation(models.Model): _inherit = 'fsm.location' analytic_account_id = fields.Many2one('account.analytic.account', diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index 043be19544..56ac0fc36b 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -1,9 +1,8 @@ # Copyright (C) 2018 - TODAY, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields +from odoo import api, fields, models -from odoo.addons.base_geoengine import geo_model ACCOUNT_STAGES = [('draft', 'Draft'), ('review', 'Needs Review'), @@ -12,7 +11,7 @@ ('no', 'Nothing Invoiced')] -class FSMOrder(geo_model.GeoModel): +class FSMOrder(models.Model): _inherit = 'fsm.order' contractor_cost_ids = fields.One2many('account.invoice.line', @@ -29,8 +28,7 @@ class FSMOrder(geo_model.GeoModel): employee_time_total = fields.Float(compute='_compute_employee_hours', string='Total Employee Hours') account_stage = fields.Selection(ACCOUNT_STAGES, string='State', - default='draft', required=True, - readonly=True, store=True) + default='draft') def _compute_employee(self): user = self.env['res.users'].browse(self.env.uid) @@ -71,7 +69,7 @@ def action_complete(self): def create_bills(self): jrnl = self.env['account.journal'].search([('type', '=', 'purchase'), - ('active', '=', True), ], + ('active', '=', True)], limit=1) fpos = self.customer_id.property_account_position_id vals = { @@ -81,7 +79,6 @@ def create_bills(self): 'fiscal_position_id': fpos.id or False, 'fsm_order_id': self.id } - bill = self.env['account.invoice'].sudo().create(vals) for line in self.contractor_cost_ids: line.invoice_id = bill @@ -96,7 +93,7 @@ def account_confirm(self): def account_create_invoice(self): jrnl = self.env['account.journal'].search([('type', '=', 'sale'), - ('active', '=', True), ], + ('active', '=', True)], limit=1) fpos = self.customer_id.property_account_position_id vals = { @@ -106,10 +103,8 @@ def account_create_invoice(self): 'fiscal_position_id': fpos.id or False, 'fsm_order_id': self.id } - invoice = self.env['account.invoice'].sudo().create(vals) price_list = invoice.partner_id.property_product_pricelist - for line in self.employee_timesheet_ids: price = price_list.get_product_price(product=line.product_id, quantity=line.unit_amount, @@ -119,7 +114,6 @@ def account_create_invoice(self): template = line.product_id.product_tmpl_id accounts = template.get_product_accounts() account = accounts['income'] - vals = { 'product_id': line.product_id.id, 'account_analytic_id': line.account_id.id, @@ -127,7 +121,7 @@ def account_create_invoice(self): 'name': line.name, 'price_unit': price, 'account_id': account.id, - 'invoice_id': invoice.id, + 'invoice_id': invoice.id } time_cost = self.env['account.invoice.line'].create(vals) taxes = template.taxes_id @@ -141,7 +135,6 @@ def account_create_invoice(self): template = cost.product_id.product_tmpl_id accounts = template.get_product_accounts() account = accounts['income'] - vals = { 'product_id': cost.product_id.id, 'account_analytic_id': cost.account_analytic_id.id, @@ -149,7 +142,7 @@ def account_create_invoice(self): 'name': cost.name, 'price_unit': price, 'account_id': account.id, - 'invoice_id': invoice.id, + 'invoice_id': invoice.id } con_cost = self.env['account.invoice.line'].create(vals) taxes = template.taxes_id diff --git a/fieldservice_account/models/fsm_person.py b/fieldservice_account/models/fsm_person.py index c6bc245c7f..1b75acfaa6 100644 --- a/fieldservice_account/models/fsm_person.py +++ b/fieldservice_account/models/fsm_person.py @@ -11,23 +11,19 @@ class FSMPerson(models.Model): compute='_compute_vendor_bills') def _compute_vendor_bills(self): - count = 0 - bills = self.env['account.invoice'].search([]) - for bill in bills: - if bill.partner_id == self.partner_id: - count += 1 - self.bill_count = count + self.bill_count = self.env['account.invoice'].search_count([ + ('partner_id', '=', self.partner_id.id)]) @api.multi def action_view_bills(self): for bill in self: - action = self.env.ref('account.action_invoice_tree2').read()[0] + action = self.env.ref('account.action_invoice_tree1').read()[0] vendor_bills = self.env['account.invoice'].search( - [('partner_id', '=', bill.name)]) - if len(vendor_bills) == 0 or len(vendor_bills) > 1: - action['domain'] = [('id', 'in', vendor_bills.ids)] - elif vendor_bills: + [('partner_id', '=', bill.partner_id.id)]) + if len(vendor_bills) == 1: action['views'] = [ - (self.env.ref('account.invoice_supplier_form').id, 'form')] + (self.env.ref('account.invoice_form').id, 'form')] action['res_id'] = vendor_bills.id + else: + action['domain'] = [('id', 'in', vendor_bills.ids)] return action diff --git a/fieldservice_account/readme/CONTRIBUTORS.rst b/fieldservice_account/readme/CONTRIBUTORS.rst index 0cb97e90a4..3f0e7c37dc 100644 --- a/fieldservice_account/readme/CONTRIBUTORS.rst +++ b/fieldservice_account/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Michael Allen +* Serpent Consulting Services Pvt. Ltd. diff --git a/fieldservice_account/static/description/index.html b/fieldservice_account/static/description/index.html index af81833fe1..7859295a9a 100644 --- a/fieldservice_account/static/description/index.html +++ b/fieldservice_account/static/description/index.html @@ -367,7 +367,7 @@

Field Service - Accounting

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/field-service Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/field-service Translate me on Weblate Try me on Runbot

This module adds the ability to track employee time and contractor costs for Field Service Orders. It also adds functionality to create a customer invoice and a vendor bill when a Field Service Order is @@ -417,7 +417,7 @@

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.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -432,6 +432,7 @@

Authors

Contributors

@@ -450,7 +451,7 @@

Maintainers

promote its widespread use.

Current maintainer:

osimallen

-

This module is part of the OCA/field-service project on GitHub.

+

This module is part of the OCA/field-service project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/fieldservice_account/views/account_invoice_view.xml b/fieldservice_account/views/account_invoice_view.xml index 9404183a88..f92cf878ca 100644 --- a/fieldservice_account/views/account_invoice_view.xml +++ b/fieldservice_account/views/account_invoice_view.xml @@ -1,5 +1,6 @@ - + + account.invoice.form.fsm.contractor account.invoice diff --git a/fieldservice_account/views/fsm_location.xml b/fieldservice_account/views/fsm_location.xml index bead4f1d56..5607e1ea43 100644 --- a/fieldservice_account/views/fsm_location.xml +++ b/fieldservice_account/views/fsm_location.xml @@ -1,5 +1,6 @@ + fsm.location.form.accounting @@ -8,8 +9,8 @@ - - + + @@ -17,4 +18,5 @@ + diff --git a/fieldservice_account/views/fsm_order.xml b/fieldservice_account/views/fsm_order.xml index 390eace5a1..d21ed744bb 100644 --- a/fieldservice_account/views/fsm_order.xml +++ b/fieldservice_account/views/fsm_order.xml @@ -1,69 +1,90 @@ - + + fsm.order.form.accounting fsm.order - +
-
- - + + - + - - - + + + + + - - + + + + - + - + - + + +
-
+
- + fsm.order.search fsm.order - + +
diff --git a/fieldservice_account/views/fsm_person.xml b/fieldservice_account/views/fsm_person.xml index b8cc139340..d3519bc945 100644 --- a/fieldservice_account/views/fsm_person.xml +++ b/fieldservice_account/views/fsm_person.xml @@ -1,4 +1,4 @@ - + From eebd9f52b1eb1a720ea74b1d6c947c246455074a Mon Sep 17 00:00:00 2001 From: scampbell Date: Fri, 24 May 2019 08:52:41 -0700 Subject: [PATCH 15/99] [IMP] Github Comments --- fieldservice_account/models/fsm_order.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index 56ac0fc36b..188a29e56d 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -1,7 +1,8 @@ # Copyright (C) 2018 - TODAY, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError ACCOUNT_STAGES = [('draft', 'Draft'), @@ -87,9 +88,13 @@ def create_bills(self): def account_confirm(self): for order in self: contractor = order.person_id.partner_id.supplier - if order.contractor_cost_ids and contractor: - order.create_bills() - order.account_stage = 'confirmed' + if order.contractor_cost_ids: + if contractor: + order.create_bills() + order.account_stage = 'confirmed' + else: + raise ValidationError(_("The worker assigned to this order" + " is not a supplier")) def account_create_invoice(self): jrnl = self.env['account.journal'].search([('type', '=', 'sale'), From 66b432ed2bbc59996b9561d458037c710335c809 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Thu, 30 May 2019 00:44:10 -0500 Subject: [PATCH 16/99] [FIX] fieldservice_account: access rights --- fieldservice_account/__manifest__.py | 1 + fieldservice_account/security/ir.model.access.csv | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 fieldservice_account/security/ir.model.access.csv diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index b3106f9be9..192bac7d0f 100644 --- a/fieldservice_account/__manifest__.py +++ b/fieldservice_account/__manifest__.py @@ -17,6 +17,7 @@ ], 'data': [ 'data/time_products.xml', + 'security/ir.model.access.csv', 'views/account.xml', 'views/fsm_location.xml', 'views/fsm_order.xml', diff --git a/fieldservice_account/security/ir.model.access.csv b/fieldservice_account/security/ir.model.access.csv new file mode 100644 index 0000000000..f6792aef64 --- /dev/null +++ b/fieldservice_account/security/ir.model.access.csv @@ -0,0 +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 From 98672388e34820b3a725358f8f77c1d2e3046cad Mon Sep 17 00:00:00 2001 From: scampbell Date: Wed, 26 Jun 2019 09:41:41 -0700 Subject: [PATCH 17/99] [IMP] FSM Account Update [IMP] Enable Dispatch/Managers to Enter Timesheets [IMP] Overwrite Action to Remove Domain Update ir_rule.xml Update ir.model.access.csv [IMP] Overwrite Record Rule [IMP] Bill Customer on Location. Bill To Req/Show --- fieldservice_account/__manifest__.py | 2 + fieldservice_account/data/ir_rule.xml | 28 +++++++++++ fieldservice_account/models/fsm_order.py | 46 +++++++++++++++---- .../security/ir.model.access.csv | 4 ++ fieldservice_account/views/fsm_order.xml | 1 + fieldservice_account/views/hr_timesheet.xml | 37 +++++++++++++++ 6 files changed, 108 insertions(+), 10 deletions(-) create mode 100644 fieldservice_account/data/ir_rule.xml create mode 100644 fieldservice_account/views/hr_timesheet.xml diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index 192bac7d0f..afbe260fa3 100644 --- a/fieldservice_account/__manifest__.py +++ b/fieldservice_account/__manifest__.py @@ -17,12 +17,14 @@ ], 'data': [ 'data/time_products.xml', + 'data/ir_rule.xml', 'security/ir.model.access.csv', 'views/account.xml', 'views/fsm_location.xml', 'views/fsm_order.xml', 'views/fsm_person.xml', 'views/account_invoice_view.xml', + 'views/hr_timesheet.xml' ], 'license': 'AGPL-3', 'development_status': 'Beta', diff --git a/fieldservice_account/data/ir_rule.xml b/fieldservice_account/data/ir_rule.xml new file mode 100644 index 0000000000..622bca4ee7 --- /dev/null +++ b/fieldservice_account/data/ir_rule.xml @@ -0,0 +1,28 @@ + + + + + account.analytic.line.fsm.manager + + + [(1, '=', 1)] + + + + + + + + + account.analytic.line.fsm.dispatcher + + + [(1, '=', 1)] + + + + + + + + diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index 188a29e56d..ad5010d52b 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -30,6 +30,10 @@ class FSMOrder(models.Model): string='Total Employee Hours') account_stage = fields.Selection(ACCOUNT_STAGES, string='State', default='draft') + bill_to = fields.Selection([('location', 'Bill Location'), + ('contact', 'Bill Contact')], + string="Bill to", + required=True) def _compute_employee(self): user = self.env['res.users'].browse(self.env.uid) @@ -66,6 +70,12 @@ def _compute_contractor_cost(self): def action_complete(self): for order in self: order.account_stage = 'review' + if self.person_id.supplier and not self.contractor_cost_ids: + raise ValidationError(_("Cannot move to Complete " + + "until 'Contractor Costs' is filled in")) + if not self.person_id.supplier and not self.employee_timesheet_ids: + raise ValidationError(_("Cannot move to Complete until " + + "'Employee Timesheets' is filled in")) return super(FSMOrder, self).action_complete() def create_bills(self): @@ -95,21 +105,37 @@ def account_confirm(self): else: raise ValidationError(_("The worker assigned to this order" " is not a supplier")) + if order.employee_timesheet_ids: + order.account_stage = 'confirmed' def account_create_invoice(self): jrnl = self.env['account.journal'].search([('type', '=', 'sale'), ('active', '=', True)], limit=1) - fpos = self.customer_id.property_account_position_id - vals = { - 'partner_id': self.customer_id.id, - 'type': 'out_invoice', - 'journal_id': jrnl.id or False, - 'fiscal_position_id': fpos.id or False, - 'fsm_order_id': self.id - } - invoice = self.env['account.invoice'].sudo().create(vals) - price_list = invoice.partner_id.property_product_pricelist + if self.bill_to == 'contact': + if not self.customer_id: + raise ValidationError(_("Contact empty")) + fpos = self.customer_id.property_account_position_id + vals = { + 'partner_id': self.customer_id.id, + 'type': 'out_invoice', + 'journal_id': jrnl.id or False, + 'fiscal_position_id': fpos.id or False, + 'fsm_order_id': self.id + } + invoice = self.env['account.invoice'].sudo().create(vals) + price_list = invoice.partner_id.property_product_pricelist + else: + fpos = self.location_id.customer_id.property_account_position_id + vals = { + 'partner_id': self.location_id.customer_id.id, + 'type': 'out_invoice', + 'journal_id': jrnl.id or False, + 'fiscal_position_id': fpos.id or False, + 'fsm_order_id': self.id + } + invoice = self.env['account.invoice'].sudo().create(vals) + price_list = invoice.partner_id.property_product_pricelist for line in self.employee_timesheet_ids: price = price_list.get_product_price(product=line.product_id, quantity=line.unit_amount, diff --git a/fieldservice_account/security/ir.model.access.csv b/fieldservice_account/security/ir.model.access.csv index f6792aef64..9f1a3fe461 100644 --- a/fieldservice_account/security/ir.model.access.csv +++ b/fieldservice_account/security/ir.model.access.csv @@ -1,2 +1,6 @@ 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_analytic_line_fsm_manager,account.analytic.line.manager,model_account_analytic_line,fieldservice.group_fsm_manager,1,1,1,1 +access_account_analytic_line_fsm_dispatcher,account.analytic.line.dispatcher,model_account_analytic_line,fieldservice.group_fsm_dispatcher,1,1,1,0 +access_analytic_account_fsm_manager,account.analytic.account.manager,analytic.model_account_analytic_account,fieldservice.group_fsm_manager,1,1,1,1 +access_analytic_account_fsm_dispatcher,account.analytic.account.dispatcher,analytic.model_account_analytic_account,fieldservice.group_fsm_dispatcher,1,1,1,0 diff --git a/fieldservice_account/views/fsm_order.xml b/fieldservice_account/views/fsm_order.xml index d21ed744bb..da2396876a 100644 --- a/fieldservice_account/views/fsm_order.xml +++ b/fieldservice_account/views/fsm_order.xml @@ -29,6 +29,7 @@ attrs="{'invisible': [('account_stage', '!=', 'confirmed')]}"/> + diff --git a/fieldservice_account/views/hr_timesheet.xml b/fieldservice_account/views/hr_timesheet.xml new file mode 100644 index 0000000000..ec7e5073af --- /dev/null +++ b/fieldservice_account/views/hr_timesheet.xml @@ -0,0 +1,37 @@ + + + + + My Timesheets + account.analytic.line + tree,form + [('user_id', '=', uid)] + { + "search_default_week":1, + } + + +

+ Record a new activity +

+ You can register and track your workings hours by project every + day. Every time spent on a project will become a cost and can be re-invoiced to + customers if required. +

+
+
+ + + + account.analytic.line.timesheet.user + + + [('user_id', '=', user.id), ('project_id', '!=', False)] + + + + + + + +
From ac92638d50580807a9396bcce29007059ddd9180 Mon Sep 17 00:00:00 2001 From: scampbell Date: Wed, 3 Jul 2019 13:50:54 -0700 Subject: [PATCH 18/99] [IMP] Autopopulate Description --- fieldservice_account/models/analytic_account.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fieldservice_account/models/analytic_account.py b/fieldservice_account/models/analytic_account.py index 29861f3207..96b4248078 100644 --- a/fieldservice_account/models/analytic_account.py +++ b/fieldservice_account/models/analytic_account.py @@ -21,3 +21,8 @@ def create(self, vals): raise ValidationError(_("No analytic account set " "on the order's Location.")) return super(AccountAnalyticLine, self).create(vals) + + @api.onchange('product_id') + def oncahnge_produc_id(self): + if self.product_id: + self.name = self.product_id.name From 732bafa84a8a6d9c3269bec36b886cb97be4cf47 Mon Sep 17 00:00:00 2001 From: scampbell Date: Fri, 5 Jul 2019 08:26:03 -0700 Subject: [PATCH 19/99] [IMP] Onoy Show Price to FSM Manager --- fieldservice_account/views/fsm_order.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_account/views/fsm_order.xml b/fieldservice_account/views/fsm_order.xml index da2396876a..9f4639c404 100644 --- a/fieldservice_account/views/fsm_order.xml +++ b/fieldservice_account/views/fsm_order.xml @@ -42,7 +42,7 @@ invisible='1'/> - +
From c42a46e58084c56e91152bcdf4b59badab27c308 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Fri, 5 Jul 2019 16:15:42 -0500 Subject: [PATCH 20/99] [FIX] fieldservice_account: Bump version and provide migration script --- fieldservice_account/__manifest__.py | 2 +- .../migrations/12.0.2.0.0/pre-migration.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 fieldservice_account/migrations/12.0.2.0.0/pre-migration.py diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index afbe260fa3..b0cf575250 100644 --- a/fieldservice_account/__manifest__.py +++ b/fieldservice_account/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Field Service - Accounting', 'summary': 'Track employee time and invoice for Field Service Orders', - 'version': '12.0.1.0.0', + 'version': '12.0.2.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/migrations/12.0.2.0.0/pre-migration.py b/fieldservice_account/migrations/12.0.2.0.0/pre-migration.py new file mode 100644 index 0000000000..7218f7ce5e --- /dev/null +++ b/fieldservice_account/migrations/12.0.2.0.0/pre-migration.py @@ -0,0 +1,10 @@ +# Copyright (C) 2019, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +def migrate(env, version): + if not version: + return + + env.execute("UPDATE fsm_order SET bill_to = 'location' " + "WHERE bill_to IS NULL;") From d286a05f7c8cd02c04f56687ebe7413d795881bd Mon Sep 17 00:00:00 2001 From: Mourad Date: Mon, 8 Jul 2019 12:23:44 +0200 Subject: [PATCH 21/99] [FIX] Bugs bill_to view and add default value to allow automatic creation of fsm.order from recuring for exemple --- fieldservice_account/models/fsm_order.py | 3 ++- fieldservice_account/views/fsm_order.xml | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index ad5010d52b..a83a05be1c 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -33,7 +33,8 @@ class FSMOrder(models.Model): bill_to = fields.Selection([('location', 'Bill Location'), ('contact', 'Bill Contact')], string="Bill to", - required=True) + required=True, + default="location") def _compute_employee(self): user = self.env['res.users'].browse(self.env.uid) diff --git a/fieldservice_account/views/fsm_order.xml b/fieldservice_account/views/fsm_order.xml index 9f4639c404..a5adf0bb4f 100644 --- a/fieldservice_account/views/fsm_order.xml +++ b/fieldservice_account/views/fsm_order.xml @@ -29,7 +29,9 @@ attrs="{'invisible': [('account_stage', '!=', 'confirmed')]}"/> - + + + From 81107f336cf9bf0068923c6d6f17aeca7c1a130f Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Mon, 8 Jul 2019 09:22:09 -0500 Subject: [PATCH 22/99] Update analytic_account.py --- fieldservice_account/models/analytic_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_account/models/analytic_account.py b/fieldservice_account/models/analytic_account.py index 96b4248078..62bb9c12a7 100644 --- a/fieldservice_account/models/analytic_account.py +++ b/fieldservice_account/models/analytic_account.py @@ -23,6 +23,6 @@ def create(self, vals): return super(AccountAnalyticLine, self).create(vals) @api.onchange('product_id') - def oncahnge_produc_id(self): + def onchange_product_id(self): if self.product_id: self.name = self.product_id.name From 5dd1bafb284bc3e98a82a09fca13048510087355 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Tue, 9 Jul 2019 00:28:03 -0500 Subject: [PATCH 23/99] [FIX] fieldservice_account: migration script --- .../migrations/12.0.2.0.0/{pre-migration.py => post-migration.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename fieldservice_account/migrations/12.0.2.0.0/{pre-migration.py => post-migration.py} (100%) diff --git a/fieldservice_account/migrations/12.0.2.0.0/pre-migration.py b/fieldservice_account/migrations/12.0.2.0.0/post-migration.py similarity index 100% rename from fieldservice_account/migrations/12.0.2.0.0/pre-migration.py rename to fieldservice_account/migrations/12.0.2.0.0/post-migration.py From 1c42444af27d532e6adcfbbf30aac5966052f662 Mon Sep 17 00:00:00 2001 From: Kitti U Date: Sun, 7 Jul 2019 17:16:15 +0700 Subject: [PATCH 24/99] [12.0][IMP] fieldservice_account, add test scripts --- fieldservice_account/tests/__init__.py | 4 + .../tests/test_fsm_account.py | 210 ++++++++++++++++++ 2 files changed, 214 insertions(+) create mode 100644 fieldservice_account/tests/__init__.py create mode 100644 fieldservice_account/tests/test_fsm_account.py diff --git a/fieldservice_account/tests/__init__.py b/fieldservice_account/tests/__init__.py new file mode 100644 index 0000000000..1fb62bd56d --- /dev/null +++ b/fieldservice_account/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from . import test_fsm_account diff --git a/fieldservice_account/tests/test_fsm_account.py b/fieldservice_account/tests/test_fsm_account.py new file mode 100644 index 0000000000..c5f3371542 --- /dev/null +++ b/fieldservice_account/tests/test_fsm_account.py @@ -0,0 +1,210 @@ +# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) +from odoo import fields +from odoo.tests.common import TransactionCase, Form +from odoo.exceptions import ValidationError + + +class FSMAccountCase(TransactionCase): + + def setUp(self): + super(FSMAccountCase, self).setUp() + self.WorkOrder = self.env['fsm.order'] + self.AccountInvoice = self.env['account.invoice'] + self.AccountInvoiceLine = self.env['account.invoice.line'] + # create a Res Partner + self.test_partner = self.env['res.partner'].\ + create({ + 'name': 'Test Partner', + 'phone': '123', + 'email': 'tp@email.com', + }) + # create a Res Partner to be converted to FSM Location/Person + self.test_loc_partner = self.env['res.partner'].\ + create({ + 'name': 'Test Loc Partner', + 'phone': 'ABC', + 'email': 'tlp@email.com', + }) + # create expected FSM Location to compare to converted FSM Location + self.test_location = self.env['fsm.location'].\ + create({ + 'name': 'Test Location', + 'phone': '123', + 'email': 'tp@email.com', + 'partner_id': self.test_loc_partner.id, + 'owner_id': self.test_loc_partner.id, + 'customer_id': self.test_loc_partner.id, + }) + self.test_person = self.env['fsm.person'].create({'name': 'Worker-1'}) + self.test_analytic = self.env.ref('analytic.analytic_administratif') + + def _create_workorder(self, bill_to, contractors, timesheets): + # Create a new work order + view_id = ('fieldservice.fsm_order_form') + # Test that, if contractor_cost_ids is selected, the + with Form(self.WorkOrder, view=view_id) as f: + f.location_id = self.test_location + f.bill_to = bill_to + f.person_id = self.test_person + for l in contractors: + with f.contractor_cost_ids.new() as line: + line.product_id = l['product'] + line.quantity = l['quantity'] + line.price_unit = l['price_unit'] + for l in timesheets: + with f.employee_timesheet_ids.new() as line: + line.account_id = f.location_id.analytic_account_id + line.employee_id = l['employee'] + line.product_id = l['product'] + line.unit_amount = l['unit_amount'] + line.name = 'Test' + order = f.save() + order.person_ids += self.test_person + return order + + def _process_order_to_invoices(self, order): + # Change states + order.action_confirm() + order.action_request() + order.action_assign() + order.action_schedule() + order.action_enroute() + order.date_start = fields.Datetime.today() + order.action_start() + order.date_end = fields.Datetime.today() + order.resolution = 'Done something!' + order.action_complete() + self.assertEqual(order.account_stage, 'review') + # Create vendor bill + # Vendor bill created from order's contractor + if not order.person_id.partner_id.supplier: + with self.assertRaises(ValidationError) as e: + order.account_confirm() + self.assertEqual( + e.exception.name, + "The worker assigned to this order is not a supplier") + order.person_id.partner_id.supplier = True + order.account_confirm() + self.assertEqual(order.account_stage, 'confirmed') + bill = self.AccountInvoice.search([('type', '=', 'in_invoice'), + ('fsm_order_id', '=', order.id)]) + self.assertEqual(len(bill), 1) + self.assertEqual(len(order.contractor_cost_ids), + len(bill.invoice_line_ids)) + # Customer invoice created from order's contractor and timehsheet + if order.bill_to == 'contact' and not order.customer_id: + with self.assertRaises(ValidationError): + order.account_create_invoice() + order.customer_id = self.test_loc_partner # Assign some partner + order.account_create_invoice() + self.assertEqual(order.account_stage, 'invoiced') + invoice = self.AccountInvoice.search([('type', '=', 'out_invoice'), + ('fsm_order_id', '=', order.id)]) + self.assertEqual(len(invoice), 1) + self.assertEqual( + len(order.contractor_cost_ids) + len(order.employee_timesheet_ids), + len(invoice.invoice_line_ids)) + return (bill, invoice) + + def test_fsm_order_bill_to_location(self): + """Bill To Location, + invoice created is based on this order's location's partner + """ + # Setup required data + self.test_location.analytic_account_id = self.test_analytic + contractors = [{'product': self.env.ref('product.expense_hotel'), + 'quantity': 2, + 'price_unit': 200}, ] + self.env.ref('hr.employee_qdp').timesheet_cost = 100.0 + timesheets = [{'employee': self.env.ref('hr.employee_qdp'), + 'product': self.env.ref('product.expense_hotel'), + 'unit_amount': 6}, + {'employee': self.env.ref('hr.employee_qdp'), + 'product': self.env.ref('product.expense_hotel'), + 'unit_amount': 4}, ] + order = self._create_workorder(bill_to='location', + contractors=contractors, + timesheets=timesheets) + self.assertEqual(order.contractor_total, 400) + self.assertEqual(order.employee_time_total, 10) # Hrs + self.assertEqual(order.total_cost, 1400) + bill, invoice = self._process_order_to_invoices(order) + self.assertEqual(bill.partner_id, order.person_id.partner_id) + self.assertEqual(invoice.partner_id, order.location_id.customer_id) + + def test_fsm_order_bill_to_contact(self): + """Bill To Contact, + invoice created is based on this order's contact + """ + # Setup required data + self.test_location.analytic_account_id = self.test_analytic + # Create a new work order with contract = 500 and timesheet = 300 + contractors = [{'product': self.env.ref('product.expense_hotel'), + 'quantity': 2, + 'price_unit': 100}, + {'product': self.env.ref('product.expense_hotel'), + 'quantity': 1, + 'price_unit': 300}, ] + self.env.ref('hr.employee_qdp').timesheet_cost = 20.0 + timesheets = [{'employee': self.env.ref('hr.employee_qdp'), + 'product': self.env.ref('product.expense_hotel'), + 'unit_amount': 10}, ] + order = self._create_workorder(bill_to='contact', + contractors=contractors, + timesheets=timesheets) + self.assertEqual(order.contractor_total, 500) + self.assertEqual(order.employee_time_total, 10) # Hrs + self.assertEqual(order.total_cost, 700) + bill, invoice = self._process_order_to_invoices(order) + self.assertEqual(bill.partner_id, order.person_id.partner_id) + self.assertEqual(invoice.partner_id, order.customer_id) + + def test_fsm_order_exception(self): + """Create a new work order, error raised when + - If person_is is not set, but user try to add new contractor_cost_ids + - If analytic account is not set in location, + and user create contractor_cost_ids (account.move.line) + """ + # Create a new work order + view_id = ('fieldservice.fsm_order_form') + # Test if the person_id is not selected, error when add contractor line + with Form(self.WorkOrder, view=view_id) as f: + f.location_id = self.test_location + f.bill_to = 'contact' + with self.assertRaises(ValidationError) as e: + with f.contractor_cost_ids.new() as line: + line.product_id = self.env.ref('product.expense_hotel') + self.assertEqual(e.exception.name, + 'Please set the field service worker.') + order = f.save() + f.person_id = self.test_person + f.save() + # Test analytic account is not set in location, + # and user create account.invoice.line + with self.assertRaises(ValidationError) as e: + self.AccountInvoiceLine.create({ + 'fsm_order_id': order.id, + 'product_id': self.env.ref('product.expense_hotel').id}) + self.assertEqual(e.exception.name, + "No analytic account set on the order's Location.") + order.action_confirm() + with self.assertRaises(ValidationError) as e: + order.action_request() + self.assertEqual(e.exception.name, + "Cannot move to Requested until " + "'Request Workers' is filled in") + order.person_ids += self.test_person + order.action_request() + order.action_assign() + order.action_schedule() + order.action_enroute() + order.date_start = fields.Datetime.today() + order.action_start() + order.date_end = fields.Datetime.today() + order.resolution = 'Done something!' + with self.assertRaises(ValidationError) as e: + order.action_complete() + self.assertEqual(e.exception.name, + "Cannot move to Complete until " + "'Employee Timesheets' is filled in") From 82099dc0899de71304934076e36a09e338bbc3b8 Mon Sep 17 00:00:00 2001 From: scampbell Date: Wed, 17 Jul 2019 16:53:55 -0700 Subject: [PATCH 25/99] [IMP] Bug #266 False ETA Error [IMP] Bug #265 Linked Location Search Error [IMP] Bug #272 Rate Not Declared [IMP] Bug #263 equipment_count Wrong [IMP] Bug #277 Worker Pricelists Computed Wrong [IMP] Flake8 + Remove Debug --- fieldservice_account/models/fsm_order.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index a83a05be1c..4aa823f39f 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -46,6 +46,7 @@ def _compute_employee(self): def _compute_total_cost(self): for order in self: order.total_cost = 0.0 + rate = 0 for line in order.employee_timesheet_ids: for emp in line.user_id.employee_ids: rate = emp.timesheet_cost From 305e8a341b73ca11cbacf370769ec3f3936a8fe5 Mon Sep 17 00:00:00 2001 From: scampbell Date: Tue, 23 Jul 2019 13:43:49 -0700 Subject: [PATCH 26/99] [IMP] Remove Unnecessary Loop. --- fieldservice_account/models/fsm_order.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index 4aa823f39f..22acfab208 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -48,9 +48,7 @@ def _compute_total_cost(self): order.total_cost = 0.0 rate = 0 for line in order.employee_timesheet_ids: - for emp in line.user_id.employee_ids: - rate = emp.timesheet_cost - continue + rate = line.employee_id.timesheet_cost order.total_cost += line.unit_amount * rate for cost in order.contractor_cost_ids: order.total_cost += cost.price_unit * cost.quantity From 2a8afb36af8ef3fd57a0b0f261addb52326406aa Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Thu, 25 Jul 2019 11:53:54 -0500 Subject: [PATCH 27/99] [FIX] fieldservice_account: Wrong journals --- fieldservice_account/__manifest__.py | 2 +- fieldservice_account/models/fsm_order.py | 16 ++++++++++------ .../static/description/index.html | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index b0cf575250..74cc7cb17b 100644 --- a/fieldservice_account/__manifest__.py +++ b/fieldservice_account/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Field Service - Accounting', 'summary': 'Track employee time and invoice for Field Service Orders', - 'version': '12.0.2.0.0', + 'version': '12.0.2.0.1', 'category': 'Field Service', 'author': 'Open Source Integrators, Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/field-service', diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index 22acfab208..300954b42c 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -79,9 +79,11 @@ def action_complete(self): return super(FSMOrder, self).action_complete() def create_bills(self): - jrnl = self.env['account.journal'].search([('type', '=', 'purchase'), - ('active', '=', True)], - limit=1) + jrnl = self.env['account.journal'].search([ + ('company_id', '=', self.env.user.company_id.id), + ('type', '=', 'purchase'), + ('active', '=', True)], + limit=1) fpos = self.customer_id.property_account_position_id vals = { 'partner_id': self.person_id.partner_id.id, @@ -109,9 +111,11 @@ def account_confirm(self): order.account_stage = 'confirmed' def account_create_invoice(self): - jrnl = self.env['account.journal'].search([('type', '=', 'sale'), - ('active', '=', True)], - limit=1) + jrnl = self.env['account.journal'].search([ + ('company_id', '=', self.env.user.company_id.id), + ('type', '=', 'sale'), + ('active', '=', True)], + limit=1) if self.bill_to == 'contact': if not self.customer_id: raise ValidationError(_("Contact empty")) diff --git a/fieldservice_account/static/description/index.html b/fieldservice_account/static/description/index.html index 7859295a9a..ae1a3dd37a 100644 --- a/fieldservice_account/static/description/index.html +++ b/fieldservice_account/static/description/index.html @@ -3,7 +3,7 @@ - + Field Service - Accounting - - -
-

Field Service - Accounting

- - -

Beta License: AGPL-3 OCA/field-service Translate me on Weblate Try me on Runbot

-

This module adds the ability to link field service orders to invoices.

-

Table of contents

- -
-

Installation

-

No special installation instructions

-
-
-

Configuration

-

No special configuration instructions.

-
-
-

Usage

-

No specific usage instructions.

-
-
-

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.

-

Do not contact contributors directly about support or help with technical issues.

-
-
-

Credits

-
-

Authors

-
    -
  • Open Source Integrators
  • -
-
-
-

Contributors

- -
-
-

Other credits

-

The development of this module has been financially supported by:

- -
-
-

Maintainers

-

This module is maintained by the OCA.

-Odoo Community Association -

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.

-

Current maintainers:

-

osimallen brian10048 bodedra

-

This module is part of the OCA/field-service project on GitHub.

-

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

-
-
-
- +

+ Beta + License: AGPL-3 + OCA/field-service + Translate me on Weblate + Try me on Runbot +

+

This module adds the ability to link field service orders to invoices.

+

Table of contents

+
+ +
+
+

Installation

+

No special installation instructions

+
+
+

Configuration

+

No special configuration instructions.

+
+
+

Usage

+

No specific usage instructions.

+
+
+

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. +

+

+ Do not contact contributors directly about support or help with technical + issues. +

+
+
+

Credits

+
+

Authors

+
    +
  • Open Source Integrators
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ Odoo Community Association +

+ 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. +

+

+ Current + maintainers: +

+

+ osimallen + brian10048 + bodedra +

+

+ This module is part of the + OCA/field-service + project on GitHub. +

+

+ You are welcome to contribute. To learn how please visit + https://odoo-community.org/page/Contribute. +

+
+
+
+ diff --git a/fieldservice_account/tests/test_fsm_account.py b/fieldservice_account/tests/test_fsm_account.py index 507c607e71..dd703ed846 100644 --- a/fieldservice_account/tests/test_fsm_account.py +++ b/fieldservice_account/tests/test_fsm_account.py @@ -5,40 +5,31 @@ class FSMAccountCase(TransactionCase): - 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.Wizard = self.env["fsm.wizard"] + self.WorkOrder = self.env["fsm.order"] + self.AccountInvoice = self.env["account.invoice"] + self.AccountInvoiceLine = self.env["account.invoice.line"] # create a Res Partner - self.test_partner = self.env['res.partner'].\ - create({ - 'name': 'Test Partner', - 'phone': '123', - 'email': 'tp@email.com', - }) + self.test_partner = self.env["res.partner"].create( + {"name": "Test Partner", "phone": "123", "email": "tp@email.com"} + ) # create a Res Partner to be converted to FSM Location/Person - self.test_loc_partner = self.env['res.partner'].\ - create({ - 'name': 'Test Loc Partner', - 'phone': 'ABC', - 'email': 'tlp@email.com', - }) - self.test_loc_partner2 = self.env['res.partner'].\ - create({ - 'name': 'Test Loc Partner 2', - 'phone': '123', - 'email': 'tlp@example.com', - }) + self.test_loc_partner = self.env["res.partner"].create( + {"name": "Test Loc Partner", "phone": "ABC", "email": "tlp@email.com"} + ) + self.test_loc_partner2 = self.env["res.partner"].create( + {"name": "Test Loc Partner 2", "phone": "123", "email": "tlp@example.com"} + ) # create expected FSM Location to compare to converted FSM Location - self.test_location = self.env['fsm.location'].\ - create({ - 'name': 'Test Location', - 'phone': '123', - 'email': 'tp@email.com', - 'partner_id': self.test_loc_partner.id, - 'owner_id': self.test_loc_partner.id, - 'customer_id': self.test_loc_partner.id, - }) + self.test_location = self.env["fsm.location"].create( + { + "name": "Test Location", + "phone": "123", + "email": "tp@email.com", + "partner_id": self.test_loc_partner.id, + "owner_id": self.test_loc_partner.id, + "customer_id": self.test_loc_partner.id, + } + ) diff --git a/fieldservice_account/views/account_invoice.xml b/fieldservice_account/views/account_invoice.xml index 4fa8942bd0..a3853ed00d 100644 --- a/fieldservice_account/views/account_invoice.xml +++ b/fieldservice_account/views/account_invoice.xml @@ -1,59 +1,64 @@ - FSM order.invoice.form account.invoice - +
-
- vendor.bill.tree.view.fso account.invoice - + - + - vendor.bill.form.view.fso account.invoice - + - + - invoice.search.view.fso account.invoice - + - + -
diff --git a/fieldservice_account/views/fsm_order.xml b/fieldservice_account/views/fsm_order.xml index d4ba66fde8..cddb09b058 100644 --- a/fieldservice_account/views/fsm_order.xml +++ b/fieldservice_account/views/fsm_order.xml @@ -1,22 +1,24 @@ - fsm.order - +
-
-
From 39e6f8cbdca7d45ddbe091fc74d5f18d56d712c6 Mon Sep 17 00:00:00 2001 From: brian10048 Date: Mon, 20 Jul 2020 13:18:43 -0400 Subject: [PATCH 62/99] [MIG] fieldservice_account: Migration to 13.0 --- fieldservice_account/__manifest__.py | 4 ++-- .../migrations/12.0.3.0.0/post-migration.py | 16 -------------- .../migrations/13.0.1.0.0/pre-migration.py | 21 +++++++++++++++++++ fieldservice_account/models/__init__.py | 4 ++-- .../{account_invoice.py => account_move.py} | 9 ++++---- ...t_invoice_line.py => account_move_line.py} | 4 ++-- fieldservice_account/models/fsm_order.py | 7 +++---- .../security/ir.model.access.csv | 2 +- .../tests/test_fsm_account.py | 5 ++--- .../{account_invoice.xml => account_move.xml} | 18 ++++++++-------- 10 files changed, 46 insertions(+), 44 deletions(-) delete mode 100644 fieldservice_account/migrations/12.0.3.0.0/post-migration.py create mode 100644 fieldservice_account/migrations/13.0.1.0.0/pre-migration.py rename fieldservice_account/models/{account_invoice.py => account_move.py} (85%) rename fieldservice_account/models/{account_invoice_line.py => account_move_line.py} (74%) rename fieldservice_account/views/{account_invoice.xml => account_move.xml} (78%) diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index ed63db6cd9..bcfcd984d1 100644 --- a/fieldservice_account/__manifest__.py +++ b/fieldservice_account/__manifest__.py @@ -4,14 +4,14 @@ { "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", "depends": ["fieldservice", "account"], "data": [ "security/ir.model.access.csv", - "views/account_invoice.xml", + "views/account_move.xml", "views/fsm_order.xml", ], "license": "AGPL-3", diff --git a/fieldservice_account/migrations/12.0.3.0.0/post-migration.py b/fieldservice_account/migrations/12.0.3.0.0/post-migration.py deleted file mode 100644 index 8d5d09ad82..0000000000 --- a/fieldservice_account/migrations/12.0.3.0.0/post-migration.py +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (C) 2019 Open Source Integrators -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - - -def migrate(env, version): - if not version: - return - - env.execute( - """INSERT INTO - fsm_order_account_invoice_rel(fsm_order_id, invoice_id) - SELECT DISTINCT l.fsm_order_id, l.invoice_id - FROM account_invoice_line AS l - WHERE l.fsm_order_id IS NOT NULL AND l.invoice_id IS NOT NULL; - """ - ) diff --git a/fieldservice_account/migrations/13.0.1.0.0/pre-migration.py b/fieldservice_account/migrations/13.0.1.0.0/pre-migration.py new file mode 100644 index 0000000000..57e48a5e8e --- /dev/null +++ b/fieldservice_account/migrations/13.0.1.0.0/pre-migration.py @@ -0,0 +1,21 @@ +# Copyright (C) 2020 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + +_model_renames = [ + ("account.invoice", "account.move"), + ("account.invoice.line", "account.move.line"), +] + +_table_renames = [ + ("account.invoice", "account.move"), + ("account.invoice.line", "account.move.line"), + ("fsm_order_account_invoice_rel", "fsm_order_account_move_rel"), +] + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.rename_models(env.cr, _model_renames) + openupgrade.rename_tables(env.cr, _table_renames) diff --git a/fieldservice_account/models/__init__.py b/fieldservice_account/models/__init__.py index 2c8c276534..816289ec31 100644 --- a/fieldservice_account/models/__init__.py +++ b/fieldservice_account/models/__init__.py @@ -1,7 +1,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import ( - account_invoice, - account_invoice_line, + account_move, + account_move_line, fsm_order, ) diff --git a/fieldservice_account/models/account_invoice.py b/fieldservice_account/models/account_move.py similarity index 85% rename from fieldservice_account/models/account_invoice.py rename to fieldservice_account/models/account_move.py index 6ef1e1900d..7143846871 100644 --- a/fieldservice_account/models/account_invoice.py +++ b/fieldservice_account/models/account_move.py @@ -1,16 +1,16 @@ -# 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", - "fsm_order_account_invoice_rel", + "fsm_order_account_move_rel", "invoice_id", "fsm_order_id", string="FSM Orders", @@ -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_move_line.py similarity index 74% rename from fieldservice_account/models/account_invoice_line.py rename to fieldservice_account/models/account_move_line.py index 216d104ecc..574852ef01 100644 --- a/fieldservice_account/models/account_invoice_line.py +++ b/fieldservice_account/models/account_move_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..7c34315ddd 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"} @@ -30,6 +30,5 @@ def setUp(self): "email": "tp@email.com", "partner_id": self.test_loc_partner.id, "owner_id": self.test_loc_partner.id, - "customer_id": self.test_loc_partner.id, } ) diff --git a/fieldservice_account/views/account_invoice.xml b/fieldservice_account/views/account_move.xml similarity index 78% rename from fieldservice_account/views/account_invoice.xml rename to fieldservice_account/views/account_move.xml index a3853ed00d..66f015779a 100644 --- a/fieldservice_account/views/account_invoice.xml +++ b/fieldservice_account/views/account_move.xml @@ -1,8 +1,8 @@ FSM order.invoice.form - account.invoice - + account.move +
+ From 09d567343212c3efd016dd938954845366a264f6 Mon Sep 17 00:00:00 2001 From: Freni-OSI Date: Wed, 14 Apr 2021 16:25:02 +0530 Subject: [PATCH 65/99] Weblate (Turkish) Currently translated at 100.0% (14 of 14 strings) Translation: field-service-14.0/field-service-14.0-fieldservice_account Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_account/tr/ --- fieldservice_account/README.rst | 10 +- fieldservice_account/__manifest__.py | 2 +- .../i18n/fieldservice_account.pot | 37 ++++++- fieldservice_account/i18n/pt_BR.po | 20 ++-- fieldservice_account/i18n/tr.po | 99 +++++++++++++++++++ .../migrations/13.0.1.0.0/pre-migration.py | 21 ---- .../migrations/13.0.2.0.0/post-migration.py | 19 ---- .../migrations/13.0.2.0.0/pre-migration.py | 13 --- fieldservice_account/models/fsm_order.py | 2 +- .../static/description/index.html | 6 +- 10 files changed, 154 insertions(+), 75 deletions(-) create mode 100644 fieldservice_account/i18n/tr.po delete mode 100644 fieldservice_account/migrations/13.0.1.0.0/pre-migration.py delete mode 100644 fieldservice_account/migrations/13.0.2.0.0/post-migration.py delete mode 100644 fieldservice_account/migrations/13.0.2.0.0/pre-migration.py diff --git a/fieldservice_account/README.rst b/fieldservice_account/README.rst index 40f80b13a6..ce02a4f311 100644 --- a/fieldservice_account/README.rst +++ b/fieldservice_account/README.rst @@ -14,13 +14,13 @@ Field Service - Accounting :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github - :target: https://github.com/OCA/field-service/tree/13.0/fieldservice_account + :target: https://github.com/OCA/field-service/tree/14.0/fieldservice_account :alt: OCA/field-service .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/field-service-13-0/field-service-13-0-fieldservice_account + :target: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_account :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/264/13.0 + :target: https://runbot.odoo-community.org/runbot/264/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -53,7 +53,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -107,6 +107,6 @@ Current `maintainers `__: |maintainer-osimallen| |maintainer-brian10048| |maintainer-bodedra| -This module is part of the `OCA/field-service `_ project on GitHub. +This module is part of the `OCA/field-service `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index fc48a25ce5..368e5b536c 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": "13.0.2.0.0", + "version": "14.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/i18n/fieldservice_account.pot b/fieldservice_account/i18n/fieldservice_account.pot index 201883b27e..f3c15cf288 100644 --- a/fieldservice_account/i18n/fieldservice_account.pot +++ b/fieldservice_account/i18n/fieldservice_account.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -14,8 +14,21 @@ msgstr "" "Plural-Forms: \n" #. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name +msgid "Display Name" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count +msgid "FSM Order Count" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" @@ -32,10 +45,18 @@ msgid "Field Service Orders" msgstr "" #. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id +msgid "ID" +msgstr "" + #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -58,10 +79,22 @@ msgstr "" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move -msgid "Journal Entries" +msgid "Journal Entry" msgstr "" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move_line msgid "Journal Item" msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update +msgid "Last Modified on" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name +msgid "Order" +msgstr "" diff --git a/fieldservice_account/i18n/pt_BR.po b/fieldservice_account/i18n/pt_BR.po index 0c8846ef96..24f169a52c 100644 --- a/fieldservice_account/i18n/pt_BR.po +++ b/fieldservice_account/i18n/pt_BR.po @@ -6,15 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2020-06-17 22:19+0000\n" -"Last-Translator: Fernando Colus \n" +"PO-Revision-Date: 2021-06-08 21:48+0000\n" +"Last-Translator: Eder Brito \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 3.10\n" +"X-Generator: Weblate 4.3.2\n" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count @@ -22,7 +22,7 @@ msgstr "" #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" -msgstr "Ordens FSM (Field Service Management)" +msgstr "Ordens de Serviço" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_fsm_order @@ -37,7 +37,7 @@ msgstr "Ordens de Serviço de Campo" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids msgid "Field Service orders associated to this invoice" -msgstr "" +msgstr "Ordens de Serviço de Campo associadas a esta fatura" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count @@ -47,27 +47,27 @@ msgstr "Contagem de Faturas" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_lines msgid "Invoice Lines" -msgstr "" +msgstr "Linhas de Fatura" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_ids msgid "Invoices" -msgstr "" +msgstr "Faturas" #. module: fieldservice_account #: model_terms:ir.ui.view,arch_db:fieldservice_account.view_fsm_order_form_inherit_account msgid "Invoices/Bills" -msgstr "Faturas / Contas" +msgstr "Faturas/Contas" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move msgid "Journal Entries" -msgstr "" +msgstr "Lançamentos de Diário" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move_line msgid "Journal Item" -msgstr "" +msgstr "Item de Diário" #~ msgid "FSM Order" #~ msgstr "Ordem FSM (Field Service Management)" diff --git a/fieldservice_account/i18n/tr.po b/fieldservice_account/i18n/tr.po new file mode 100644 index 0000000000..62093a1cbf --- /dev/null +++ b/fieldservice_account/i18n/tr.po @@ -0,0 +1,99 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-07-09 21:48+0000\n" +"Last-Translator: Ediz Duman \n" +"Language-Team: none\n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name +msgid "Display Name" +msgstr "Görünüm Adı" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count +#: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form +#: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso +msgid "FSM Orders" +msgstr "FSM Siparişleri" + +#. module: fieldservice_account +#: model:ir.model,name:fieldservice_account.model_fsm_order +msgid "Field Service Order" +msgstr "Saha Servis Siparişi" + +#. module: fieldservice_account +#: model_terms:ir.ui.view,arch_db:fieldservice_account.vendor_bill_form_view_fso +msgid "Field Service Orders" +msgstr "Saha Servis Siparişleri" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids +msgid "Field Service orders associated to this invoice" +msgstr "Bu faturayla ilişkili Saha Servisi siparişleri" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id +msgid "ID" +msgstr "ID" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count +msgid "Invoice Count" +msgstr "Fatura Sayısı" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_lines +msgid "Invoice Lines" +msgstr "Fatura Satırları" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_ids +msgid "Invoices" +msgstr "Faturalar" + +#. module: fieldservice_account +#: model_terms:ir.ui.view,arch_db:fieldservice_account.view_fsm_order_form_inherit_account +msgid "Invoices/Bills" +msgstr "M Faturalar/ T Faturalar" + +#. module: fieldservice_account +#: model:ir.model,name:fieldservice_account.model_account_move +msgid "Journal Entry" +msgstr "Yevmiye Girişi" + +#. module: fieldservice_account +#: model:ir.model,name:fieldservice_account.model_account_move_line +msgid "Journal Item" +msgstr "Yevmiye Öğesi" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update +msgid "Last Modified on" +msgstr "Son Düzenlenme" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name +msgid "Order" +msgstr "Sipariş" diff --git a/fieldservice_account/migrations/13.0.1.0.0/pre-migration.py b/fieldservice_account/migrations/13.0.1.0.0/pre-migration.py deleted file mode 100644 index 57e48a5e8e..0000000000 --- a/fieldservice_account/migrations/13.0.1.0.0/pre-migration.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (C) 2020 Brian McMaster -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from openupgradelib import openupgrade - -_model_renames = [ - ("account.invoice", "account.move"), - ("account.invoice.line", "account.move.line"), -] - -_table_renames = [ - ("account.invoice", "account.move"), - ("account.invoice.line", "account.move.line"), - ("fsm_order_account_invoice_rel", "fsm_order_account_move_rel"), -] - - -@openupgrade.migrate() -def migrate(env, version): - openupgrade.rename_models(env.cr, _model_renames) - openupgrade.rename_tables(env.cr, _table_renames) diff --git a/fieldservice_account/migrations/13.0.2.0.0/post-migration.py b/fieldservice_account/migrations/13.0.2.0.0/post-migration.py deleted file mode 100644 index 690f03f5e8..0000000000 --- a/fieldservice_account/migrations/13.0.2.0.0/post-migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2020 Akretion -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from openupgradelib import openupgrade - - -def _field_type_change(env): - openupgrade.m2o_to_x2m( - env.cr, - env["account.move.line"], - "account_move_line", - "fsm_order_ids", - openupgrade.get_legacy_name("fsm_order_id"), - ) - - -@openupgrade.migrate() -def migrate(env, version): - _field_type_change(env) diff --git a/fieldservice_account/migrations/13.0.2.0.0/pre-migration.py b/fieldservice_account/migrations/13.0.2.0.0/pre-migration.py deleted file mode 100644 index c17c05a826..0000000000 --- a/fieldservice_account/migrations/13.0.2.0.0/pre-migration.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2020 Akretion -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from openupgradelib import openupgrade - -column_renames = { - "account_move_line": [("fsm_order_id", None)], -} - - -@openupgrade.migrate() -def migrate(env, version): - openupgrade.rename_columns(env.cr, column_renames) diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index 7c8eb7592c..5b8b43271f 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -34,7 +34,7 @@ class FSMOrder(models.Model): def _compute_get_invoiced(self): for order in self: invoices = order.invoice_lines.mapped("move_id").filtered( - lambda r: r.type in ("out_invoice", "out_refund") + lambda r: r.move_type in ("out_invoice", "out_refund") ) order.invoice_ids = invoices order.invoice_count = len(invoices) diff --git a/fieldservice_account/static/description/index.html b/fieldservice_account/static/description/index.html index dfc01517fe..48ed57baac 100644 --- a/fieldservice_account/static/description/index.html +++ b/fieldservice_account/static/description/index.html @@ -367,7 +367,7 @@

Field Service - Accounting

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/field-service Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/field-service Translate me on Weblate Try me on Runbot

This module adds the ability to link field service orders to invoices.

Table of contents

@@ -402,7 +402,7 @@

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.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -438,7 +438,7 @@

Maintainers

promote its widespread use.

Current maintainers:

osimallen brian10048 bodedra

-

This module is part of the OCA/field-service project on GitHub.

+

This module is part of the OCA/field-service project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

From 76393fc7006880f2b0117d2d8164b1bd7bf25df8 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Tue, 27 Jul 2021 19:55:52 +0000 Subject: [PATCH 66/99] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: field-service-14.0/field-service-14.0-fieldservice_account Translate-URL: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_account/ --- fieldservice_account/i18n/de.po | 41 +++++++++++++++++++++++----- fieldservice_account/i18n/es.po | 38 +++++++++++++++++++++++--- fieldservice_account/i18n/es_CL.po | 38 +++++++++++++++++++++++--- fieldservice_account/i18n/it.po | 35 +++++++++++++++++++++++- fieldservice_account/i18n/pt_BR.po | 43 ++++++++++++++++++++++++++---- fieldservice_account/i18n/tr.po | 8 ++++-- 6 files changed, 181 insertions(+), 22 deletions(-) diff --git a/fieldservice_account/i18n/de.po b/fieldservice_account/i18n/de.po index 7488b8358b..98537fa4a5 100644 --- a/fieldservice_account/i18n/de.po +++ b/fieldservice_account/i18n/de.po @@ -17,8 +17,22 @@ msgstr "" "X-Generator: Weblate 3.8\n" #. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name +msgid "Display Name" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count +#, fuzzy +msgid "FSM Order Count" +msgstr "Field-Service-Auftrag" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso #, fuzzy @@ -37,10 +51,18 @@ msgid "Field Service Orders" msgstr "Field-Service-Auftrag" #. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id +msgid "ID" +msgstr "" + #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -63,7 +85,7 @@ msgstr "" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move -msgid "Journal Entries" +msgid "Journal Entry" msgstr "" #. module: fieldservice_account @@ -71,12 +93,19 @@ msgstr "" msgid "Journal Item" msgstr "" -#~ msgid "FSM Order" -#~ msgstr "Field-Service-Auftrag" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update +msgid "Last Modified on" +msgstr "" -#, fuzzy -#~| msgid "FSM Order" -#~ msgid "FSM Order Count" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name +msgid "Order" +msgstr "" + +#~ msgid "FSM Order" #~ msgstr "Field-Service-Auftrag" #~ msgid "Analytic Account" diff --git a/fieldservice_account/i18n/es.po b/fieldservice_account/i18n/es.po index ca07ffce3b..8ba176da45 100644 --- a/fieldservice_account/i18n/es.po +++ b/fieldservice_account/i18n/es.po @@ -17,8 +17,21 @@ msgstr "" "X-Generator: Weblate 3.10\n" #. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name +msgid "Display Name" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count +msgid "FSM Order Count" +msgstr "Cuenta Orden FSM" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" @@ -35,10 +48,18 @@ msgid "Field Service Orders" msgstr "Pedidos de Servicio de Campo" #. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id +msgid "ID" +msgstr "" + #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -61,7 +82,7 @@ msgstr "Facturas" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move -msgid "Journal Entries" +msgid "Journal Entry" msgstr "" #. module: fieldservice_account @@ -69,12 +90,21 @@ msgstr "" msgid "Journal Item" msgstr "" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update +msgid "Last Modified on" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name +msgid "Order" +msgstr "" + #~ msgid "FSM Order" #~ msgstr "Orden FSM" -#~ msgid "FSM Order Count" -#~ msgstr "Cuenta Orden FSM" - #~ msgid "Invoice" #~ msgstr "Factura" diff --git a/fieldservice_account/i18n/es_CL.po b/fieldservice_account/i18n/es_CL.po index cdb2aa440c..6b45d8c266 100644 --- a/fieldservice_account/i18n/es_CL.po +++ b/fieldservice_account/i18n/es_CL.po @@ -17,8 +17,21 @@ msgstr "" "X-Generator: Weblate 3.10\n" #. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name +msgid "Display Name" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count +msgid "FSM Order Count" +msgstr "Cuenta Pedidos FSM" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" @@ -35,10 +48,18 @@ msgid "Field Service Orders" msgstr "Pedidos de Servicio de Campo" #. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id +msgid "ID" +msgstr "" + #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -61,7 +82,7 @@ msgstr "Facturas/Boletas" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move -msgid "Journal Entries" +msgid "Journal Entry" msgstr "" #. module: fieldservice_account @@ -69,12 +90,21 @@ msgstr "" msgid "Journal Item" msgstr "" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update +msgid "Last Modified on" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name +msgid "Order" +msgstr "" + #~ msgid "FSM Order" #~ msgstr "Pedido FSM" -#~ msgid "FSM Order Count" -#~ msgstr "Cuenta Pedidos FSM" - #~ msgid "Invoice" #~ msgstr "Factura" diff --git a/fieldservice_account/i18n/it.po b/fieldservice_account/i18n/it.po index a2515250d4..0c24aa131a 100644 --- a/fieldservice_account/i18n/it.po +++ b/fieldservice_account/i18n/it.po @@ -17,8 +17,21 @@ msgstr "" "X-Generator: Weblate 3.10\n" #. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name +msgid "Display Name" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count +msgid "FSM Order Count" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" @@ -35,10 +48,18 @@ msgid "Field Service Orders" msgstr "" #. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id +msgid "ID" +msgstr "" + #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -61,7 +82,7 @@ msgstr "Fatture" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move -msgid "Journal Entries" +msgid "Journal Entry" msgstr "" #. module: fieldservice_account @@ -69,6 +90,18 @@ msgstr "" msgid "Journal Item" msgstr "" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update +msgid "Last Modified on" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name +msgid "Order" +msgstr "" + #~ msgid "Invoice" #~ msgstr "Fattura" diff --git a/fieldservice_account/i18n/pt_BR.po b/fieldservice_account/i18n/pt_BR.po index 24f169a52c..958ef7a6f5 100644 --- a/fieldservice_account/i18n/pt_BR.po +++ b/fieldservice_account/i18n/pt_BR.po @@ -17,8 +17,21 @@ msgstr "" "X-Generator: Weblate 4.3.2\n" #. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name +msgid "Display Name" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count +msgid "FSM Order Count" +msgstr "Contagem de Ordens do FSM (Field Service Management)" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" @@ -35,10 +48,18 @@ msgid "Field Service Orders" msgstr "Ordens de Serviço de Campo" #. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "Ordens de Serviço de Campo associadas a esta fatura" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id +msgid "ID" +msgstr "" + #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -61,20 +82,32 @@ msgstr "Faturas/Contas" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move -msgid "Journal Entries" -msgstr "Lançamentos de Diário" +msgid "Journal Entry" +msgstr "" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move_line msgid "Journal Item" msgstr "Item de Diário" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update +msgid "Last Modified on" +msgstr "" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name +msgid "Order" +msgstr "" + +#~ msgid "Journal Entries" +#~ msgstr "Lançamentos de Diário" + #~ msgid "FSM Order" #~ msgstr "Ordem FSM (Field Service Management)" -#~ msgid "FSM Order Count" -#~ msgstr "Contagem de Ordens do FSM (Field Service Management)" - #~ msgid "Invoice" #~ msgstr "Fatura" diff --git a/fieldservice_account/i18n/tr.po b/fieldservice_account/i18n/tr.po index 62093a1cbf..3a6c87b6a5 100644 --- a/fieldservice_account/i18n/tr.po +++ b/fieldservice_account/i18n/tr.po @@ -22,11 +22,16 @@ msgstr "" msgid "Display Name" msgstr "Görünüm Adı" +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count +msgid "FSM Order Count" +msgstr "" + #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" @@ -45,7 +50,6 @@ msgstr "Saha Servis Siparişleri" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "Bu faturayla ilişkili Saha Servisi siparişleri" From 208e59e89d2476ec59a5943f90018d0ebd3a8a65 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 28 Jul 2021 20:27:09 +0200 Subject: [PATCH 67/99] [FIX] fieldservice_account: Restrict views to authorized groups Not putting groups on the view makes the rest of the users that access to these views to receive a permission error. It's also not enough to put the groups on the field, but the view. --- fieldservice_account/__manifest__.py | 2 +- fieldservice_account/i18n/es_AR.po | 103 ++++++++++++++++++++ fieldservice_account/i18n/it.po | 32 +++--- fieldservice_account/i18n/pt_BR.po | 14 +-- fieldservice_account/views/account_move.xml | 5 +- fieldservice_account/views/fsm_order.xml | 1 + 6 files changed, 132 insertions(+), 25 deletions(-) create mode 100644 fieldservice_account/i18n/es_AR.po diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index 368e5b536c..618d038c4c 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": "14.0.1.0.0", + "version": "14.0.1.1.0", "category": "Field Service", "author": "Open Source Integrators, Odoo Community Association (OCA)", "website": "https://github.com/OCA/field-service", diff --git a/fieldservice_account/i18n/es_AR.po b/fieldservice_account/i18n/es_AR.po new file mode 100644 index 0000000000..0ad2ba5e92 --- /dev/null +++ b/fieldservice_account/i18n/es_AR.po @@ -0,0 +1,103 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-10-03 21:34+0000\n" +"Last-Translator: Ignacio Buioli \n" +"Language-Team: none\n" +"Language: es_AR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name +msgid "Display Name" +msgstr "Mostrar Nombre" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count +msgid "FSM Order Count" +msgstr "Cuenta de los Pedidos FSM" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids +#: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form +#: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso +msgid "FSM Orders" +msgstr "Pedidos FSM" + +#. module: fieldservice_account +#: model:ir.model,name:fieldservice_account.model_fsm_order +msgid "Field Service Order" +msgstr "Pedido de Servicio de Campo" + +#. module: fieldservice_account +#: model_terms:ir.ui.view,arch_db:fieldservice_account.vendor_bill_form_view_fso +msgid "Field Service Orders" +msgstr "Pedidos de Servicio de Campo" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids +msgid "Field Service orders associated to this invoice" +msgstr "Pedidos de servicio de campo asociados a esta factura" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id +msgid "ID" +msgstr "ID" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count +msgid "Invoice Count" +msgstr "Cuenta de Factura" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_lines +msgid "Invoice Lines" +msgstr "Líneas de Factura" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_ids +msgid "Invoices" +msgstr "Facturas" + +#. module: fieldservice_account +#: model_terms:ir.ui.view,arch_db:fieldservice_account.view_fsm_order_form_inherit_account +msgid "Invoices/Bills" +msgstr "Facturas" + +#. module: fieldservice_account +#: model:ir.model,name:fieldservice_account.model_account_move +msgid "Journal Entry" +msgstr "Asiento Contable" + +#. module: fieldservice_account +#: model:ir.model,name:fieldservice_account.model_account_move_line +msgid "Journal Item" +msgstr "Apunte Contable" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update +msgid "Last Modified on" +msgstr "Última Modificación el" + +#. module: fieldservice_account +#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name +msgid "Order" +msgstr "Pedido" diff --git a/fieldservice_account/i18n/it.po b/fieldservice_account/i18n/it.po index 0c24aa131a..c37abc9bae 100644 --- a/fieldservice_account/i18n/it.po +++ b/fieldservice_account/i18n/it.po @@ -6,26 +6,26 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2020-06-09 01:19+0000\n" -"Last-Translator: Sergio Zanchetta \n" +"PO-Revision-Date: 2021-09-26 20:34+0000\n" +"Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.10\n" +"X-Generator: Weblate 4.3.2\n" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name msgid "Display Name" -msgstr "" +msgstr "Nome visualizzato" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count msgid "FSM Order Count" -msgstr "" +msgstr "Conteggio ordine FSM" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count @@ -35,30 +35,30 @@ msgstr "" #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" -msgstr "" +msgstr "Ordini FSM" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_fsm_order msgid "Field Service Order" -msgstr "" +msgstr "Ordine assistenza sul campo" #. module: fieldservice_account #: model_terms:ir.ui.view,arch_db:fieldservice_account.vendor_bill_form_view_fso msgid "Field Service Orders" -msgstr "" +msgstr "Ordini assistenza sul campo" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids msgid "Field Service orders associated to this invoice" -msgstr "" +msgstr "Ordini assistenza sul campo associati a questa fattura" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id msgid "ID" -msgstr "" +msgstr "ID" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count @@ -68,12 +68,12 @@ msgstr "Numero fatture" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_lines msgid "Invoice Lines" -msgstr "" +msgstr "Righe fattura" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_ids msgid "Invoices" -msgstr "" +msgstr "Fatture" #. module: fieldservice_account #: model_terms:ir.ui.view,arch_db:fieldservice_account.view_fsm_order_form_inherit_account @@ -83,24 +83,24 @@ msgstr "Fatture" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move msgid "Journal Entry" -msgstr "" +msgstr "Registrazione contabile" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move_line msgid "Journal Item" -msgstr "" +msgstr "Movimento contabile" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update msgid "Last Modified on" -msgstr "" +msgstr "Ultima modifica il" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name msgid "Order" -msgstr "" +msgstr "Ordine" #~ msgid "Invoice" #~ msgstr "Fattura" diff --git a/fieldservice_account/i18n/pt_BR.po b/fieldservice_account/i18n/pt_BR.po index 958ef7a6f5..f80054e10f 100644 --- a/fieldservice_account/i18n/pt_BR.po +++ b/fieldservice_account/i18n/pt_BR.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2021-06-08 21:48+0000\n" -"Last-Translator: Eder Brito \n" +"PO-Revision-Date: 2021-12-08 22:39+0000\n" +"Last-Translator: marcos-mendez \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" @@ -20,7 +20,7 @@ msgstr "" #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name msgid "Display Name" -msgstr "" +msgstr "Nome Exibido" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count @@ -58,7 +58,7 @@ msgstr "Ordens de Serviço de Campo associadas a esta fatura" #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id msgid "ID" -msgstr "" +msgstr "ID" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count @@ -83,7 +83,7 @@ msgstr "Faturas/Contas" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move msgid "Journal Entry" -msgstr "" +msgstr "Entrada de diário" #. module: fieldservice_account #: model:ir.model,name:fieldservice_account.model_account_move_line @@ -95,12 +95,12 @@ msgstr "Item de Diário" #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update msgid "Last Modified on" -msgstr "" +msgstr "Última modificação em" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name msgid "Order" -msgstr "" +msgstr "Pedido" #~ msgid "Journal Entries" #~ msgstr "Lançamentos de Diário" diff --git a/fieldservice_account/views/account_move.xml b/fieldservice_account/views/account_move.xml index 66f015779a..53b02bc587 100644 --- a/fieldservice_account/views/account_move.xml +++ b/fieldservice_account/views/account_move.xml @@ -3,6 +3,7 @@ FSM order.invoice.form account.move +
From e704e867d9fb371001ee50224cab8fd6d0cdef8b Mon Sep 17 00:00:00 2001 From: Weblate Date: Thu, 27 Oct 2022 15:12:16 +0000 Subject: [PATCH 72/99] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: field-service-15.0/field-service-15.0-fieldservice_account Translate-URL: https://translation.odoo-community.org/projects/field-service-15-0/field-service-15-0-fieldservice_account/ --- fieldservice_account/i18n/de.po | 36 ++++-------------------- fieldservice_account/i18n/es.po | 34 +++-------------------- fieldservice_account/i18n/es_AR.po | 44 ++++++++++-------------------- fieldservice_account/i18n/es_CL.po | 34 +++-------------------- fieldservice_account/i18n/it.po | 44 ++++++++++-------------------- fieldservice_account/i18n/pt_BR.po | 44 ++++++++++-------------------- fieldservice_account/i18n/tr.po | 41 ++++++++-------------------- 7 files changed, 70 insertions(+), 207 deletions(-) diff --git a/fieldservice_account/i18n/de.po b/fieldservice_account/i18n/de.po index 98537fa4a5..20a6dafbc1 100644 --- a/fieldservice_account/i18n/de.po +++ b/fieldservice_account/i18n/de.po @@ -16,23 +16,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 3.8\n" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name -msgid "Display Name" -msgstr "" - -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count -#, fuzzy -msgid "FSM Order Count" -msgstr "Field-Service-Auftrag" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso #, fuzzy @@ -53,16 +41,10 @@ msgstr "Field-Service-Auftrag" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id -msgid "ID" -msgstr "" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -93,17 +75,9 @@ msgstr "" msgid "Journal Item" msgstr "" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update -msgid "Last Modified on" -msgstr "" - -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name -msgid "Order" -msgstr "" +#, fuzzy +#~ msgid "FSM Order Count" +#~ msgstr "Field-Service-Auftrag" #~ msgid "FSM Order" #~ msgstr "Field-Service-Auftrag" diff --git a/fieldservice_account/i18n/es.po b/fieldservice_account/i18n/es.po index 8ba176da45..62b712c943 100644 --- a/fieldservice_account/i18n/es.po +++ b/fieldservice_account/i18n/es.po @@ -16,22 +16,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 3.10\n" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name -msgid "Display Name" -msgstr "" - -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count -msgid "FSM Order Count" -msgstr "Cuenta Orden FSM" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" @@ -50,16 +39,10 @@ msgstr "Pedidos de Servicio de Campo" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id -msgid "ID" -msgstr "" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -90,17 +73,8 @@ msgstr "" msgid "Journal Item" msgstr "" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update -msgid "Last Modified on" -msgstr "" - -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name -msgid "Order" -msgstr "" +#~ msgid "FSM Order Count" +#~ msgstr "Cuenta Orden FSM" #~ msgid "FSM Order" #~ msgstr "Orden FSM" diff --git a/fieldservice_account/i18n/es_AR.po b/fieldservice_account/i18n/es_AR.po index 0ad2ba5e92..1defa4bbca 100644 --- a/fieldservice_account/i18n/es_AR.po +++ b/fieldservice_account/i18n/es_AR.po @@ -16,22 +16,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.3.2\n" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name -msgid "Display Name" -msgstr "Mostrar Nombre" - -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count -msgid "FSM Order Count" -msgstr "Cuenta de los Pedidos FSM" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" @@ -50,16 +39,10 @@ msgstr "Pedidos de Servicio de Campo" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "Pedidos de servicio de campo asociados a esta factura" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id -msgid "ID" -msgstr "ID" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -90,14 +73,17 @@ msgstr "Asiento Contable" msgid "Journal Item" msgstr "Apunte Contable" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update -msgid "Last Modified on" -msgstr "Última Modificación el" +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name -msgid "Order" -msgstr "Pedido" +#~ msgid "FSM Order Count" +#~ msgstr "Cuenta de los Pedidos FSM" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" + +#~ msgid "Order" +#~ msgstr "Pedido" diff --git a/fieldservice_account/i18n/es_CL.po b/fieldservice_account/i18n/es_CL.po index 6b45d8c266..ddd2f574a6 100644 --- a/fieldservice_account/i18n/es_CL.po +++ b/fieldservice_account/i18n/es_CL.po @@ -16,22 +16,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 3.10\n" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name -msgid "Display Name" -msgstr "" - -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count -msgid "FSM Order Count" -msgstr "Cuenta Pedidos FSM" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" @@ -50,16 +39,10 @@ msgstr "Pedidos de Servicio de Campo" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id -msgid "ID" -msgstr "" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -90,17 +73,8 @@ msgstr "" msgid "Journal Item" msgstr "" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update -msgid "Last Modified on" -msgstr "" - -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name -msgid "Order" -msgstr "" +#~ msgid "FSM Order Count" +#~ msgstr "Cuenta Pedidos FSM" #~ msgid "FSM Order" #~ msgstr "Pedido FSM" diff --git a/fieldservice_account/i18n/it.po b/fieldservice_account/i18n/it.po index c37abc9bae..013076207e 100644 --- a/fieldservice_account/i18n/it.po +++ b/fieldservice_account/i18n/it.po @@ -16,22 +16,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.3.2\n" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name -msgid "Display Name" -msgstr "Nome visualizzato" - -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count -msgid "FSM Order Count" -msgstr "Conteggio ordine FSM" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" @@ -50,16 +39,10 @@ msgstr "Ordini assistenza sul campo" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "Ordini assistenza sul campo associati a questa fattura" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id -msgid "ID" -msgstr "ID" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -90,17 +73,20 @@ msgstr "Registrazione contabile" msgid "Journal Item" msgstr "Movimento contabile" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update -msgid "Last Modified on" -msgstr "Ultima modifica il" +#~ msgid "Display Name" +#~ msgstr "Nome visualizzato" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name -msgid "Order" -msgstr "Ordine" +#~ msgid "FSM Order Count" +#~ msgstr "Conteggio ordine FSM" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima modifica il" + +#~ msgid "Order" +#~ msgstr "Ordine" #~ msgid "Invoice" #~ msgstr "Fattura" diff --git a/fieldservice_account/i18n/pt_BR.po b/fieldservice_account/i18n/pt_BR.po index f80054e10f..8dfec78032 100644 --- a/fieldservice_account/i18n/pt_BR.po +++ b/fieldservice_account/i18n/pt_BR.po @@ -16,22 +16,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Weblate 4.3.2\n" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name -msgid "Display Name" -msgstr "Nome Exibido" - -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count -msgid "FSM Order Count" -msgstr "Contagem de Ordens do FSM (Field Service Management)" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" @@ -50,16 +39,10 @@ msgstr "Ordens de Serviço de Campo" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "Ordens de Serviço de Campo associadas a esta fatura" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id -msgid "ID" -msgstr "ID" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -90,17 +73,20 @@ msgstr "Entrada de diário" msgid "Journal Item" msgstr "Item de Diário" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update -msgid "Last Modified on" -msgstr "Última modificação em" +#~ msgid "Display Name" +#~ msgstr "Nome Exibido" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name -msgid "Order" -msgstr "Pedido" +#~ msgid "FSM Order Count" +#~ msgstr "Contagem de Ordens do FSM (Field Service Management)" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última modificação em" + +#~ msgid "Order" +#~ msgstr "Pedido" #~ msgid "Journal Entries" #~ msgstr "Lançamentos de Diário" diff --git a/fieldservice_account/i18n/tr.po b/fieldservice_account/i18n/tr.po index 3a6c87b6a5..2c4251d0ac 100644 --- a/fieldservice_account/i18n/tr.po +++ b/fieldservice_account/i18n/tr.po @@ -16,22 +16,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.3.2\n" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__display_name -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__display_name -msgid "Display Name" -msgstr "Görünüm Adı" - -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count -msgid "FSM Order Count" -msgstr "" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_count #: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__fsm_order_ids -#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_count #: model_terms:ir.ui.view,arch_db:fieldservice_account.account_invoice_form #: model_terms:ir.ui.view,arch_db:fieldservice_account.invoice_search_view_fso msgid "FSM Orders" @@ -50,16 +39,10 @@ msgstr "Saha Servis Siparişleri" #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_account_bank_statement_line__fsm_order_ids #: model:ir.model.fields,field_description:fieldservice_account.field_account_move__fsm_order_ids +#: model:ir.model.fields,field_description:fieldservice_account.field_account_payment__fsm_order_ids msgid "Field Service orders associated to this invoice" msgstr "Bu faturayla ilişkili Saha Servisi siparişleri" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move__id -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line__id -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__id -msgid "ID" -msgstr "ID" - #. module: fieldservice_account #: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__invoice_count msgid "Invoice Count" @@ -90,14 +73,14 @@ msgstr "Yevmiye Girişi" msgid "Journal Item" msgstr "Yevmiye Öğesi" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_account_move_line____last_update -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order____last_update -msgid "Last Modified on" -msgstr "Son Düzenlenme" +#~ msgid "Display Name" +#~ msgstr "Görünüm Adı" -#. module: fieldservice_account -#: model:ir.model.fields,field_description:fieldservice_account.field_fsm_order__display_name -msgid "Order" -msgstr "Sipariş" +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Son Düzenlenme" + +#~ msgid "Order" +#~ msgstr "Sipariş" From 7ff124f2800789077f0ca0851a5c582e3950eb5c Mon Sep 17 00:00:00 2001 From: Goncalo Brito Date: Fri, 28 Oct 2022 10:04:16 +0200 Subject: [PATCH 73/99] [MIG] fieldservice_account: Migration to 16.0 --- fieldservice_account/__manifest__.py | 2 +- fieldservice_account/models/account_move.py | 5 ++++- fieldservice_account/models/fsm_order.py | 5 ++++- fieldservice_account/tests/test_fsm_account.py | 11 +++++++---- fieldservice_account/views/account_move.xml | 16 ++++++++++------ fieldservice_account/views/fsm_order.xml | 1 - 6 files changed, 26 insertions(+), 14 deletions(-) diff --git a/fieldservice_account/__manifest__.py b/fieldservice_account/__manifest__.py index 96c2dd8d83..690a1597b5 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": "15.0.1.0.0", + "version": "16.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_move.py b/fieldservice_account/models/account_move.py index b28051feb6..5c2e1061fb 100644 --- a/fieldservice_account/models/account_move.py +++ b/fieldservice_account/models/account_move.py @@ -27,7 +27,10 @@ def _compute_fsm_order_ids(self): order.fsm_order_count = len(order.fsm_order_ids) def action_view_fsm_orders(self): - action = self.env.ref("fieldservice.action_fsm_dash_order").read()[0] + self.ensure_one() + action = self.env["ir.actions.act_window"]._for_xml_id( + "fieldservice.action_fsm_dash_order" + ) if self.fsm_order_count > 1: action["domain"] = [("id", "in", self.fsm_order_ids.ids)] elif self.fsm_order_ids: diff --git a/fieldservice_account/models/fsm_order.py b/fieldservice_account/models/fsm_order.py index 74a725063e..b028f6a142 100644 --- a/fieldservice_account/models/fsm_order.py +++ b/fieldservice_account/models/fsm_order.py @@ -38,7 +38,10 @@ def _compute_get_invoiced(self): order.invoice_count = len(invoices) def action_view_invoices(self): - action = self.env.ref("account.action_move_out_invoice_type").read()[0] + self.ensure_one() + action = self.env["ir.actions.act_window"]._for_xml_id( + "account.action_move_out_invoice_type" + ) invoices = self.mapped("invoice_ids") if len(invoices) > 1: action["domain"] = [("id", "in", invoices.ids)] diff --git a/fieldservice_account/tests/test_fsm_account.py b/fieldservice_account/tests/test_fsm_account.py index 93e3e33024..43e2c00346 100644 --- a/fieldservice_account/tests/test_fsm_account.py +++ b/fieldservice_account/tests/test_fsm_account.py @@ -50,17 +50,20 @@ def setUp(self): "request_early": datetime.today(), } ) + company = self.env.user.company_id self.default_account_revenue = self.env["account.account"].search( [ - ("company_id", "=", self.env.user.company_id.id), + ("company_id", "=", company.id), + ("account_type", "=", "income"), ( - "user_type_id", - "=", - self.env.ref("account.data_account_type_revenue").id, + "id", + "!=", + company.account_journal_early_pay_discount_gain_account_id.id, ), ], limit=1, ) + self.test_invoice = self.env["account.move"].create( { "partner_id": self.test_partner.id, diff --git a/fieldservice_account/views/account_move.xml b/fieldservice_account/views/account_move.xml index 53b02bc587..eb182283be 100644 --- a/fieldservice_account/views/account_move.xml +++ b/fieldservice_account/views/account_move.xml @@ -3,7 +3,6 @@ FSM order.invoice.form account.move -
From 8b7ba64218234257cf7eb588096d7d8beb8e3073 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 3 Sep 2023 12:55:58 +0000 Subject: [PATCH 77/99] [UPD] README.rst --- fieldservice_account/README.rst | 15 +++--- .../static/description/index.html | 52 ++++++++++--------- 2 files changed, 36 insertions(+), 31 deletions(-) diff --git a/fieldservice_account/README.rst b/fieldservice_account/README.rst index 049e195197..fe2014b3ff 100644 --- a/fieldservice_account/README.rst +++ b/fieldservice_account/README.rst @@ -2,10 +2,13 @@ Field Service - Accounting ========================== -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:293cd66ffb7014c1c36f5e3789cb342ba51a5d5592f31b62270fec6f65fd1911 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ Field Service - Accounting .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/field-service-16-0/field-service-16-0-fieldservice_account :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/264/16.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=16.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module adds the ability to link field service orders to invoices. @@ -52,7 +55,7 @@ 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 +If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback `_. Do not contact contributors directly about support or help with technical issues. diff --git a/fieldservice_account/static/description/index.html b/fieldservice_account/static/description/index.html index 115eb196c8..f9cc14e54c 100644 --- a/fieldservice_account/static/description/index.html +++ b/fieldservice_account/static/description/index.html @@ -1,20 +1,20 @@ - + - + Field Service - Accounting -
-

Field Service - Accounting

+
+ + +Odoo Community Association + +
+

Field Service - Accounting

-

Beta License: AGPL-3 OCA/field-service Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/field-service Translate me on Weblate Try me on Runboat

This module adds the ability to link field service orders to invoices.

Table of contents

@@ -381,58 +386,54 @@

Field Service - Accounting

  • Credits
  • -

    Installation

    +

    Installation

    No special installation instructions

    -

    Configuration

    +

    Configuration

    No special configuration instructions.

    -

    Usage

    +

    Usage

    No specific usage instructions.

    -

    Bug Tracker

    +

    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 to smash it by providing a detailed and welcomed -feedback.

    +feedback.

    Do not contact contributors directly about support or help with technical issues.

    -

    Credits

    +

    Credits

    -

    Authors

    +

    Authors

    • Open Source Integrators
    -

    Contributors

    +

    Contributors

    -
    -

    Other credits

    -

    The development of this module has been financially supported by:

    -
    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    Odoo Community Association @@ -442,10 +443,11 @@

    Maintainers

    promote its widespread use.

    Current maintainers:

    osimallen brian10048 bodedra

    -

    This module is part of the OCA/field-service project on GitHub.

    +

    This module is part of the OCA/field-service project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    +
    diff --git a/fieldservice_account/views/account_move.xml b/fieldservice_account/views/account_move.xml index 852fa5e1ef..b7145c25f3 100644 --- a/fieldservice_account/views/account_move.xml +++ b/fieldservice_account/views/account_move.xml @@ -48,7 +48,7 @@ string="Field Service Orders" groups="fieldservice.group_fsm_user" > - + diff --git a/fieldservice_account/views/fsm_order.xml b/fieldservice_account/views/fsm_order.xml index 6476ef713f..01f08feafd 100644 --- a/fieldservice_account/views/fsm_order.xml +++ b/fieldservice_account/views/fsm_order.xml @@ -9,7 +9,7 @@ type="object" class="oe_stat_button" icon="fa-pencil-square-o" - invisible="invoice_count == 0" + invisible="not invoice_count" groups="account.group_account_invoice" > Date: Mon, 23 Mar 2026 11:12:17 +0700 Subject: [PATCH 99/99] [DON'T MERGE] test-requirements.txt --- test-requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test-requirements.txt diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000000..410bfc9ff4 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo-addon-fieldservice @ git+https://github.com/OCA/field-service.git@refs/pull/1496/head#subdirectory=fieldservice