Skip to content
Snippets Groups Projects
Commit 0a5a3c5d authored by Hiral Bhavsar's avatar Hiral Bhavsar Committed by Thibault Delavallée
Browse files

[REF] hr_timesheet, sale_timesheet: remove settings to (un)install sale_timesheet module

Purpose is to limit the uninstallation of modules without being clearly
notified of it. We therefore decided to remove those options from settings
to prevent users from uninstalling it.

Description of sale_timesheet features and options are now all moved to
sale_timesheet. A Billing section should only be visible if sales installed.
We therefore move Billing section from hr_timesheet to sale_timesheet. A
priority is used to ensure sequence of various settings related to billing
and timesheet.

This commit is related to task ID 1841221.
parent 49c3f91e
No related branches found
No related tags found
No related merge requests found
......@@ -8,5 +8,4 @@ class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
module_project_timesheet_synchro = fields.Boolean("Awesome Timesheet")
module_sale_timesheet = fields.Boolean("Time Billing")
module_project_timesheet_holidays = fields.Boolean("Leaves")
......@@ -44,21 +44,6 @@
</div>
</div>
</div>
<h2>Billing</h2>
<div name="timesheet_billing" class="row mt16 o_settings_container" title="Sell services (e.g. project, maintenance), record time spent using Timesheets app and invoice them based on a fixed price (ordered quantity) or on the time spent (delivered quantity)">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_sale_timesheet"/>
</div>
<div class="o_setting_right_pane">
<label for="module_sale_timesheet"/>
<div class="text-muted">
Sell services and invoice time spent
</div>
<div class="content-group" name="msg_module_sale_timesheet" />
</div>
</div>
</div>
<div name="section_leaves" groups="base.group_no_one">
<h2>Leaves</h2>
<div class="row mt16 o_settings_container" name="timesheet_control">
......
......@@ -4,19 +4,31 @@
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.sale.timesheet</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="1"/>
<field name="inherit_id" ref="hr_timesheet.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='msg_module_sale_timesheet']" position="replace">
<div class="content-group" name="msg_module_sale_timesheet" attrs="{'invisible': [('module_sale_timesheet', '=', False)]}">
<div class="mt16">
<div>
<button name="%(sale_timesheet.product_template_action_time_based)d" string="Setup your time-based services" type="action" class="btn-link" icon="fa-arrow-right"/>
</div>
<div>
<button name="%(sale_timesheet.product_template_action_fixed)d" string="Setup your fixed price services" type="action" class="btn-link" icon="fa-arrow-right"/>
</div>
<div>
<button name="%(sale_timesheet.product_template_action_milestone)d" string="Setup your milestone services" type="action" class="btn-link" icon="fa-arrow-right"/>
<xpath expr="//div[@name='section_leaves']" position="before">
<h2>Billing</h2>
<div name="timesheet_billing" class="row mt16 o_settings_container" title="Sell services (e.g. project, maintenance), record time spent using Timesheets app and invoice them based on a fixed price (ordered quantity) or on the time spent (delivered quantity)">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_right_pane">
<label string="Time Billing"/>
<div class="text-muted">
Sell services and invoice time spent
</div>
<div class="content-group" name="msg_module_sale_timesheet">
<div class="mt16">
<div>
<button name="%(sale_timesheet.product_template_action_time_based)d" string="Setup your time-based services" type="action" class="btn-link" icon="fa-arrow-right"/>
</div>
<div>
<button name="%(sale_timesheet.product_template_action_fixed)d" string="Setup your fixed price services" type="action" class="btn-link" icon="fa-arrow-right"/>
</div>
<div>
<button name="%(sale_timesheet.product_template_action_milestone)d" string="Setup your milestone services" type="action" class="btn-link" icon="fa-arrow-right"/>
</div>
</div>
</div>
</div>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment