Skip to content
Snippets Groups Projects
Commit 7c3f774d authored by Jérome Maes's avatar Jérome Maes
Browse files

[IMP] sale,project,sale_timesheet: config settings

The purpose is to ease timesheet configuration by
adding missing settings: 'invoicing policy' setting
exists in sale config. This commit duplicate it
into timesheet config.

It also add settings in project, sale and timesheet
to configure more easily the service products (time
and material, and fixed price), by adding filter for
services.
parent 227f8ab1
Branches
Tags
No related merge requests found
......@@ -113,6 +113,11 @@
<div class="text-muted">
Sell services and invoice time spent
</div>
<div class="content-group" name="msg_module_sale_timesheet">
<div class="text-warning mt16" attrs="{'invisible': [('module_sale_timesheet', '=', False)]}">
Save this page and come back here to set up the feature.
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
......
......@@ -24,6 +24,7 @@ have real delivered quantities in sales orders.
'views/project_task_views.xml',
'views/procurement_views.xml',
'views/hr_timesheet_views.xml',
'views/res_config_views.xml',
],
'demo': [
'data/sale_service_demo.xml',
......
......@@ -16,4 +16,34 @@
</field>
</field>
</record>
<record id="product_template_search_view_sale_timesheet" model="ir.ui.view">
<field name="name">product.template.search.timesheet</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='consumable']" position="after">
<separator/>
<filter string="Time-based services" name="product_time_based" domain="[('type', '=', 'service'), ('invoice_policy', '=', 'delivery')]"/>
<filter string="Fixed price services" name="product_service_fixed" domain="[('type', '=', 'service'), ('invoice_policy', '=', 'order')]"/>
</xpath>
</field>
</record>
<record id="product_template_action_time_based" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">product.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_product_time_based':1, 'default_type': 'service', 'default_invoice_policy': 'delivery'}</field>
</record>
<record id="product_template_action_fixed" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">product.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_product_service_fixed':1, 'default_type': 'service', 'default_invoice_policy': 'order'}</field>
</record>
</odoo>
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="hr_timesheet_config_settings_view_form" model="ir.ui.view">
<field name="name">hr.timesheet.config.settings.view.form</field>
<field name="model">hr.timesheet.config.settings</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='msg_module_sale_timesheet']" position="replace">
<div class="content-group" 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>
</div>
</xpath>
</field>
</record>
<record id="sale_config_settings_view_form_inherit_sale_timesheet" model="ir.ui.view">
<field name="name">sale.config.settings.view.form</field>
<field name="model">sale.config.settings</field>
<field name="inherit_id" ref="sale.sale_config_settings_view_form_inherit_sale"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='msg_module_sale_timesheet']" position="replace">
<div class="content-group" 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>
</div>
</xpath>
</field>
</record>
<record id="project_config_settings_view_form" model="ir.ui.view">
<field name="name">project.config.settings.view.form</field>
<field name="model">project.config.settings</field>
<field name="inherit_id" ref="project.project_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='msg_module_sale_timesheet']" position="replace">
<div class="content-group" 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>
</div>
</xpath>
</field>
</record>
</odoo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment