forked from OCA/hr-expense
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
122 additions
and
0 deletions.
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,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
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 Co., Ltd. (http://ecosoft.co.th) | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
"name": "HR Expense one2many widget", | ||
"version": "14.0.1.0.0", | ||
"author": "Ecosoft, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/hr-expense", | ||
"license": "AGPL-3", | ||
"category": "Human Resources", | ||
"depends": ["hr_expense"], | ||
"data": [ | ||
"security/hr_expense_security.xml", | ||
"views/res_config_settings_views.xml", | ||
"views/hr_expense_views.xml", | ||
], | ||
"installable": True, | ||
"maintainers": ["kittiu"], | ||
} |
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,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import res_config_settings |
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,13 @@ | ||
# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
group_hr_expense_widget_o2m = fields.Boolean( | ||
string="Use form view when add line for expense report", | ||
implied_group="hr_expense_widget_o2m.group_hr_expense_widget_o2m", | ||
) |
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 @@ | ||
Go to Human Reqsource > Expenses settings, and enable option "Use form view when add line for expense report" |
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 @@ | ||
* Kitti U. <[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,6 @@ | ||
Currently, if user create new expense sheet first, and then click to add expense lines, | ||
System will popup a selection window (many2many widget) allowing user to select the existing expenses first, and also to create new expense. | ||
|
||
This can be confusing for some user, and might not be suitable for some use case. | ||
|
||
With this module, user have option to directly add new lines on expense report (one2many widget). |
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 @@ | ||
<odoo> | ||
<record id="group_hr_expense_widget_o2m" model="res.groups"> | ||
<field name="name">Use form view when add line for expense report</field> | ||
<field name="category_id" ref="base.module_category_hidden" /> | ||
</record> | ||
</odoo> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,40 @@ | ||
<odoo> | ||
<!-- Views activated for group_hr_expense_widget_o2m --> | ||
<record id="view_hr_expense_sheet_form" model="ir.ui.view"> | ||
<field name="name">hr.expense.sheet.form.inherit</field> | ||
<field name="model">hr.expense.sheet</field> | ||
<field name="inherit_id" ref="hr_expense.view_hr_expense_sheet_form" /> | ||
<field | ||
name="groups_id" | ||
eval="[(4, ref('hr_expense_widget_o2m.group_hr_expense_widget_o2m'))]" | ||
/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='expense_line_ids']" position="attributes"> | ||
<attribute name="widget">one2many</attribute> | ||
</xpath> | ||
<xpath expr="//field[@name='expense_line_ids']/tree" position="attributes"> | ||
<attribute name="editable" /> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
<record id="hr_expense_view_form" model="ir.ui.view"> | ||
<field name="name">hr.expense.view.form</field> | ||
<field name="model">hr.expense</field> | ||
<field name="inherit_id" ref="hr_expense.hr_expense_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='account_id']" position="attributes"> | ||
<attribute name="force_save">1</attribute> | ||
</xpath> | ||
<xpath expr="//field[@name='total_amount']" position="attributes"> | ||
<attribute name="force_save">1</attribute> | ||
</xpath> | ||
<xpath expr="//field[@name='amount_residual']" position="attributes"> | ||
<attribute name="force_save">1</attribute> | ||
</xpath> | ||
<xpath expr="//field[@name='employee_id']" position="attributes"> | ||
<attribute name="force_save">1</attribute> | ||
</xpath> | ||
</field> | ||
</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 @@ | ||
<odoo> | ||
<record id="res_config_settings_view_form" model="ir.ui.view"> | ||
<field name="name">res.config.settings.view.form.inherit.hr.expense</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="priority" eval="85" /> | ||
<field name="inherit_id" ref="hr_expense.res_config_settings_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@name='expenses_setting_container']" position="inside"> | ||
<div | ||
class="col-12 col-lg-6 o_setting_box" | ||
id="expense_widget_o2m_settings" | ||
> | ||
<div class="o_setting_left_pane"> | ||
<field name="group_hr_expense_widget_o2m" /> | ||
</div> | ||
<div class="o_setting_right_pane"> | ||
<label for="group_hr_expense_widget_o2m" /> | ||
</div> | ||
</div> | ||
</xpath> | ||
</field> | ||
</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 @@ | ||
../../../../hr_expense_widget_o2m |
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 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |