[IMP] hr_payroll:removed Function from salary rules,modified the hr.holiday.status

bzr revid: mtr@mtr-20110301112908-agdcje98pb5hrgx2
This commit is contained in:
mtr 2011-03-01 16:59:08 +05:30
parent 5778a97065
commit 73bbece660
2 changed files with 21 additions and 26 deletions

View File

@ -799,8 +799,8 @@ class hr_holidays_status(osv.osv):
('halfpaid','Half-Pay Holiday')
], string='Payment'),
'head_id': fields.many2one('hr.allounce.deduction.categoty', 'Payroll Head', domain=[('type','=','deduction')]),
'code': fields.related('head_id','code', type='char', relation='hr.allounce.deduction.categoty', string='Code'),
# 'code':fields.char('Code', size=64, required=False, readonly=False),
# 'code': fields.related('head_id','code', type='char', relation='hr.allounce.deduction.categoty', string='Code'),
'code':fields.char('Code', size=64, required=False, readonly=False),
}
_defaults = {
'type': lambda *args: 'unpaid',
@ -1333,14 +1333,15 @@ class hr_payslip_line(osv.osv):
'amount_type':fields.selection([
('per','Percentage (%)'),
('fix','Fixed Amount'),
('func','Function Value'),
('code','Python Code'),
],'Amount Type', select=True, required=True),
'amount': fields.float('Amount / Percentage', digits=(16, 4)),
'total': fields.float('Sub Total', readonly=True, digits_compute=dp.get_precision('Account')),
'company_contrib': fields.float('Company Contribution', readonly=True, digits=(16, 4)),
'sequence': fields.integer('Sequence'),
'note':fields.text('Description'),
'line_ids':fields.one2many('hr.payslip.line.line', 'slipline_id', 'Calculations', required=False)
'line_ids':fields.one2many('hr.payslip.line.line', 'slipline_id', 'Calculations', required=False),
'exp':fields.text('Expression'),
}
_order = 'sequence'
_defaults = {
@ -1366,7 +1367,7 @@ class hr_salary_rule(osv.osv):
_inherit = 'hr.payslip.line'
_name = 'hr.salary.rule'
_columns = {
'active': fields.boolean('Active'),
'appears_on_payslip': fields.boolean('Appears on Payslip'),
'min_range': fields.float('Minimum Range', required=False),
'max_range': fields.float('Maximum Range', required=False),
'sal_rule_id':fields.many2one('hr.salary.rule', 'Parent Salary Structure', select=True),
@ -1376,7 +1377,7 @@ class hr_salary_rule(osv.osv):
'register_id':fields.many2one('hr.contibution.register', 'Contri Reg', select=True),
}
_defaults = {
'active': 1
'appears_on_payslip': 1
}
hr_salary_rule()

View File

@ -252,10 +252,10 @@
</group>
<group colspan="2">
<separator colspan="2" string="Payroll Configurtion"/><newline/>
<field name="type"/><newline/>
<!--<field name="type"/><newline/>
<field name="head_id"/><newline/>
<field name="company_id" groups="base.group_multi_company" widget="selection" select="2"/><newline/>
<field name="code" readonly="True"/>
<field name="company_id" groups="base.group_multi_company" widget="selection" select="2"/><newline/>-->
<field name="code" />
</group>
</xpath>
</field>
@ -926,7 +926,7 @@
<field name="code" select="1"/>
<field name="min_range"/>
<field name="max_range"/>
<field name="active"/>
<field name="appears_on_payslip"/>
</group>
<group col="2" colspan="2">
<separator colspan="4" string="Calculations"/>
@ -936,11 +936,9 @@
<field name="amount" on_change="onchange_amount(amount, amount_type)" attrs="{'readonly':[('amount_type','=','func')]}"/>
<field name="sequence" groups="base.group_extended"/>
</group>
<group col="2" colspan="2">
<separator colspan="4" string="Company contribution"/>
<field name="company_contrib"/>
<field name="register_id"/>
<field name="company_id"/>
<group col="2" colspan="2" attrs="{'invisible':[('amount_type','!=','code')]}">
<separator colspan="2" string="Applicable code (if Amount Type = Python code)"/>
<field name="exp" nolabel="1" attrs="{'readonly':[('amount_type','!=','code')],'required':[('amount_type','=','code')]}"/>
</group>
<notebook colspan="4">
<page string="Child Rules" groups="base.group_extended">
@ -948,17 +946,13 @@
<field name="child_depend"/>
<field colspan="4" name="child_ids" nolabel="1"/>
</page>
<page string="Function">
<field name="line_ids" colspan="4" nolabel="1" attrs="{'readonly':[('amount_type','!=','func')]}">
<tree string="Function Arguments" editable="bottom">
<field name="name"/>
<field name="sequence" groups="base.group_extended"/>
<field name="from_val"/>
<field name="to_val"/>
<field name="amount_type"/>
<field name="value"/>
</tree>
</field>
<page string="Company contribution">
<separator colspan="4" string="Company contribution"/>
<group col="2" colspan="2">
<field name="company_id"/>
<field name="company_contrib"/>
<field name="register_id" string="Contribution Register"/>
</group>
</page>
<page string="Description">
<separator colspan="4" string="Description"/>