Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.0] [MIG] fieldservice_account_payment #691

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
219cf79
[WIP][12.0][ADD] fieldservice_account_payment
murtuzasaleh Dec 11, 2019
e4dd20a
[FIX] fieldservice_account_payment
max3903 Dec 19, 2019
6352e7f
[FIX] fieldservice_account_payment
max3903 Dec 20, 2019
5cd98d7
[FIX] fieldservice_account_payment
max3903 Dec 21, 2019
e67e655
[IMP] fieldservice_account_payment
max3903 Dec 22, 2019
de618d9
[IMP] Improved code
murtuzasaleh Dec 23, 2019
3c522ec
[UPD] Update fieldservice_account_payment.pot
oca-travis Jan 2, 2020
4b5254e
[UPD] README.rst
OCA-git-bot Jan 2, 2020
0dc3b9a
Added translation using Weblate (Spanish (Chile))
Jan 16, 2020
e2d8db4
Added translation using Weblate (Spanish)
Jan 16, 2020
f78fe19
Translated using Weblate (Spanish (Chile))
Jan 16, 2020
004d014
[FIX] fieldervice_account_payment
max3903 May 6, 2020
8e1b8e3
[FIX] fieldservice_account_payment
max3903 May 11, 2020
ddfbba6
[FIX] fieldservice_account_payment
max3903 May 12, 2020
b8a9111
Update fieldservice_account_payment/models/account_payment.py
max3903 May 16, 2020
47643c1
fieldservice_account_payment 12.0.1.0.1
OCA-git-bot May 16, 2020
779cc06
Added translation using Weblate (Portuguese (Brazil))
marcelsavegnago May 20, 2020
19506c9
[FIX] fieldservice_account_payment
max3903 May 25, 2020
b6babce
fieldservice_account_payment 12.0.1.1.0
OCA-git-bot May 31, 2020
c07c653
Translated using Weblate (Spanish)
Jun 7, 2020
094aa3b
Translated using Weblate (Portuguese (Brazil))
fcolus Jun 16, 2020
f475bc7
[IMP] fieldservice_account_payment: black, isort, prettier
brian10048 Jan 16, 2021
5783aa1
[MIG] fieldservice_account_payment: Migration to 13.0
brian10048 Jan 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions fieldservice_account_payment/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
==================================
Field Service - Accounting Payment
==================================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |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/12.0/fieldservice_account_payment
: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-12-0/field-service-12-0-fieldservice_account_payment
: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/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows the worker to accept payments during his work at the location.

**Table of contents**

.. contents::
:local:

Installation
============

No special installation instructions

Configuration
=============

No special configuration instructions.

Usage
=====

To use this module, you need to:

* Go to Field Service
* Select or create a Field Service order
* Click on the "Register Payment" button
* Select the Payment Method
* Enter the amount
* Validate

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/field-service/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 <https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_account_payment%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Open Source Integrators

Contributors
~~~~~~~~~~~~

* Maxime Chambreuil <[email protected]>
* Serpent Consulting Services Pvt. Ltd. <[email protected]>

Other credits
~~~~~~~~~~~~~

The development of this module has been financially supported by:

* Open Source Integrators <https://opensourceintegrators.com>
* Serpent Consulting Services Pvt. Ltd. <[email protected]>

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-max3903| image:: https://github.com/max3903.png?size=40px
:target: https://github.com/max3903
:alt: max3903

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-max3903|

This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/12.0/fieldservice_account_payment>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions fieldservice_account_payment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models
20 changes: 20 additions & 0 deletions fieldservice_account_payment/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Field Service - Accounting Payment",
"summary": "Allow workers to collect payments from the order.",
"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/fsm_order.xml",
"views/account_payment.xml",
],
"license": "AGPL-3",
"development_status": "Production/Stable",
"maintainers": ["max3903"],
}
45 changes: 45 additions & 0 deletions fieldservice_account_payment/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fieldservice_account_payment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-06-07 05:19+0000\n"
"Last-Translator: Nelson Ramírez Sánchez <[email protected]>\n"
"Language-Team: none\n"
"Language: es\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"

#. module: fieldservice_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_account_payment__fsm_order_count
msgid "FSM Order Count"
msgstr "Número de Ordenes FSM"

#. module: fieldservice_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_account_payment__fsm_order_ids
#: model_terms:ir.ui.view,arch_db:fieldservice_account_payment.view_account_payment_invoice_form_inherite
msgid "FSM Orders"
msgstr "Ordenes FSM"

#. module: fieldservice_account_payment
#: model:ir.model,name:fieldservice_account_payment.model_fsm_order
msgid "Field Service Order"
msgstr "Pedidos de Servicio de Campo"

#. module: fieldservice_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_fsm_order__payment_count
msgid "Payment Count"
msgstr "Número de Pagos"

#. module: fieldservice_account_payment
#: model:ir.model,name:fieldservice_account_payment.model_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_fsm_order__payment_ids
#: model_terms:ir.ui.view,arch_db:fieldservice_account_payment.view_fsm_order_form_inherit_acct_payment
msgid "Payments"
msgstr "Pagos"
45 changes: 45 additions & 0 deletions fieldservice_account_payment/i18n/es_CL.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fieldservice_account_payment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-01-16 22:38+0000\n"
"Last-Translator: Nelson Ramírez Sánchez <[email protected]>\n"
"Language-Team: none\n"
"Language: es_CL\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"

#. module: fieldservice_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_account_payment__fsm_order_count
msgid "FSM Order Count"
msgstr "Orden FSM Contada"

#. module: fieldservice_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_account_payment__fsm_order_ids
#: model_terms:ir.ui.view,arch_db:fieldservice_account_payment.view_account_payment_invoice_form_inherite
msgid "FSM Orders"
msgstr "Orden FSM"

#. module: fieldservice_account_payment
#: model:ir.model,name:fieldservice_account_payment.model_fsm_order
msgid "Field Service Order"
msgstr "Orden de Servicio de Campo"

#. module: fieldservice_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_fsm_order__payment_count
msgid "Payment Count"
msgstr "Cuenta de Pago"

#. module: fieldservice_account_payment
#: model:ir.model,name:fieldservice_account_payment.model_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_fsm_order__payment_ids
#: model_terms:ir.ui.view,arch_db:fieldservice_account_payment.view_fsm_order_form_inherit_acct_payment
msgid "Payments"
msgstr "Pagos"
43 changes: 43 additions & 0 deletions fieldservice_account_payment/i18n/fieldservice_account_payment.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fieldservice_account_payment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: fieldservice_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_account_payment__fsm_order_count
msgid "FSM Order Count"
msgstr ""

#. module: fieldservice_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_account_payment__fsm_order_ids
#: model_terms:ir.ui.view,arch_db:fieldservice_account_payment.view_account_payment_invoice_form_inherite
msgid "FSM Orders"
msgstr ""

#. module: fieldservice_account_payment
#: model:ir.model,name:fieldservice_account_payment.model_fsm_order
msgid "Field Service Order"
msgstr ""

#. module: fieldservice_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_fsm_order__payment_count
msgid "Payment Count"
msgstr ""

#. module: fieldservice_account_payment
#: model:ir.model,name:fieldservice_account_payment.model_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_fsm_order__payment_ids
#: model_terms:ir.ui.view,arch_db:fieldservice_account_payment.view_fsm_order_form_inherit_acct_payment
msgid "Payments"
msgstr ""

45 changes: 45 additions & 0 deletions fieldservice_account_payment/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fieldservice_account_payment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-06-17 02:19+0000\n"
"Last-Translator: Fernando Colus <[email protected]>\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"

#. module: fieldservice_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_account_payment__fsm_order_count
msgid "FSM Order Count"
msgstr "Contador de Ordens do FSM (Field Services Management)"

#. module: fieldservice_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_account_payment__fsm_order_ids
#: model_terms:ir.ui.view,arch_db:fieldservice_account_payment.view_account_payment_invoice_form_inherite
msgid "FSM Orders"
msgstr "Ordens do FSM (Field Services Management)"

#. module: fieldservice_account_payment
#: model:ir.model,name:fieldservice_account_payment.model_fsm_order
msgid "Field Service Order"
msgstr "Ordem do FSM (Field Services Management)"

#. module: fieldservice_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_fsm_order__payment_count
msgid "Payment Count"
msgstr "Contador de Pagamentos"

#. module: fieldservice_account_payment
#: model:ir.model,name:fieldservice_account_payment.model_account_payment
#: model:ir.model.fields,field_description:fieldservice_account_payment.field_fsm_order__payment_ids
#: model_terms:ir.ui.view,arch_db:fieldservice_account_payment.view_fsm_order_form_inherit_acct_payment
msgid "Payments"
msgstr "Pagamentos"
7 changes: 7 additions & 0 deletions fieldservice_account_payment/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import (
account_payment,
fsm_order,
)
46 changes: 46 additions & 0 deletions fieldservice_account_payment/models/account_payment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models


class AccountPayment(models.Model):
_inherit = "account.payment"

fsm_order_ids = fields.Many2many(
"fsm.order",
"fsm_order_account_payment",
"payment_id",
"fsm_order_id",
string="FSM Orders",
compute="_compute_fsm_order_ids",
store=True,
index=True,
copy=False,
)
fsm_order_count = fields.Integer(
string="FSM Order Count", compute="_compute_fsm_order_count", readonly=True
)

@api.depends("fsm_order_ids")
def _compute_fsm_order_count(self):
for payment in self:
payment.fsm_order_count = len(payment.fsm_order_ids)

def action_view_fsm_orders(self):
action = self.env.ref("fieldservice.action_fsm_operation_order").read()[0]
if self.fsm_order_count > 1:
action["domain"] = [("id", "in", self.fsm_order_ids)]
elif self.fsm_order_ids:
action["views"] = [(self.env.ref("fieldservice.fsm_order_form").id, "form")]
action["res_id"] = self.fsm_order_ids[0].id
return action

@api.depends("move_ids.fsm_order_ids")
def _compute_fsm_order_ids(self):
fsm_order_ids = []
for invoice in self.move_ids:
if invoice.fsm_order_ids:
fsm_order_ids.extend(invoice.fsm_order_ids.ids)
if fsm_order_ids:
self.fsm_order_ids = [(6, 0, fsm_order_ids)]
Loading