[MERGE] hr improvements in board

bzr revid: fp@tinyerp.com-20121022163949-m1yv3b7sysgu3951
This commit is contained in:
Fabien Pinckaers 2012-10-22 18:39:49 +02:00
commit bde73ca622
2 changed files with 11 additions and 10 deletions

View File

@ -6,12 +6,12 @@
<field name="name">applicants.status.tree</field>
<field name="model">hr.applicant</field>
<field name="arch" type="xml">
<tree colors="blue:state == 'draft';black:state in ('open','pending','done','cancel');" string="Applicants Status">
<tree string="Applicants Status">
<field name="create_date"/>
<field name="job_id"/>
<field name="partner_name"/>
<field name="stage_id"/>
<field name="state" groups="base.group_no_one"/>
<field name="user_id"/>
</tree>
</field>
</record>
@ -32,7 +32,7 @@
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="arch" type="xml">
<xpath expr="/form/board/column[1]" position="inside">
<action name="%(action_applicants_status)d" string="Applicants To be Processed"/>
<action name="%(action_applicants_status)d" string="Applications to be Processed"/>
</xpath>
</field>
</record>

View File

@ -129,17 +129,18 @@ class account_analytic_line(osv.osv):
def _default_journal(self, cr, uid, context=None):
proxy = self.pool.get('hr.employee')
record_ids = proxy.search(cr, uid, [('user_id', '=', uid)], context=context)
employee = proxy.browse(cr, uid, record_ids[0], context=context)
return employee.journal_id and employee.journal_id.id or False
if record_ids:
employee = proxy.browse(cr, uid, record_ids[0], context=context)
return employee.journal_id and employee.journal_id.id or False
return False
def _default_general_account(self, cr, uid, context=None):
proxy = self.pool.get('hr.employee')
record_ids = proxy.search(cr, uid, [('user_id', '=', uid)], context=context)
if not record_ids:
raise osv.except_osv(_('Error!'), _('Please create an employee associated to this user.'))
employee = proxy.browse(cr, uid, record_ids[0], context=context)
if employee.product_id and employee.product_id.property_account_income:
return employee.product_id.property_account_income.id
if record_ids:
employee = proxy.browse(cr, uid, record_ids[0], context=context)
if employee.product_id and employee.product_id.property_account_income:
return employee.product_id.property_account_income.id
return False
_defaults = {