Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
105 changes: 105 additions & 0 deletions hr_expense_journal/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
======================
Select Expense Journal
======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d987377265ba11bd365fe142c94dec85cbe1191060dfffbd5c6f0cac46832b67
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Fhr--expense-lightgray.png?logo=github
:target: https://github.com/OCA/hr-expense/tree/18.0/hr_expense_journal
:alt: OCA/hr-expense
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-expense-18-0/hr-expense-18-0-hr_expense_journal
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr-expense&target_branch=18.0
:alt: Try me on Runboat

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

Employees can pay for expenses using company Credit Cards.

In this case, there is the need for the Expense to identify what Credit
Card was used for that payment.

This allows the Expense report to use the correct journal, and have the
payment accounting enty to be posted in the correct place.

**Table of contents**

.. contents::
:local:

Usage
=====

- Create an Expense and select "Paid By Company".
- A "Payment Type" field will be available, to select the journal
corresponding to teh credit card or payment method used.
- When creating the Expense Report, the selected Payment Type is used to
populate the "Bank Journal" field, in the "Other Setting" tab.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr-expense/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 <https://github.com/OCA/hr-expense/issues/new?body=module:%20hr_expense_journal%0Aversion:%2018.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
------------

- `Open Source Integrators <https://www.opensourceintegrators.com>`__:

- Daniel Reis <[email protected]>
- Freni Patel <[email protected]>

- Saran Lim. <[email protected]>
- Panithan K. <[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-dreispt| image:: https://github.com/dreispt.png?size=40px
:target: https://github.com/dreispt
:alt: dreispt

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

|maintainer-dreispt|

This module is part of the `OCA/hr-expense <https://github.com/OCA/hr-expense/tree/18.0/hr_expense_journal>`_ 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 hr_expense_journal/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
19 changes: 19 additions & 0 deletions hr_expense_journal/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Select Expense Journal",
"version": "18.0.1.0.0",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"summary": "Set the Journal for the payment type used to pay the expense",
"website": "https://github.com/OCA/hr-expense",
"license": "AGPL-3",
"depends": ["hr_expense"],
"category": "Human Resources/Expenses",
"data": [
"views/hr_expense_views.xml",
],
"installable": True,
"maintainers": ["dreispt"],
"development_status": "Beta",
}
53 changes: 53 additions & 0 deletions hr_expense_journal/i18n/hr_expense_journal.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_expense_journal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.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: hr_expense_journal
#: model:ir.model,name:hr_expense_journal.model_hr_expense
msgid "Expense"
msgstr ""

#. module: hr_expense_journal
#: model:ir.model.fields,field_description:hr_expense_journal.field_hr_expense__payment_method_line_id
msgid "Payment Method"
msgstr ""

#. module: hr_expense_journal
#: model:ir.model,name:hr_expense_journal.model_account_payment_method_line
msgid "Payment Methods"
msgstr ""

#. module: hr_expense_journal
#: model:ir.model.fields,help:hr_expense_journal.field_account_payment_method_line__journal_type
msgid ""
"Select 'Sale' for customer invoices journals.\n"
"Select 'Purchase' for vendor bills journals.\n"
"Select 'Cash' or 'Bank' for journals that are used in customer or vendor payments.\n"
"Select 'General' for miscellaneous operations journals."
msgstr ""

#. module: hr_expense_journal
#: model:ir.model.fields,field_description:hr_expense_journal.field_hr_expense__selectable_payment_method_line_ids
msgid "Selectable Payment Method Line"
msgstr ""

#. module: hr_expense_journal
#: model:ir.model.fields,help:hr_expense_journal.field_hr_expense__payment_method_line_id
msgid "The payment method used when the expense is paid by the company."
msgstr ""

#. module: hr_expense_journal
#: model:ir.model.fields,field_description:hr_expense_journal.field_account_payment_method_line__journal_type
msgid "Type"
msgstr ""
27 changes: 27 additions & 0 deletions hr_expense_journal/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_expense_journal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-12 17:36+0000\n"
"Last-Translator: mymage <[email protected]>\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 4.17\n"

#. module: hr_expense_journal
#: model:ir.model,name:hr_expense_journal.model_hr_expense
msgid "Expense"
msgstr "Spesa"

#. module: hr_expense_journal
#: model:ir.model.fields,field_description:hr_expense_journal.field_hr_expense__payment_type_id
msgid "Payment Journal"
msgstr "Registro pagamenti"
5 changes: 5 additions & 0 deletions hr_expense_journal/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import hr_expense
from . import account_payment_method_line
10 changes: 10 additions & 0 deletions hr_expense_journal/models/account_payment_method_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class AccountPaymentMethodLine(models.Model):
_inherit = "account.payment.method.line"

journal_type = fields.Selection(related="journal_id.type")
44 changes: 44 additions & 0 deletions hr_expense_journal/models/hr_expense.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class HrExpense(models.Model):
_inherit = "hr.expense"

selectable_payment_method_line_ids = fields.Many2many(
comodel_name="account.payment.method.line",
compute="_compute_selectable_payment_method_line_ids",
)
payment_method_line_id = fields.Many2one(
comodel_name="account.payment.method.line",
string="Payment Method",
domain="[('id', 'in', selectable_payment_method_line_ids)]",
help="The payment method used when the expense is paid by the company.",
)

@api.depends("company_id")
def _compute_selectable_payment_method_line_ids(self):
for sheet in self:
allowed_method_line_ids = (
sheet.company_id.company_expense_allowed_payment_method_line_ids
)
if allowed_method_line_ids:
sheet.selectable_payment_method_line_ids = allowed_method_line_ids
else:
sheet.selectable_payment_method_line_ids = self.env[
"account.payment.method.line"
].search(
[
("payment_type", "=", "outbound"),
("company_id", "parent_of", sheet.company_id.id),
]
)

def _get_default_expense_sheet_values(self):
values = super()._get_default_expense_sheet_values()
if self.payment_method_line_id:
for val in values:
val["payment_method_line_id"] = self.payment_method_line_id.id
return values
3 changes: 3 additions & 0 deletions hr_expense_journal/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
5 changes: 5 additions & 0 deletions hr_expense_journal/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- [Open Source Integrators](https://www.opensourceintegrators.com):
- Daniel Reis \<[email protected]\>
- Freni Patel \<[email protected]\>
- Saran Lim. \<[email protected]\>
- Panithan K. \<[email protected]\>
7 changes: 7 additions & 0 deletions hr_expense_journal/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Employees can pay for expenses using company Credit Cards.

In this case, there is the need for the Expense to identify what Credit
Card was used for that payment.

This allows the Expense report to use the correct journal, and have the
payment accounting enty to be posted in the correct place.
5 changes: 5 additions & 0 deletions hr_expense_journal/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Create an Expense and select "Paid By Company".
- A "Payment Type" field will be available, to select the journal
corresponding to teh credit card or payment method used.
- When creating the Expense Report, the selected Payment Type is used to
populate the "Bank Journal" field, in the "Other Setting" tab.
Binary file added hr_expense_journal/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading