[IMP] l10n_fr_hr_payroll: few fixes/code enhancement
bzr revid: qdp-launchpad@openerp.com-20120516140301-p65l3gk3dt1q9ire
This commit is contained in:
parent
ea82e137a5
commit
d598901ad2
|
@ -10,7 +10,7 @@
|
|||
<field name="inherit_id" ref="base.view_company_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="/form/notebook/page[@string='General Information']/field[@name='company_registry']" position="after">
|
||||
<xpath expr="//field[@name='company_registry']" position="after">
|
||||
<field name="siret"/>
|
||||
<field name="ape"/>
|
||||
</xpath>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
'name': 'French Payroll',
|
||||
'category': 'Localization/Payroll',
|
||||
'author': 'Yannick Buron (SYNERPGY)',
|
||||
'depends': ['hr_payroll', 'hr_payroll_account', 'l10n_fr'],
|
||||
'depends': ['hr_payroll', 'l10n_fr'],
|
||||
'version': '1.0',
|
||||
'description': """
|
||||
French Payroll Rules
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<field name="inherit_id" ref="base.view_company_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="/form/notebook/page[@string='Configuration']" position="after">
|
||||
<xpath expr="//notebook" position="inside">
|
||||
<page string="Paye">
|
||||
<field name="plafond_secu"/>
|
||||
<field name="nombre_employes"/>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<field name="inherit_id" ref="hr_payroll.view_hr_payslip_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="/form/notebook/page[@string='Other Information']/group/field[@name='paid']" position="after">
|
||||
<xpath expr="//field[@name='paid']" position="after">
|
||||
<field name="payment_mode"/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
@ -63,7 +63,7 @@
|
|||
model="hr.payslip"
|
||||
name="fiche.paye"
|
||||
rml="l10n_fr_hr_payroll/report/fiche_paye.rml"
|
||||
string="Fiche de Paye" />
|
||||
string="Fiche de Paie" />
|
||||
|
||||
|
||||
</data>
|
||||
|
|
|
@ -34,13 +34,13 @@ class fiche_paye_parser(report_sxw.rml_parse):
|
|||
'get_employer_line': self.get_employer_line,
|
||||
})
|
||||
|
||||
def get_payslip_lines(self, obj):
|
||||
def get_payslip_lines(self, objs):
|
||||
payslip_line = self.pool.get('hr.payslip.line')
|
||||
res = []
|
||||
ids = []
|
||||
for id in range(len(obj)):
|
||||
if obj[id].appears_on_payslip == True and not obj[id].salary_rule_id.parent_rule_id :
|
||||
ids.append(obj[id].id)
|
||||
for item in objs:
|
||||
if item.appears_on_payslip == True and not item.salary_rule_id.parent_rule_id :
|
||||
ids.append(item.id)
|
||||
if ids:
|
||||
res = payslip_line.browse(self.cr, self.uid, ids)
|
||||
return res
|
||||
|
@ -53,20 +53,20 @@ class fiche_paye_parser(report_sxw.rml_parse):
|
|||
cate_ids = rule_cate_obj.search(self.cr, self.uid, [('code', '=', code)])
|
||||
|
||||
category_total = 0
|
||||
line_ids = payslip_line.search(self.cr, self.uid, [('slip_id', '=', obj.id),('category_id.id', '=', cate_ids[0] )])
|
||||
|
||||
for line in payslip_line.browse(self.cr, self.uid, line_ids):
|
||||
category_total += line.total
|
||||
if cate_ids:
|
||||
line_ids = payslip_line.search(self.cr, self.uid, [('slip_id', '=', obj.id),('category_id.id', '=', cate_ids[0] )])
|
||||
for line in payslip_line.browse(self.cr, self.uid, line_ids):
|
||||
category_total += line.total
|
||||
|
||||
return category_total
|
||||
|
||||
|
||||
def get_employer_line(self, obj, parent_line):
|
||||
|
||||
payslip_line = self.pool.get('hr.payslip.line')
|
||||
payslip_line = self.pool.get('hr.payslip.line')
|
||||
|
||||
line_ids = payslip_line.search(self.cr, self.uid, [('slip_id', '=', obj.id), ('salary_rule_id.parent_rule_id.id', '=', parent_line.salary_rule_id.id )])
|
||||
res = payslip_line.browse(self.cr, self.uid, line_ids[0])
|
||||
res = line_ids and payslip_line.browse(self.cr, self.uid, line_ids[0]) or False
|
||||
|
||||
return res
|
||||
|
||||
|
|
Loading…
Reference in New Issue