[IMP] hr_payroll:improved 'salary_head_type' class,object and its fields.

bzr revid: mtr@mtr-20110302120023-ihc9mi4pqk3gucvt
This commit is contained in:
mtr 2011-03-02 17:30:23 +05:30
parent dcd7a887b1
commit 183e37aaef
3 changed files with 17 additions and 12 deletions

View File

@ -639,18 +639,19 @@ class contrib_register_line(osv.osv):
}
contrib_register_line()
class salary_head_type(osv.osv):
class hr_salary_head_type(osv.osv):
"""
Salary Head Type
"""
_name = 'salary.head.type'
_name = 'hr.salary.head.type'
_description = 'Salary Head Type'
_columns = {
'name':fields.char('Type Name', size=64, required=True, readonly=False),
'code':fields.char('Type Code', size=64, required=True, readonly=False),
}
salary_head_type()
hr_salary_head_type()
class payment_category(osv.osv):
"""
@ -664,7 +665,7 @@ class payment_category(osv.osv):
_columns = {
'name':fields.char('Category Name', size=64, required=True, readonly=False),
'code':fields.char('Category Code', size=64, required=True, readonly=False),
'type':fields.many2one('salary.head.type', 'Type', required=True, help="It is used only for the reporting purpose."),
'type':fields.many2one('hr.salary.head.type', 'Type', required=True, help="It is used only for the reporting purpose."),
'base':fields.text('Based on', required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'),
'condition':fields.char('Condition', size=1024, required=True, readonly=False, help='Applied this head for calculation if condition is true'),
'sequence': fields.integer('Sequence', required=True, help='Use to arrange calculation sequence'),
@ -1225,7 +1226,7 @@ class hr_payslip_line(osv.osv):
'base':fields.char('Formula', size=1024, required=False, readonly=False),
'code':fields.char('Code', size=64, required=False, readonly=False),
'category_id':fields.many2one('hr.allounce.deduction.categoty', 'Category', required=True),
'type':fields.many2one('salary.head.type', 'Type', required=True),
'type':fields.many2one('hr.salary.head.type', 'Type', required=True),
'amount_type':fields.selection([
('per','Percentage (%)'),
('fix','Fixed Amount'),

View File

@ -2,12 +2,14 @@
<openerp>
<data noupdate="1">
<record id="AL" model="salary.head.type">
<field name="name">allowance</field>
<record id="AL" model="hr.salary.head.type">
<field name="name">Allowance</field>
<field name="code">ALW</field>
</record>
<record id="DED" model="salary.head.type">
<field name="name">deduction</field>
<record id="DED" model="hr.salary.head.type">
<field name="name">Deduction</field>
<field name="code">DED</field>
</record>
<record id="HRA" model="hr.allounce.deduction.categoty">

View File

@ -855,29 +855,31 @@
<!-- Salary Head Type -->
<record id="salary_head_type_tree" model="ir.ui.view">
<field name="name">salary.head.type.tree</field>
<field name="model">salary.head.type</field>
<field name="model">hr.salary.head.type</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Salary Head Type">
<field name="name"/>
<field name="code"/>
</tree>
</field>
</record>
<record id="salary_head_type_form" model="ir.ui.view">
<field name="name">salary.head.type.form</field>
<field name="model">salary.head.type</field>
<field name="model">hr.salary.head.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Salary Head Type">
<field name="name"/>
<field name="code"/>
</form>
</field>
</record>
<record id="action_salary_head_type" model="ir.actions.act_window">
<field name="name">Salary Head Type</field>
<field name="res_model">salary.head.type</field>
<field name="res_model">hr.salary.head.type</field>
<field name="view_type">form</field>
<field name="view_id" ref="salary_head_type_tree"/>
</record>