-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
[15.0][MIG] hr_expense_substate #143
Open
Saran440
wants to merge
11
commits into
OCA:15.0
Choose a base branch
from
ecosoft-odoo:15.0-mig-hr_expense_substate
base: 15.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b2e08a7
[14.0][ADD] hr_expense_substate
ps-tubtim dc6a1c1
[UPD] Update hr_expense_substate.pot
77b02ea
[UPD] README.rst
OCA-git-bot dbd84e8
[FIX] reference wrong external id
Saran440 650305d
[UPD] Update hr_expense_substate.pot
4a8d031
hr_expense_substate 14.0.1.0.1
OCA-git-bot 50a7858
[15.0][MIG] hr_expense_substate
Saran440 d6b8f19
[FIX] tracking mail template
Saran440 fc6ee33
[FIX] add contributer
Saran440 af892c4
[FIX] readme and template email
Saran440 5843e5f
[ADD] test reqirement
Saran440 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
======================== | ||
Expense Report Sub State | ||
======================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:3a6399e3cc32fd585364d03e868abca9577218a017d7ccaf63675086dec82a30 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
.. |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/15.0/hr_expense_substate | ||
: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-15-0/hr-expense-15-0-hr_expense_substate | ||
: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=15.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module allows to add a substate to an expense report. | ||
For each expense report state you can define a substate. | ||
We this module you can define substate which allow you to extend expense report workflow. | ||
For example, you can add substate "To Verify" if | ||
the order can not be approved without document checked and verified | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
#. Go to ** Settings > Technical > Sub State Configuration > Base Substate ** and add a "Base Substate". | ||
If necessary you can add "target State values" (e.g. define a substate for "cancel" | ||
state). | ||
Substate sequence is very important. | ||
#. Create a expense report and check if the substate are displayed on the header of | ||
form view. Check if you can't set substate defined for expense report if sate is a To be approved. | ||
|
||
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_substate%0Aversion:%2015.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 | ||
~~~~~~~ | ||
|
||
* Ecosoft | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Pimolnat Suntian <[email protected]> | ||
* Saran Lim. <[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. | ||
|
||
This module is part of the `OCA/hr-expense <https://github.com/OCA/hr-expense/tree/15.0/hr_expense_substate>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2021 Ecosoft (<http://ecosoft.co.th>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Expense Report Sub State", | ||
"version": "15.0.1.0.0", | ||
"category": "Human Resources", | ||
"author": "Ecosoft,Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/hr-expense", | ||
"license": "AGPL-3", | ||
"depends": ["base_substate", "hr_expense"], | ||
"data": [ | ||
"views/hr_expense_views.xml", | ||
"data/hr_expense_substate_mail_template_data.xml", | ||
"data/hr_expense_substate_data.xml", | ||
], | ||
"demo": ["demo/hr_expense_substate_demo.xml"], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="base_substate_type_hr_expense_sheet" model="base.substate.type"> | ||
<field name="name">Expense Report Substate</field> | ||
<field name="model">hr.expense.sheet</field> | ||
<field name="target_state_field">state</field> | ||
</record> | ||
<!-- Expense Report related substate to state (draft, approved) --> | ||
<record id="target_state_value_draft" model="target.state.value"> | ||
<field name="name">Draft</field> | ||
<field name="base_substate_type_id" ref="base_substate_type_hr_expense_sheet" /> | ||
<field name="target_state_value">draft</field> | ||
</record> | ||
<record id="target_state_value_submit" model="target.state.value"> | ||
<field name="name">Submitted</field> | ||
<field name="base_substate_type_id" ref="base_substate_type_hr_expense_sheet" /> | ||
<field name="target_state_value">submit</field> | ||
</record> | ||
<record id="target_state_value_approve" model="target.state.value"> | ||
<field name="name">Approved</field> | ||
<field name="base_substate_type_id" ref="base_substate_type_hr_expense_sheet" /> | ||
<field name="target_state_value">approve</field> | ||
</record> | ||
<record id="target_state_value_post" model="target.state.value"> | ||
<field name="name">Posted</field> | ||
<field name="base_substate_type_id" ref="base_substate_type_hr_expense_sheet" /> | ||
<field name="target_state_value">post</field> | ||
</record> | ||
<record id="target_state_value_done" model="target.state.value"> | ||
<field name="name">Paid</field> | ||
<field name="base_substate_type_id" ref="base_substate_type_hr_expense_sheet" /> | ||
<field name="target_state_value">done</field> | ||
</record> | ||
<record id="target_state_value_cancel" model="target.state.value"> | ||
<field name="name">Refused</field> | ||
<field name="base_substate_type_id" ref="base_substate_type_hr_expense_sheet" /> | ||
<field name="target_state_value">cancel</field> | ||
</record> | ||
</odoo> |
21 changes: 21 additions & 0 deletions
21
hr_expense_substate/data/hr_expense_substate_mail_template_data.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo noupdate="1"> | ||
<record id="mail_template_data_hr_expense_substate_verified" model="mail.template"> | ||
<field name="name">Verified</field> | ||
<field name="model_id" ref="hr_expense.model_hr_expense_sheet" /> | ||
<field name="subject">Your expense report {{ object.name }} is verified</field> | ||
<field name="email_to">{{ object.user_id.email_formatted }}</field> | ||
<field name="body_html" type="html"> | ||
<div> | ||
Dear <t t-out="object.employee_id.name or 'Requester'" />,<br /> | ||
This email is to inform that your expense report <t | ||
t-out="object.name" | ||
/> was verified by approver team. | ||
<br /><br /> | ||
Thank you, | ||
<br /> | ||
</div> | ||
</field> | ||
<field name="auto_delete" eval="True" /> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo noupdate="1"> | ||
<!-- to_approve --> | ||
<record id="base_substate_to_verify" model="base.substate"> | ||
<field name="name">To Verify</field> | ||
<field name="sequence">1</field> | ||
<field name="target_state_value_id" ref="target_state_value_submit" /> | ||
</record> | ||
<record id="base_substate_checked" model="base.substate"> | ||
<field name="name">Checked</field> | ||
<field name="sequence">2</field> | ||
<field name="target_state_value_id" ref="target_state_value_submit" /> | ||
</record> | ||
<record id="base_substate_verified" model="base.substate"> | ||
<field name="name">Verified</field> | ||
<field name="sequence">3</field> | ||
<field name="target_state_value_id" ref="target_state_value_submit" /> | ||
<field | ||
name="mail_template_id" | ||
ref="hr_expense_substate.mail_template_data_hr_expense_substate_verified" | ||
/> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * hr_expense_substate | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.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_substate | ||
#: model:mail.template,body_html:hr_expense_substate.mail_template_data_hr_expense_substate_verified | ||
msgid "" | ||
"<div>\n" | ||
" Dear ${object.employee_id.name or 'requester'},<br/>\n" | ||
" This email is to inform that your expense report ${object.name} was verified by approver team.\n" | ||
" <br/><br/>\n" | ||
" Thank you,\n" | ||
" <br/>\n" | ||
"</div>\n" | ||
" " | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:ir.model.fields,field_description:hr_expense_substate.field_base_substate_type__model | ||
msgid "Apply on" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:target.state.value,name:hr_expense_substate.target_state_value_approve | ||
msgid "Approved" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:ir.model,name:hr_expense_substate.model_base_substate_type | ||
msgid "Base Substate Type" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:base.substate,name:hr_expense_substate.base_substate_checked | ||
msgid "Checked" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:ir.model.fields,field_description:hr_expense_substate.field_base_substate_type__display_name | ||
#: model:ir.model.fields,field_description:hr_expense_substate.field_hr_expense_sheet__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:target.state.value,name:hr_expense_substate.target_state_value_draft | ||
msgid "Draft" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:ir.model,name:hr_expense_substate.model_hr_expense_sheet | ||
#: model:ir.model.fields.selection,name:hr_expense_substate.selection__base_substate_type__model__hr_expense_sheet | ||
msgid "Expense Report" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:base.substate.type,name:hr_expense_substate.base_substate_type_hr_expense_sheet | ||
msgid "Expense Report Substate" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:ir.model.fields,field_description:hr_expense_substate.field_base_substate_type__id | ||
#: model:ir.model.fields,field_description:hr_expense_substate.field_hr_expense_sheet__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:ir.model.fields,field_description:hr_expense_substate.field_base_substate_type____last_update | ||
#: model:ir.model.fields,field_description:hr_expense_substate.field_hr_expense_sheet____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:target.state.value,name:hr_expense_substate.target_state_value_done | ||
msgid "Paid" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:target.state.value,name:hr_expense_substate.target_state_value_post | ||
msgid "Posted" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:target.state.value,name:hr_expense_substate.target_state_value_cancel | ||
msgid "Refused" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:ir.model.fields,field_description:hr_expense_substate.field_hr_expense_sheet__substate_id | ||
#: model_terms:ir.ui.view,arch_db:hr_expense_substate.hr_expense_sheet_view_search | ||
msgid "Sub State" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:target.state.value,name:hr_expense_substate.target_state_value_submit | ||
msgid "Submitted" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:base.substate,name:hr_expense_substate.base_substate_to_verify | ||
msgid "To Verify" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:base.substate,name:hr_expense_substate.base_substate_verified | ||
msgid "Verified" | ||
msgstr "" | ||
|
||
#. module: hr_expense_substate | ||
#: model:mail.template,subject:hr_expense_substate.mail_template_data_hr_expense_substate_verified | ||
msgid "Your expense report ${object.name} is verified" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import hr_expense |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2021 Ecosoft (<http://ecosoft.co.th>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class BaseSubstateType(models.Model): | ||
_inherit = "base.substate.type" | ||
|
||
model = fields.Selection( | ||
selection_add=[("hr.expense.sheet", "Expense Report")], | ||
ondelete={"hr.expense.sheet": "cascade"}, | ||
) | ||
|
||
|
||
class HrExpenseSheet(models.Model): | ||
_name = "hr.expense.sheet" | ||
_inherit = ["hr.expense.sheet", "base.substate.mixin"] | ||
_state_field = "state" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* Pimolnat Suntian <[email protected]> | ||
* Saran Lim. <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
This module allows to add a substate to an expense report. | ||
For each expense report state you can define a substate. | ||
We this module you can define substate which allow you to extend expense report workflow. | ||
For example, you can add substate "To Verify" if | ||
the order can not be approved without document checked and verified |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#. Go to ** Settings > Technical > Sub State Configuration > Base Substate ** and add a "Base Substate". | ||
If necessary you can add "target State values" (e.g. define a substate for "cancel" | ||
state). | ||
Substate sequence is very important. | ||
#. Create a expense report and check if the substate are displayed on the header of | ||
form view. Check if you can't set substate defined for expense report if sate is a To be approved. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line can be deleted. The improved one is already above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description for explain this module. I think it okay to use this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We this module
is not proper english :)The line says the same as the lines above, so it is a duplicate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Saran440 Going to review this one now. Can you please attend to my earlier comment.