[MOD]hr_expense : usability improvement

bzr revid: dbr@tinyerp.com-20100906103134-zjt5id9sq5oswt0i
This commit is contained in:
DBR (OpenERP) 2010-09-06 16:01:34 +05:30
parent 6f1d11df67
commit fd3c05ef1d
2 changed files with 16 additions and 13 deletions

View File

@ -61,12 +61,12 @@ class hr_expense_expense(osv.osv):
_name = "hr.expense.expense"
_description = "Expense"
_columns = {
'name': fields.char('Expense Sheet', size=128, required=True),
'name': fields.char('Description', size=128, required=True),
'id': fields.integer('Sheet ID', readonly=True),
'ref': fields.char('Reference', size=32),
'date': fields.date('Date'),
'journal_id': fields.many2one('account.journal', 'Force Journal', help = "The journal used when the expense is invoiced"),
'employee_id': fields.many2one('hr.employee', "Employee's Name", required=True),
'employee_id': fields.many2one('hr.employee', "Employee", required=True),
'user_id': fields.many2one('res.users', 'User', required=True),
'date_confirm': fields.date('Confirmation Date', help = "Date of the confirmation of the sheet expense. It's filled when the button Confirm is pressed."),
'date_valid': fields.date('Validation Date', help = "Date of the acceptation of the sheet expense. It's filled when the button Accept is pressed."),
@ -81,11 +81,11 @@ class hr_expense_expense(osv.osv):
'company_id': fields.many2one('res.company', 'Company', required=True),
'state': fields.selection([
('draft', 'Draft'),
('confirm', 'Waiting confirmation'),
('accepted', 'Accepted'),
('confirm', 'Waiting Approved'),
('accepted', 'Approved'),
('invoiced', 'Invoiced'),
('paid', 'Reimbursed'),
('cancelled', 'Cancelled')],
('cancelled', 'Refused')],
'State', readonly=True, help='When the expense request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Confirmation\'.\
\nIf the admin accepts it, the state is \'Accepted\'.\n If an invoice is made for the expense request, the state is \'Invoiced\'.\n If the expense is paid to user, the state is \'Reimbursed\'.'),
}

View File

@ -27,12 +27,12 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Expenses" colors="blue:state=='draft'">
<field name="date"/>
<field name="employee_id"/>
<field name="user_id" invisible="1"/>
<field name="department_id" groups="base.group_extended"/>
<field name="name"/>
<field name="date"/>
<field name="ref"/>
<field name="name"/>
<field name="amount"/>
<field name="state"/>
<button name="confirm" states="draft" string="Confirm" type="workflow" icon="gtk-apply"/>
@ -98,10 +98,10 @@
<group col="6" colspan="2">
<button name="confirm" states="draft" string="Confirm" type="workflow" icon="gtk-apply"/>
<button name="cancel" states="cancel" string="Cancel" type="workflow" icon="gtk-cancel"/>
<button name="validate" states="confirm" string="Accept" type="workflow" icon="gtk-ok"/>
<button name="draft" states="confirm,cancelled" string="Set to Draft" type="workflow" icon="gtk-convert"/>
<button name="validate" states="confirm" string="Approve" type="workflow" icon="gtk-ok"/>
<button name="invoice" states="accepted" string="Invoice" type="workflow" icon="gtk-execute"/>
<button name="draft" states="confirm,cancelled" string="Set to Draft" type="workflow" icon="gtk-convert"/>
<button name="refuse" states="confirm,draft,accepted" string="Refuse" type="workflow" icon="gtk-no"/>
<button name="refuse" states="confirm,draft,accepted" string="Refuse" type="workflow" icon="gtk-no" groups="base.group_hr_manager" />
</group>
</page>
<page string="Other Info" groups="base.group_extended">
@ -134,10 +134,12 @@
<group>
<filter icon="terp-document-new" domain="[('state','=','draft')]" string="Draft" help="Draft Expense"/>
<separator orientation="vertical"/>
<filter icon="terp-gtk-go-back-rtl" domain="[('state','=','confirm')]" string="To Approve"
<filter icon="terp-camera_test" domain="[('state','=','confirm')]" string="To Approve"
help="Confirmed Expense"/>
<filter icon="terp-gtk-go-back-rtl" domain="[('state','=','accepted')]" string="To Pay"
<filter icon="terp-check" domain="[('state','=','accepted')]" string="To Pay"
help="Expenses to Invoice"/>
<filter icon="terp-go-month" string="This Month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"/>
<separator orientation="vertical"/>
<field name="name" select='1'/>
<field name="date" select='1'/>
@ -149,8 +151,9 @@
</group>
<newline />
<group expand="0" string="Group By...">
<filter string="Employee" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
<separator orientation="vertical"/>
<filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
</group>