[MERGE] usability review of project form views

bzr revid: qdp-launchpad@openerp.com-20120712152146-gqyk9i293h6h3qac
This commit is contained in:
Quentin (OpenERP) 2012-07-12 17:21:46 +02:00
commit 6182f663c0
15 changed files with 152 additions and 117 deletions

View File

@ -34,8 +34,8 @@ class account_analytic_line(osv.osv):
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='restrict', select=True),
'code': fields.char('Code', size=8),
'ref': fields.char('Ref.', size=64),
'currency_id': fields.related('move_id', 'currency_id', type='many2one', relation='res.currency', string='Account currency', store=True, help="The related account currency if not equal to the company one.", readonly=True),
'amount_currency': fields.related('move_id', 'amount_currency', type='float', string='Amount currency', store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True),
'currency_id': fields.related('move_id', 'currency_id', type='many2one', relation='res.currency', string='Account Currency', store=True, help="The related account currency if not equal to the company one.", readonly=True),
'amount_currency': fields.related('move_id', 'amount_currency', type='float', string='Amount Currency', store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True),
}
_defaults = {

View File

@ -241,19 +241,33 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Project line" version="7.0">
<group col="4">
<field name="name"/>
<field name="account_id"/>
<field name="date" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field name="journal_id"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field invisible="True" name="general_account_id"/>
<field name="amount"/>
<field name="currency_id" />
<field name="amount_currency" />
<field name="company_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<group>
<group>
<field name="name"/>
<field name="account_id"/>
<field name="journal_id"/>
</group>
<group>
<field name="date" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field name="company_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
</group>
<group string="Amount">
<field name="amount"/>
<label for="amount_currency"/>
<div>
<field name="amount_currency" class="oe_inline"/>
<field name="currency_id" class="oe_inline"/>
</div>
<field invisible="1" name="general_account_id"/>
</group>
<group string="Product Information">
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
<label for="unit_amount"/>
<div>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/>
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/>
</div>
</group>
</group>
</form>
</field>

View File

@ -15,13 +15,13 @@
</td><td>
<field name="charge_expenses"/>
</td><td>
<field class="oe_form_inline" name="est_expenses" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
<field class="oe_inline" name="est_expenses" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
</td><td>
<field class="oe_form_inline" name="expense_invoiced" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
<field class="oe_inline" name="expense_invoiced" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
</td><td>
<field class="oe_form_inline" name="remaining_expense" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
<field class="oe_inline" name="remaining_expense" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
</td><td>
<field class="oe_form_inline" name="expense_to_invoice" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
<field class="oe_inline" name="expense_to_invoice" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
</td><td>
<button name="open_hr_expense" string="All Expenses" type="object" attrs="{'invisible': [('charge_expenses','=',False)]}"/>
<button name="hr_to_invoice_expense" string="Expenses to Invoice" type="object" attrs="{'invisible': [('charge_expenses','=',False)]}"/>

View File

@ -15,7 +15,9 @@
<group string="Validity">
<label for="date_start" string="Duration"/>
<div name="duration">
<field name="date_start" class="oe_inline"/> - <field name="date" class="oe_inline"/>
<field name="date_start" class="oe_inline"/>
<label attrs="{'invisible':[('date','=',False)]}" class="oe_inline" string=" - "/>
<field name="date" class="oe_inline"/>
</div>
<label for="quantity_max"/>
<div>

View File

@ -418,7 +418,7 @@ class resource_calendar_leaves(osv.osv):
_inherit = "resource.calendar.leaves"
_description = "Leave Detail"
_columns = {
'holiday_id': fields.many2one("hr.holidays", "Holiday"),
'holiday_id': fields.many2one("hr.holidays", "Leave Request"),
}
resource_calendar_leaves()

View File

@ -501,7 +501,7 @@
<field name="type">form</field>
<field name="inherit_id" ref="resource.resource_calendar_leave_form"/>
<field name="arch" type="xml">
<field name="date_to" position="after">
<field name="name" position="after">
<field name="holiday_id"/>
</field>
</field>

View File

@ -123,7 +123,7 @@
<!-- Menus -->
<record id="action_hr_analytic_timesheet_open_tree" model="ir.actions.act_window">
<field name="name">Bill Tasks Works</field>
<field name="name">Invoice Tasks Work</field>
<field name="res_model">account.analytic.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>

View File

@ -714,14 +714,14 @@ class task(base_stage, osv.osv):
'parent_ids': fields.many2many('project.task', 'project_task_parent_rel', 'task_id', 'parent_id', 'Parent Tasks'),
'child_ids': fields.many2many('project.task', 'project_task_parent_rel', 'parent_id', 'task_id', 'Delegated Tasks'),
'notes': fields.text('Notes'),
'planned_hours': fields.float('Planned Hours', help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'),
'planned_hours': fields.float('Initially Planned Hours', help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'),
'effective_hours': fields.function(_hours_get, string='Hours Spent', multi='hours', help="Computed using the sum of the task work done.",
store = {
'project.task': (lambda self, cr, uid, ids, c={}: ids, ['work_ids', 'remaining_hours', 'planned_hours'], 10),
'project.task.work': (_get_task, ['hours'], 10),
}),
'remaining_hours': fields.float('Remaining Hours', digits=(16,2), help="Total remaining time, can be re-estimated periodically by the assignee of the task."),
'total_hours': fields.function(_hours_get, string='Total Hours', multi='hours', help="Computed as: Time Spent + Remaining Time.",
'total_hours': fields.function(_hours_get, string='Total', multi='hours', help="Computed as: Time Spent + Remaining Time.",
store = {
'project.task': (lambda self, cr, uid, ids, c={}: ids, ['work_ids', 'remaining_hours', 'planned_hours'], 10),
'project.task.work': (_get_task, ['hours'], 10),
@ -1222,7 +1222,7 @@ class account_analytic_account(osv.osv):
_inherit = 'account.analytic.account'
_description = 'Analytic Account'
_columns = {
'use_tasks': fields.boolean('Tasks Management',help="If check,this contract will be available in the project menu and you will be able to manage tasks or track issues"),
'use_tasks': fields.boolean('Tasks Mgmt.',help="If check,this contract will be available in the project menu and you will be able to manage tasks or track issues"),
'company_uom_id': fields.related('company_id', 'project_time_mode_id', type='many2one', relation='product.uom'),
}

View File

@ -82,17 +82,12 @@
<h1>
<field name="name" string="Project Name"/>
</h1>
<label for="parent_id" class="oe_edit_only" string="Parent Project"/>
<h2>
<field name="parent_id" domain="[('id','!=',analytic_account_id)]" context="{'current_model': 'project.project'}"/>
</h2>
<group>
<group>
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
<field name="user_id" string="Project Manager" attrs="{'readonly':[('state','in',['close', 'cancelled'])]}"/>
<field name="analytic_account_id" invisible="1" required="0"/>
<field name="parent_id" invisible="1" string="Parent" domain="[('id','!=',analytic_account_id)]" context="{'current_model': 'project.project'}"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
<field name="privacy_visibility"/>
<field name="analytic_account_id" invisible="1" required="0"/>
</group>
<group>
<table>
@ -139,6 +134,7 @@
<field name="priority"/>
<field name="active" attrs="{'invisible':[('state','in',['open', 'pending', 'template'])]}"/>
<field name="currency_id" groups="base.group_multi_company" required="1"/>
<field name="parent_id" domain="[('id','!=',analytic_account_id)]" context="{'current_model': 'project.project'}"/>
</group>
</group>
</page>
@ -404,11 +400,9 @@
states="cancel,done"/>
-->
<button name="%(action_project_task_reevaluate)d" string="Reactivate" type="action"
states="done" context="{'button_reactivate':True}" class="oe_highlight"/>
<button name="%(action_project_task_reevaluate)d" string="Reactivate" type="action"
states="cancelled" context="{'button_reactivate':True}"/>
states="cancelled,done" context="{'button_reactivate':True}"/>
<button name="action_close" string="Done" type="object"
states="draft,open,pending"/>
states="draft,open,pending" class="oe_highlight"/>
<button name="do_pending" string="Pending" type="object"
states="open"/>
<button name="%(action_project_task_delegate)d" string="Delegate" type="action"
@ -417,7 +411,7 @@
states="draft,open,pending"/>
<button name="stage_previous" string="Previous Stage" type="object"
states="open,pending" icon="gtk-go-back" attrs="{'invisible': [('stage_id','=', False)]}"/>
<button name="stage_next" string="Next Stage" type="object"
<button name="stage_next" string="Next Stage" type="object" class="oe_highlight"
states="open,pending" icon="gtk-go-forward" attrs="{'invisible': [('stage_id','=', False)]}"/>
</span>
<field name="stage_id" widget="statusbar"/>
@ -427,23 +421,16 @@
<h1>
<field name="name"/>
</h1>
<label for="project_id" class="oe_edit_only"/>
<h2>
<field name="project_id" on_change="onchange_project(project_id)"/>
</h2>
<group>
<group>
<field name="project_id" on_change="onchange_project(project_id)"/>
<field name="user_id" attrs="{'readonly':[('state','in',['done', 'cancelled'])]}"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
<group>
<field name="date_deadline" attrs="{'readonly':[('state','in',['done', 'cancelled'])]}"/>
<field name="planned_hours" widget="float_time" attrs="{'readonly':[('state','!=','draft')]}"
groups="project.group_time_work_estimation_tasks"
on_change="onchange_planned(planned_hours, effective_hours)"/>
<field name="progress" widget="progressbar"
groups="project.group_time_work_estimation_tasks"
invisible="1"/>
groups="project.group_time_work_estimation_tasks"/>
</group>
</group>
<notebook>
@ -457,14 +444,15 @@
<field name="hours" widget="float_time" sum="Spent Hours"/>
</tree>
</field>
<group class="oe_subtotal_footer oe_right" name="project_hours" groups="project.group_time_work_estimation_tasks">
<group>
<group class="oe_subtotal_footer oe_right" name="project_hours" groups="project.group_time_work_estimation_tasks">
<field name="effective_hours" widget="float_time"/>
<label for="remaining_hours" string="Remaining" groups="project.group_time_work_estimation_tasks"/>
<div>
<button name="%(action_project_task_reevaluate)d" string="Reevaluate" type="action" target="new" states="open,pending" icon="gtk-edit"/>
<field name="remaining_hours" widget="float_time" attrs="{'readonly':[('state','!=','draft')]}" groups="project.group_time_work_estimation_tasks"/>
<field name="remaining_hours" widget="float_time" attrs="{'readonly':[('state','in',('done','cancelled'))]}" groups="project.group_time_work_estimation_tasks"/>
</div>
<field name="total_hours" widget="float_time" class="oe_subtotal_footer_separator"/>
</group>
</group>
<div class="oe_clear"/>
</page>
@ -490,6 +478,9 @@
<field name="priority" groups="base.group_user"/>
<field name="sequence"/>
<field name="partner_id"/>
<field name="planned_hours" widget="float_time" attrs="{'readonly':[('state','!=','draft')]}"
groups="project.group_time_work_estimation_tasks"
on_change="onchange_planned(planned_hours, effective_hours)"/>
<field name="state" groups="base.group_no_one"/>
</group>
</page>

View File

@ -119,26 +119,35 @@
<sheet string="Issue">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
<label for="project_id" class="oe_edit_only"/>
<h2><field name="project_id" required="True" on_change="on_change_project(project_id)"/></h2>
<group>
<group>
<field name="user_id"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/>
<field name="email_from"/>
</group><group>
<field name="task_id" on_change="onchange_task_id(task_id)"/>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
<field name="version_id" widget="selection"/>
</group>
<group>
<field name="priority"/>
<field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}"/>
<field name="state" groups="base.group_no_one"/>
<field name="project_id" required="True" on_change="on_change_project(project_id)"/>
<label for="task_id"/>
<div>
<field name="task_id" on_change="onchange_task_id(task_id)" class="oe_inline"/>
<field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}" class="oe_inline"/>
</div>
</group>
</group>
<field name="description" placeholder="Add a description..."/>
<notebook groups="base.group_no_one">
<page string="Extra Info">
<notebook>
<page string="Description">
<group>
<group>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
</group>
<group>
<field name="version_id" widget="selection"/>
</group>
</group>
<field name="description" placeholder="Add a description..."/>
</page>
<page string="Extra Info" groups="base.group_no_one">
<group col="4" colspan="4">
<separator string="Statistics" colspan="4" col="4"/>
<field name="day_open"/>
@ -153,6 +162,10 @@
<field name="id"/>
<field name="active"/>
</group>
<group colspan="4" col="4">
<separator string="Status" colspan="4"/>
<field name="state" groups="base.group_no_one" string="Status"/>
</group>
</page>
</notebook>
</sheet>

View File

@ -10,11 +10,14 @@
<field name="project_id" position="attributes">
<attribute name="on_change">on_change_project(project_id)</attribute>
</field>
<xpath expr="//notebook" position="before">
<field name="analytic_account_id"
domain="[('parent_id','!=',False),('partner_id', '=', partner_id),('type', '!=', 'view')]"
on_change='on_change_account_id(analytic_account_id)'/>
</xpath>
<field name="active" position="after">
<newline/>
<group colspan="4">
<field name="analytic_account_id"
domain="[('parent_id','!=',False),('partner_id', '=', partner_id),('type', '!=', 'view')]"
on_change='on_change_account_id(analytic_account_id)'/>
</group>
</field>
<xpath expr="//notebook/page[@string='Extra Info']" position="before">
<page string="Worklogs">
<field name="timesheet_ids" colspan="4" nolabel="1" context="{'default_user_id' : user_id, 'default_account_id' : analytic_account_id}">

View File

@ -155,20 +155,21 @@
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
<label for="project_id" class="oe_edit_only"/>
<h2>
<field name="project_id" on_change="onchange_project(project_id)" colspan="3"/>
</h2>
</div>
<group>
<label for="date_start" string="Duration"/>
<div>
<div>
<field name="duration" class="oe_inline"/>
<field name="product_uom" class="oe_inline"/>
</div>
<field name="date_start" class="oe_inline"/><label string=" - " class="oe_inline"/><field name="date_end" class="oe_inline"/>
</div>
<group>
<label for="date_start" string="Duration"/>
<div>
<div>
<field name="duration" class="oe_inline"/>
<field name="product_uom" class="oe_inline"/>
</div>
<field name="date_start" class="oe_inline"/><label string=" - " class="oe_inline"/><field name="date_end" class="oe_inline"/>
</div>
</group>
<group>
<field name="project_id" on_change="onchange_project(project_id)"/>
</group>
</group>
<notebook>
<page string="Planning of Users">
@ -211,10 +212,9 @@
</group>
<group>
<field name="sequence"/>
<field name="user_force_ids" widget="many2many_tags"/>
</group>
</group>
<separator string="Force Assigned Users"/>
<field name="user_force_ids" widget="many2many_tags" />
<separator string="Previous Phases"/>
<field name="previous_phase_ids"/>
<separator string="Next Phases"/>
@ -327,7 +327,7 @@
<field name="type">form</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='effective_hours']" position="after">
<xpath expr="//field[@name='user_id']" position="after">
<field name="phase_id" context="{'default_project_id' : project_id}"/>
</xpath>
</field>

View File

@ -88,7 +88,7 @@
<!-- Menus -->
<record id="action_project_timesheet_bill_task" model="ir.actions.act_window">
<field name="name">Bill Tasks Works</field>
<field name="name">Invoice Tasks Work</field>
<field name="res_model">account.analytic.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>

View File

@ -262,8 +262,8 @@ class resource_calendar_attendance(osv.osv):
'name' : fields.char("Name", size=64, required=True),
'dayofweek': fields.selection([('0','Monday'),('1','Tuesday'),('2','Wednesday'),('3','Thursday'),('4','Friday'),('5','Saturday'),('6','Sunday')], 'Day of Week', required=True, select=True),
'date_from' : fields.date('Starting Date'),
'hour_from' : fields.float('Work from', size=8, required=True, help="Working time will start from", select=True),
'hour_to' : fields.float("Work to", size=8, required=True, help="Working time will end at"),
'hour_from' : fields.float('Work from', required=True, help="Start and End time of working.", select=True),
'hour_to' : fields.float("Work to", required=True),
'calendar_id' : fields.many2one("resource.calendar", "Resource's Calendar", required=True),
}

View File

@ -120,11 +120,12 @@
<field name="model">resource.calendar.attendance</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Working Time">
<tree string="Working Time" editable="top">
<field name="name"/>
<field name="dayofweek"/>
<field name="hour_from" widget="float_time" />
<field name="hour_to" widget="float_time" />
<field name="hour_from" widget="float_time"/>
<field name="hour_to" widget="float_time"/>
<field name="date_from"/>
</tree>
</field>
</record>
@ -135,11 +136,16 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Working Time" version="7.0">
<field colspan="4" name="name"/>
<field name="date_from"/>
<field name="dayofweek"/>
<field name="hour_from" widget="float_time"/>
<field name="hour_to" widget="float_time"/>
<group>
<field name="name"/>
<field name="date_from"/>
<field name="dayofweek"/>
<label for="hour_from" string="Hours"/>
<div>
<field name="hour_from" widget="float_time" class="oe_inline"/> -
<field name="hour_to" widget="float_time" class="oe_inline"/>
</div>
</group>
</form>
</field>
</record>
@ -179,16 +185,18 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Resource" version="7.0">
<group col="4">
<field name="name" colspan="4"/>
<field name="active"/>
<newline/>
<field name="user_id" attrs="{'required':[('resource_type','=','user')], 'readonly':[('resource_type','=','material')]}"/>
<field name="resource_type" />
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="calendar_id" string="Working Period"/>
<field name="time_efficiency"/>
<group>
<group>
<field name="name"/>
<field name="user_id" attrs="{'required':[('resource_type','=','user')], 'readonly':[('resource_type','=','material')]}"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="active"/>
</group>
<group>
<field name="resource_type" />
<field name="calendar_id"/>
<field name="time_efficiency"/>
</group>
</group>
</form>
</field>
@ -204,7 +212,7 @@
<field name="user_id" />
<field name="company_id" groups="base.group_multi_company"/>
<field name="resource_type" />
<field name="calendar_id" string="Working Period"/>
<field name="calendar_id"/>
<field name="time_efficiency"/>
</tree>
</field>
@ -225,25 +233,29 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Leave Detail" version="7.0">
<sheet>
<group>
<group>
<field name="resource_id" on_change="onchange_resource(resource_id)"/>
<field name="name" string="Reason"/>
</group>
<group>
<field name="calendar_id"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
</group>
<group>
<group>
<field name="resource_id" on_change="onchange_resource(resource_id)"/>
<field name="name" string="Reason"/>
<label for="date_from" string="Duration"/>
<div>
<field name="date_from" class="oe_inline"/> -
<field name="date_to" class="oe_inline"/>
</div>
</group>
<group>
<field name="date_from"/>
<field name="calendar_id" string="Working Period"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<group>
<field name="date_to"/>
</group>
</group>
</sheet>
</group>
</form>
</field>
</record>
<record id="resource_calendar_leave_tree" model="ir.ui.view">
<field name="name">resource.calendar.leaves.tree</field>
<field name="model">resource.calendar.leaves</field>