[IMP] project: Improve the settings form view

This commit is contained in:
dut-odoo
2017-01-10 15:49:38 +01:00
committed by Yannick Tivisse
parent 1b82b3acb1
commit 3345256579
20 changed files with 273 additions and 129 deletions
@@ -12,7 +12,6 @@
'security/ir.model.access.csv',
'report/hr_timesheet_attendance_report_view.xml',
'views/hr_timesheet_sheet_views.xml',
'views/hr_timesheet_attendance_config_settings_views.xml',
],
'auto_install': True,
}
@@ -4,4 +4,3 @@
import hr_attendance
import hr_timesheet_sheet
import res_company
import project_config_settings
@@ -1,9 +0,0 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class HrTimesheetConfiguration(models.TransientModel):
_inherit = 'project.config.settings'
timesheet_max_difference = fields.Float(related='company_id.timesheet_max_difference', string="Timesheet allowed difference(Hours) *")
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_config_settings_form_inherit_hr_timesheet_attendance" model="ir.ui.view">
<field name="name">project.config.settings.form.inherit.timesheet.attendance</field>
<field name="model">project.config.settings</field>
<field name="inherit_id" ref="hr_timesheet_sheet.view_config_settings_form_inherit_hr_timesheet_sheet"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='timesheets']/label[@for='id']" position="before">
<label for="timesheet_max_difference"/>
<div>
<field name="timesheet_max_difference" required="1" class="oe_inline"/>
</div>
</xpath>
</field>
</record>
</odoo>
@@ -34,7 +34,6 @@ The validation can be configured in the company:
'views/hr_timesheet_sheet_templates.xml',
'views/hr_timesheet_sheet_views.xml',
'views/hr_department_views.xml',
'views/hr_timesheet_sheet_config_settings_views.xml',
],
'installable': True,
'auto_install': False,
@@ -5,5 +5,4 @@ import account_analytic_line
import hr_department
import hr_employee
import hr_timesheet_sheet
import hr_timesheet_sheet_config_settings
import res_company
@@ -1,11 +0,0 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class HrTimesheetConfiguration(models.TransientModel):
_inherit = 'project.config.settings'
module_project_timesheet_synchro = fields.Boolean(string="Timesheet app for Chrome/Android/iOS")
timesheet_range = fields.Selection(related='company_id.timesheet_range', string="Timesheet range *")
@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_config_settings_form_inherit_hr_timesheet_sheet" model="ir.ui.view">
<field name="name">project.config.settings.form.inherit.timesheet.sheet</field>
<field name="model">project.config.settings</field>
<field name="inherit_id" ref="project.view_config_settings"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='timesheets']" position="attributes">
<attribute name="string">Timesheets</attribute>
</xpath>
<xpath expr="//group[@name='timesheets']" position="inside">
<field name="timesheet_range" required="1" class="oe_inline"/>
<label for="id" string="Extra features"/>
<div>
<field name="module_project_timesheet_synchro" widget="upgrade_boolean"/>
<label for="module_project_timesheet_synchro"/>
<a href="https://www.odoo.com/page/timesheet" target="_blank"> More Info </a>
</div>
</xpath>
</field>
</record>
</odoo>
+1
View File
@@ -14,6 +14,7 @@ This module adds a PAD in all project form views.
'pad'
],
'data': [
'views/project_config_settings_views.xml',
'views/project_task.xml'
],
'auto_install': True,
+1
View File
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import project_config_settings
import project_task
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ProjectConfigSettings(models.TransientModel):
_inherit = "project.config.settings"
pad_server = fields.Char(related="company_id.pad_server", string="Pad Server")
pad_key = fields.Char(related="company_id.pad_key", string="Pad Api Key")
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="project_config_settings_view_form_inherit_pad_project" model="ir.ui.view">
<field name="name">project.config.settings.form.inherit.pad.project</field>
<field name="model">project.config.settings</field>
<field name="inherit_id" ref="project.project_config_settings_view_form"/>
<field name="arch" type="xml">
<div name="pad_project_right_pane" position="inside">
<div class="content-group" groups="base.group_no_one">
<field name='company_id' invisible="1"/>
<div class="row mt16">
<label for="pad_server" class="col-md-3 o_light_label"/>
<field name="pad_server"/>
</div>
<div class="row">
<label for="pad_key" class="col-md-3 o_light_label"/>
<field name="pad_key"/>
</div>
</div>
</div>
</field>
</record>
</odoo>
+10 -14
View File
@@ -10,25 +10,21 @@ class ProjectConfiguration(models.TransientModel):
company_id = fields.Many2one('res.company', string='Company', required=True,
default=lambda self: self.env.user.company_id)
project_time_mode_id = fields.Many2one(related='company_id.project_time_mode_id', string="Project Time Unit *")
module_pad = fields.Selection([
(0, "Task description is plain text"),
(1, "Collaborative rich text on task description")
], string="Pads",
help='Lets the company customize which Pad installation should be used to link to new pads '
'(for example: http://ietherpad.com/).\n'
'-This installs the module pad.')
module_rating_project = fields.Selection([
(0, "No customer rating"),
(1, 'Track customer satisfaction on tasks')
], string="Rating on task",
help="This allows customers to give rating on provided services")
module_pad = fields.Boolean("Collaborative Pads")
module_hr_timesheet = fields.Boolean("Timesheets")
module_project_timesheet_synchro = fields.Boolean("Awesome Timesheet")
module_rating_project = fields.Boolean(string="Rating on Tasks")
generate_project_alias = fields.Selection([
(0, "Do not create an email alias automatically"),
(1, "Automatically generate an email alias at the project creation")
], string="Project Alias",
help="Odoo will generate an email alias at the project creation from project name.")
module_project_forecast = fields.Boolean(string="Forecasts, planning and Gantt charts")
module_project_forecast = fields.Boolean(string="Forecasts")
module_hr_holidays = fields.Boolean("Leave Management")
module_hr_timesheet_attendance = fields.Boolean("Attendances")
module_sale_timesheet = fields.Boolean("Time Billing")
module_hr_expense = fields.Boolean("Expenses")
module_project_issue = fields.Boolean("Issue Tracking")
@api.multi
def set_default_generate_project_alias(self):
+157 -26
View File
@@ -1,48 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_config_settings" model="ir.ui.view">
<field name="name">project settings</field>
<record id="project_config_settings_view_form" model="ir.ui.view">
<field name="name">project.config.settings.form</field>
<field name="model">project.config.settings</field>
<field name="priority" eval="20"/>
<field name="arch" type="xml">
<form class="oe_form_configuration">
<header>
<button string="Apply" type="object" name="execute" class="oe_highlight"/>
<button string="Save" type="object" name="execute" class="oe_highlight"/>
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
</header>
<group string="Project Management" name="project_management">
<field name="company_id" invisible="1"/>
<label for="project_time_mode_id" groups="base.group_no_one"/>
<div groups="base.group_no_one">
<field name="project_time_mode_id" domain="[('category_id','=', %(product.uom_categ_wtime)d)]" class="oe_inline"/>
<sheet>
<h2>Team Collaboration</h2>
<div class="row mt16 o_settings_container" title="This replaces task's description text field by a collaborative rich text pad. This is advised if tasks involve several people.">
<div id="use_collaborative_pad" class="col-xs-12 col-md-6 o_setting_box" title="Lets the company customize which Pad installation should be used to link to new pads (for example: http://ietherpad.com/).">
<div class="o_setting_left_pane">
<field name="module_pad"/>
</div>
<div class="o_setting_right_pane" name="pad_project_right_pane">
<label for="module_pad"/>
<div class="text-muted">
Use collaborative rich text pads in tasks
</div>
</div>
</div>
</div>
<field name="module_pad" widget="radio"/>
<label for="id" string="Forecasts"/>
<div>
<div>
<field name="module_project_forecast" widget="upgrade_boolean"/>
<label for="module_project_forecast"/>
<a href="https://www.youtube.com/watch?v=PWKez0gn6Ts" target="_blank"> More Info </a>
</div>
</div>
<field name="module_rating_project" widget="radio"/>
</group>
<group name="timesheets"/>
<div>
<span>(*) This configuration is related to the company you're logged into.</span>
</div>
<h2>Time Management</h2>
<div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_hr_timesheet"/>
</div>
<div class="o_setting_right_pane">
<label for="module_hr_timesheet"/>
<div class="text-muted">
Track time spent on projects and tasks
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_project_timesheet_synchro" widget="upgrade_boolean"/>
</div>
<div class="o_setting_right_pane">
<label for="module_project_timesheet_synchro"/>
<div class="text-muted">
Record time with mobile Timesheet app
</div>
<div class="content-group">
<div class="row mt16 oe_center">
<div class="col-md-4">
<a href="http://www.odoo.com/page/timesheet?platform=chrome">
<img alt="Google Chrome Store" class="img img-responsive" src="project/static/src/img/chrome_store.png"/>
</a>
</div>
<div class="col-md-4">
<a href="http://www.odoo.com/page/timesheet?platform=ios">
<img alt="Apple App Store" class="img img-responsive" src="project/static/src/img/app_store.png"/>
</a>
</div>
<div class="col-md-4">
<a href="http://www.odoo.com/page/timesheet?platform=android">
<img alt="Google Play Store" class="img img-responsive" src="project/static/src/img/play_store.png"/>
</a>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_project_forecast" widget="upgrade_boolean"/>
</div>
<div class="o_setting_right_pane">
<label for="module_project_forecast"/>
<div class="text-muted">
Manage your resources with Gantt charts
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_hr_holidays"/>
</div>
<div class="o_setting_right_pane">
<label for="module_hr_holidays"/>
<div class="text-muted">
Track leaves to optimize your scheduling
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_hr_timesheet_attendance"/>
</div>
<div class="o_setting_right_pane">
<label for="module_hr_timesheet_attendance"/>
<div class="text-muted">
Track attendances and compare with timesheets
</div>
</div>
</div>
</div>
<h2>Billing</h2>
<div class="row mt16 o_settings_container">
<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>
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_hr_expense"/>
</div>
<div class="o_setting_right_pane">
<label for="module_hr_expense"/>
<div class="text-muted">
Reimburse employee expenses and invoice customers
</div>
</div>
</div>
</div>
<h2>Customer Satisfaction</h2>
<div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_rating_project"/>
</div>
<div class="o_setting_right_pane">
<label for="module_rating_project"/>
<div class="text-muted">
Track customer satisfaction on tasks
</div>
<div class="content-group" id="msg_module_rating_project">
<div class="text-warning mt16" attrs="{'invisible': [('module_rating_project','=',False)]}">
Save this page and come back here to set up the feature.
</div>
</div>
</div>
</div>
</div>
<h2>Issue Management</h2>
<div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box" id="project_issue">
<div class="o_setting_left_pane">
<field name="module_project_issue"/>
</div>
<div class="o_setting_right_pane">
<label for="module_project_issue"/>
<div class="text-muted">
Track and solve issues from a Kanban view
</div>
</div>
</div>
</div>
</sheet>
</form>
</field>
</record>
<record id="action_config_settings" model="ir.actions.act_window">
<record id="project_config_settings_action" model="ir.actions.act_window">
<field name="name">Configure Project</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">project.config.settings</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">inline</field>
</record>
<menuitem id="menu_project_general_settings" name="Settings" parent="menu_project_config"
sequence="0" action="action_config_settings" groups="base.group_system"/>
<menuitem id="project_config_settings_menu_action" name="Settings" parent="menu_project_config"
sequence="0" action="project_config_settings_action" groups="base.group_system"/>
</odoo>
@@ -7,14 +7,5 @@ from odoo import models, fields
class ProjectIssueConfiguration(models.TransientModel):
_inherit = 'project.config.settings'
module_project_issue_sheet = fields.Selection([
(0, "Do not track working hours on issues"),
(1, "Activate timesheets on issues")
], string="Timesheets on Issues",
help='Provides timesheet support for the issues/bugs management in project.\n'
'-This installs the module project_issue_sheet.')
module_rating_project_issue = fields.Selection([
(0, "No customer rating"),
(1, 'Track customer satisfaction on issues')
], "Rating on issue",
help="This allows customers to give rating on issue")
module_project_issue_sheet = fields.Boolean(string="Timesheets on Issues")
module_rating_project_issue = fields.Boolean("Rating on Issues")
@@ -4,19 +4,37 @@
<record id="project_config_settings_view_form_inherit_project_issue" model="ir.ui.view">
<field name="name">project.config.settings.view.form.inherit.project.issue</field>
<field name="model">project.config.settings</field>
<field name="inherit_id" ref="project.view_config_settings"/>
<field name="inherit_id" ref="project.project_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='timesheets']" position="attributes">
<attribute name="string">Timesheets</attribute>
</xpath>
<xpath expr="//group[@name='timesheets']" position="inside">
<field name="module_project_issue_sheet" widget="radio"/>
</xpath>
<xpath expr="//group[@name='timesheets']" position="after">
<group string="Helpdesk &amp; Support">
<field name="module_rating_project_issue" widget="radio"/>
</group>
</xpath>
<div id="project_issue" position="after">
<div class="col-xs-12 col-md-6 o_setting_box" id="use_issue_tracking" title="Provides timesheet support for the issues/bugs management in project.">
<div class="o_setting_left_pane">
<field name="module_project_issue_sheet"/>
</div>
<div class="o_setting_right_pane">
<label for="module_project_issue_sheet"/>
<div class="text-muted">
Track time spent to solve issues
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_rating_project_issue"/>
</div>
<div class="o_setting_right_pane">
<label for="module_rating_project_issue"/>
<div class="text-muted">
Track customer satisfaction on issues
</div>
<div class="content-group" id="msg_module_rating_project_issue">
<div class="text-warning mt16" attrs="{'invisible': [('module_rating_project_issue','=',False)]}">
Save this page and come back here to set up the feature.
</div>
</div>
</div>
</div>
</div>
</field>
</record>
+1
View File
@@ -13,6 +13,7 @@ This module Allows a customer to give rating on Project.
],
'data': [
'data/project_data.xml',
'views/project_config_settings_views.xml',
'views/project_view.xml',
],
'demo': ['data/project_demo.xml'],
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="project_config_settings_view_form_inherit_rating_project" model="ir.ui.view">
<field name="name">project.config.settings.form.inherit.rating.project</field>
<field name="model">project.config.settings</field>
<field name="inherit_id" ref="project.project_config_settings_view_form"/>
<field name="arch" type="xml">
<div id="msg_module_rating_project" position="replace">
<div class="content-group" attrs="{'invisible': [('module_rating_project', '=', False)]}">
<div class="mt16">
<button name="%(project.open_task_type_form)d" icon="fa-arrow-right" type="action" string="Set Email Template to Stages" class="btn-link"/>
</div>
</div>
</div>
</field>
</record>
</odoo>
@@ -14,6 +14,7 @@ This module allows a customer to give rating on Project Issue.
'data': [
'data/project_issue_data.xml',
'views/project_issue_view.xml',
'views/project_config_settings_views.xml',
],
'demo': [
'data/project_issue_demo.xml',
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="project_config_settings_view_form_inherit_rating_project_issue" model="ir.ui.view">
<field name="name">project.config.settings.form.inherit.issue</field>
<field name="model">project.config.settings</field>
<field name="inherit_id" ref="project_issue.project_config_settings_view_form_inherit_project_issue"/>
<field name="arch" type="xml">
<div id="msg_module_rating_project_issue" position="replace">
<div class="content-group" attrs="{'invisible': [('module_rating_project_issue', '=', False)]}">
<div class="mt16">
<button name="%(project.open_task_type_form)d" icon="fa-arrow-right" type="action" string="Set Email Template to Stages" class="btn-link"/>
</div>
</div>
</div>
</field>
</record>
</odoo>