[IMP] useability of timesheet
bzr revid: fp@fp-laptop-20110910124355-qkkbtgm3wz6l2w1f
This commit is contained in:
@@ -66,8 +66,8 @@ class hr_analytic_timesheet(osv.osv):
|
||||
_inherits = {'account.analytic.line': 'line_id'}
|
||||
_order = "id desc"
|
||||
_columns = {
|
||||
'line_id': fields.many2one('account.analytic.line', 'Analytic line', ondelete='cascade', required=True),
|
||||
'partner_id': fields.related('account_id', 'partner_id', type='many2one', string='Partner Id', relation='res.partner', store=True),
|
||||
'line_id': fields.many2one('account.analytic.line', 'Analytic Line', ondelete='cascade', required=True),
|
||||
'partner_id': fields.related('account_id', 'partner_id', type='many2one', string='Partner', relation='res.partner', store=True),
|
||||
}
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -27,7 +27,7 @@ class hr_so_project(osv.osv_memory):
|
||||
_name = 'hr.sign.out.project'
|
||||
_description = 'Sign Out By Project'
|
||||
_columns = {
|
||||
'account_id': fields.many2one('account.analytic.account', 'Analytic Account', domain=[('type','=','normal')]),
|
||||
'account_id': fields.many2one('account.analytic.account', 'Project / Analytic Account', domain=[('type','=','normal')]),
|
||||
'info': fields.char('Work Description', size=256, required=True),
|
||||
'date_start': fields.datetime('Starting Date', readonly=True),
|
||||
'date': fields.datetime('Closing Date'),
|
||||
|
||||
@@ -264,7 +264,7 @@ class hr_timesheet_sheet(osv.osv):
|
||||
return self.sign(cr,uid,ids,'sign_out',context=None)
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Description', size=64, select=1,
|
||||
'name': fields.char('Note', size=64, select=1,
|
||||
states={'confirm':[('readonly', True)], 'done':[('readonly', True)]}),
|
||||
'employee_id': fields.many2one('hr.employee', 'Employee', required=True),
|
||||
'user_id': fields.related('employee_id', 'user_id', type="many2one", relation="res.users", store=True, string="User", required=False, readonly=True),#fields.many2one('res.users', 'User', required=True, select=1, states={'confirm':[('readonly', True)], 'done':[('readonly', True)]}),
|
||||
@@ -280,9 +280,9 @@ class hr_timesheet_sheet(osv.osv):
|
||||
'attendances_ids' : one2many_mod2('hr.attendance', 'sheet_id', 'Attendances'),
|
||||
'state' : fields.selection([
|
||||
('new', 'New'),
|
||||
('draft','Draft'),
|
||||
('confirm','Confirmed'),
|
||||
('done','Done')], 'State', select=True, required=True, readonly=True,
|
||||
('draft','Open'),
|
||||
('confirm','Waiting Approval'),
|
||||
('done','Approved')], 'State', select=True, required=True, readonly=True,
|
||||
help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed timesheet. \
|
||||
\n* The \'Confirmed\' state is used for to confirm the timesheet by user. \
|
||||
\n* The \'Done\' state is used when users timesheet is accepted by his/her senior.'),
|
||||
@@ -735,7 +735,7 @@ class hr_timesheet_sheet_sheet_account(osv.osv):
|
||||
_auto = False
|
||||
_order='name'
|
||||
_columns = {
|
||||
'name': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
|
||||
'name': fields.many2one('account.analytic.account', 'Project / Analytic Account', readonly=True),
|
||||
'sheet_id': fields.many2one('hr_timesheet_sheet.sheet', 'Sheet', readonly=True),
|
||||
'total': fields.float('Total Time', digits=(16,2), readonly=True),
|
||||
'invoice_rate': fields.many2one('hr_timesheet_invoice.factor', 'Invoice rate', readonly=True),
|
||||
|
||||
@@ -62,14 +62,14 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Timesheet">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name"/>
|
||||
<field name="company_id" select="1" groups="base.group_multi_company"/>
|
||||
<field name="department_id" groups="base.group_extended"/>
|
||||
<newline/>
|
||||
<field name="employee_id"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<newline/>
|
||||
<field name="name"/>
|
||||
<field name="company_id" select="1" groups="base.group_multi_company"/>
|
||||
<field name="department_id" groups="base.group_extended"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Daily View">
|
||||
@@ -89,19 +89,19 @@
|
||||
<field invisible="1" name="employee_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group col="1" colspan="1">
|
||||
<button name="sign_in" string="Sign In" type="object" icon="terp-gtk-jump-to-ltr"/>
|
||||
<button name="sign_out" string="Sign Out" type="object" icon="terp-gtk-jump-to-rtl"/>
|
||||
<group col="4" colspan="1">
|
||||
<field name="state_attendance"/>
|
||||
<button name="sign_in" string="Sign In" type="object" icon="terp-gtk-jump-to-ltr" attrs="{'invisible':[('state_attendance','<>','absent')]}"/>
|
||||
<button name="sign_out" string="Sign Out" type="object" icon="terp-gtk-jump-to-rtl" attrs="{'invisible':[('state_attendance','<>','present')]}"/>
|
||||
<field name="total_attendance_day" widget="float_time" colspan="4"/>
|
||||
</group>
|
||||
<field name="state_attendance"/>
|
||||
<field name="total_attendance_day" widget="float_time"/>
|
||||
<field colspan="4" context="{'date':date_current,'user_id':user_id}" domain="[('name','=',date_current)]" name="timesheet_ids" nolabel="1">
|
||||
<tree editable="top" string="Timesheet Lines">
|
||||
<field invisible="1" name="date"/>
|
||||
<field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
|
||||
<field name="name"/>
|
||||
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time"/>
|
||||
<field name="to_invoice"/>
|
||||
<field name="to_invoice" widget="selection"/>
|
||||
<field invisible="1" name="journal_id"/>
|
||||
<field invisible="1" name="product_id" domain="[('type','=','service')]" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
|
||||
<field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
|
||||
|
||||
Reference in New Issue
Block a user