[IMP]: Code optimization in the view file
bzr revid: rsi@tinyerp.com-20140423065755-83tyantoitle2ow4
This commit is contained in:
parent
f44148ba22
commit
be542630e8
|
@ -81,7 +81,7 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse):
|
||||||
sal = self.cr.fetchall()
|
sal = self.cr.fetchall()
|
||||||
salary = dict(sal)
|
salary = dict(sal)
|
||||||
total = 0.0
|
total = 0.0
|
||||||
cnt = 1
|
cnt = 0
|
||||||
|
|
||||||
for month in self.mnths:
|
for month in self.mnths:
|
||||||
if month <> '':
|
if month <> '':
|
||||||
|
@ -102,7 +102,7 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse):
|
||||||
def get_employee(self, form):
|
def get_employee(self, form):
|
||||||
emp_salary = []
|
emp_salary = []
|
||||||
salary_list = []
|
salary_list = []
|
||||||
total_mnths=['Total', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
total_mnths=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||||
emp_obj = self.pool.get('hr.employee')
|
emp_obj = self.pool.get('hr.employee')
|
||||||
emp_ids = form.get('employee_ids', [])
|
emp_ids = form.get('employee_ids', [])
|
||||||
employees = emp_obj.browse(self.cr, self.uid, emp_ids, context=self.context)
|
employees = emp_obj.browse(self.cr, self.uid, emp_ids, context=self.context)
|
||||||
|
|
|
@ -14,18 +14,9 @@
|
||||||
<tr style="border-top: 1px solid black">
|
<tr style="border-top: 1px solid black">
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<t t-foreach="get_periods(data['form'])" t-as="m">
|
<t t-foreach="get_periods(data['form'])" t-as="m">
|
||||||
<th class="text-right" t-esc="m[0]" />
|
<t t-foreach="m" t-as="month">
|
||||||
<th class="text-right" t-esc="m[1]" />
|
<th class="text-right" t-esc="month" />
|
||||||
<th class="text-right" t-esc="m[2]" />
|
</t>
|
||||||
<th class="text-right" t-esc="m[3]" />
|
|
||||||
<th class="text-right" t-esc="m[4]" />
|
|
||||||
<th class="text-right" t-esc="m[5]" />
|
|
||||||
<th class="text-right" t-esc="m[6]" />
|
|
||||||
<th class="text-right" t-esc="m[7]" />
|
|
||||||
<th class="text-right" t-esc="m[8]" />
|
|
||||||
<th class="text-right" t-esc="m[9]" />
|
|
||||||
<th class="text-right" t-esc="m[10]" />
|
|
||||||
<th class="text-right" t-esc="m[11]" />
|
|
||||||
</t>
|
</t>
|
||||||
<th class="text-right">Total</th>
|
<th class="text-right">Total</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -34,18 +25,9 @@
|
||||||
<t t-foreach="get_employee(data['form'])" t-as="e">
|
<t t-foreach="get_employee(data['form'])" t-as="e">
|
||||||
<tr>
|
<tr>
|
||||||
<td t-esc="e[0]" />
|
<td t-esc="e[0]" />
|
||||||
<td class="text-right" t-esc="e[1]" />
|
<t t-foreach="e[1:13]" t-as="month_sal">
|
||||||
<td class="text-right" t-esc="e[2]" />
|
<td class="text-right" t-esc="month_sal" />
|
||||||
<td class="text-right" t-esc="e[3]" />
|
</t>
|
||||||
<td class="text-right" t-esc="e[4]" />
|
|
||||||
<td class="text-right" t-esc="e[5]" />
|
|
||||||
<td class="text-right" t-esc="e[6]" />
|
|
||||||
<td class="text-right" t-esc="e[7]" />
|
|
||||||
<td class="text-right" t-esc="e[8]" />
|
|
||||||
<td class="text-right" t-esc="e[9]" />
|
|
||||||
<td class="text-right" t-esc="e[10]" />
|
|
||||||
<td class="text-right" t-esc="e[11]" />
|
|
||||||
<td class="text-right" t-esc="e[12]" />
|
|
||||||
<td class="text-right" t-esc="formatLang(e[13],currency_obj= company.currency_id)" />
|
<td class="text-right" t-esc="formatLang(e[13],currency_obj= company.currency_id)" />
|
||||||
</tr>
|
</tr>
|
||||||
</t>
|
</t>
|
||||||
|
@ -53,13 +35,9 @@
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr class="border-black">
|
<tr class="border-black">
|
||||||
<t t-foreach="get_months_tol()" t-as="t">
|
<t t-foreach="get_months_tol()" t-as="t">
|
||||||
|
<td><strong><span>Total</span></strong></td>
|
||||||
<t t-foreach="t" t-as="tdata">
|
<t t-foreach="t" t-as="tdata">
|
||||||
<t t-if="tdata=='Total'">
|
<td class="text-right"><strong><span t-esc="formatLang(tdata, currency_obj=company.currency_id)"/></strong></td>
|
||||||
<td><strong><span>Total</span></strong></td>
|
|
||||||
</t>
|
|
||||||
<t t-if="tdata!='Total'">
|
|
||||||
<td class="text-right"><strong><span t-esc="formatLang(tdata, currency_obj=company.currency_id)"/></strong></td>
|
|
||||||
</t>
|
|
||||||
</t>
|
</t>
|
||||||
<td class="text-right"><strong><span t-esc="formatLang(get_total(), currency_obj=company.currency_id)" /></strong></td>
|
<td class="text-right"><strong><span t-esc="formatLang(get_total(), currency_obj=company.currency_id)" /></strong></td>
|
||||||
</t>
|
</t>
|
||||||
|
|
Loading…
Reference in New Issue