[MERGE] with trunk
authorThibault Francois <tfr@openerp.com>
Wed, 10 Nov 2010 12:09:02 +0000 (13:09 +0100)
committerThibault Francois <tfr@openerp.com>
Wed, 10 Nov 2010 12:09:02 +0000 (13:09 +0100)
bzr revid: tfr@openerp.com-20101110120902-k60lls4irx842pq2

1  2 
addons/hr_payroll/hr_payroll.py
addons/hr_payroll/report/report_employees_detail.py
addons/hr_payroll/report/report_payroll_advice.py
addons/hr_payroll/report/report_payslip.py
addons/hr_payroll/report/report_year_salary.py
addons/hr_payroll/report/rml_parse.py
addons/hr_payroll_account/hr_payroll_account.py
addons/hr_recruitment/wizard/hr_recruitment_phonecall.py

@@@ -6,16 -6,16 +6,16 @@@
  #    d$
  #
  #    This program is free software: you can redistribute it and/or modify
 -#    it under the terms of the GNU General Public License as published by
 +#    it under the terms of the GNU Affero General Public License as published by
  #    the Free Software Foundation, either version 3 of the License, or
  #    (at your option) any later version.
  #
  #    This program is distributed in the hope that it will be useful,
  #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -#    GNU General Public License for more details.
 +#    GNU Affero General Public License for more details.
  #
 -#    You should have received a copy of the GNU General Public License
 +#    You should have received a copy of the GNU Affero General Public License
  #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  #
  ##############################################################################
@@@ -27,8 -27,8 +27,8 @@@ from datetime import timedelt
  
  import netsvc
  from osv import fields, osv
- from tools import config
  from tools.translate import _
+ import decimal_precision as dp
  
  def prev_bounds(cdate=False):
      when = date.fromtimestamp(time.mktime(time.strptime(cdate,"%Y-%m-%d")))
@@@ -52,8 -52,9 +52,9 @@@ class hr_contract_wage_type(osv.osv)
  
      _inherit = 'hr.contract.wage.type'
      _columns = {
-         'type' : fields.selection([('basic','Basic'), ('gross','Gross'), ('net','Net')], 'Type', required=True),
+         'type': fields.selection([('basic','Basic'), ('gross','Gross'), ('net','Net')], 'Type', required=True),
      }
  hr_contract_wage_type()
  
  class hr_passport(osv.osv):
@@@ -120,8 -121,7 +121,7 @@@ class hr_payroll_structure(osv.osv)
              'code':code+"(copy)",
              'company_id':self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
          }
-         res_id = super(hr_payroll_structure, self).copy(cr, uid, id, default, context=context)
-         return res_id
+         return super(hr_payroll_structure, self).copy(cr, uid, id, default, context=context)
  
  hr_payroll_structure()
  
@@@ -135,7 -135,6 +135,6 @@@ class hr_contract(osv.osv)
          res = {}
          ids += context.get('employee_structure', [])
  
-         slip_pool = self.pool.get('hr.payslip')
          slip_line_pool = self.pool.get('hr.payslip.line')
  
          for contract in self.browse(cr, uid, ids, context):
                  update['basic'] = contract.wage
  
              sal_type = contract.wage_type_id.type
-             function = contract.struct_id.id
+ #            function = contract.struct_id.id
              lines = contract.struct_id.line_ids
              if not contract.struct_id:
                  res[contract.id] = obj['basic']
                  continue
  
              ad = []
-             c_type = {}
              for line in lines:
                  cd = line.code.lower()
                  obj[cd] = line.amount or 0.0
                      exp = line.category_id.condition
                      calculate = eval(exp, obj)
                  except Exception, e:
-                     raise osv.except_osv(_('Variable Error !'), _('Variable Error : %s ' % (e)))
+                     raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
  
                  if not calculate:
                      continue
                  percent = 0.0
                  value = 0.0
                  base = False
-                 company_contrib = 0.0
+ #                company_contrib = 0.0
                  base = line.category_id.base
  
                  try:
                      #Please have a look at the configuration guide.
                      amt = eval(base, obj)
                  except Exception, e:
-                     raise osv.except_osv(_('Variable Error !'), _('Variable Error : %s ' % (e)))
+                     raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
  
                  if sal_type in ('gross', 'net'):
                      if line.amount_type == 'per':
                      per = (all_per - ded_per)
                  else:
                      per = all_per
-                 if per <=0 :
+                 if per <=0:
                      per *= -1
                  final = (per * 100) + 100
                  basic = (sal * 100) / final
                      try:
                          amount = line.amount * eval(str(line.category_id.base), obj)
                      except Exception, e:
-                         raise osv.except_osv(_('Variable Error !'), _('Variable Error : %s ' % (e)))
+                         raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
                  elif line.amount_type in ('fix', 'func'):
                      amount = line.amount
                  cd = line.category_id.code.lower()
      _inherit = 'hr.contract'
      _description = 'Employee Contract'
      _columns = {
-         'permit_no':fields.char('Work Permit No', size=256, required=False, readonly=False),
-         'passport_id':fields.many2one('hr.passport', 'Passport', required=False),
-         'visa_no':fields.char('Visa No', size=64, required=False, readonly=False),
+         'permit_no': fields.char('Work Permit No', size=256, required=False, readonly=False),
+         'passport_id': fields.many2one('hr.passport', 'Passport', required=False),
+         'visa_no': fields.char('Visa No', size=64, required=False, readonly=False),
          'visa_expire': fields.date('Visa Expire Date'),
-         'struct_id' : fields.many2one('hr.payroll.structure', 'Salary Structure'),
+         'struct_id': fields.many2one('hr.payroll.structure', 'Salary Structure'),
          'working_days_per_week': fields.integer('Working Days', help="No of Working days / week for an employee"),
          'basic': fields.function(_calculate_salary, method=True, store=True, multi='dc', type='float', string='Basic Salary', digits=(14,2)),
          'gross': fields.function(_calculate_salary, method=True, store=True, multi='dc', type='float', string='Gross Salary', digits=(14,2)),
@@@ -395,8 -393,6 +393,6 @@@ class payroll_register(osv.osv)
      def compute_sheet(self, cr, uid, ids, context=None):
          emp_pool = self.pool.get('hr.employee')
          slip_pool = self.pool.get('hr.payslip')
-         func_pool = self.pool.get('hr.payroll.structure')
-         slip_line_pool = self.pool.get('hr.payslip.line')
          wf_service = netsvc.LocalService("workflow")
          if context is None:
              context = {}
@@@ -859,7 -855,7 +855,7 @@@ class hr_payslip(osv.osv)
                      try:
                          amount = line.amount * eval(str(line.category_id.base), obj)
                      except Exception, e:
-                         raise osv.except_osv(_('Variable Error !'), _('Variable Error : %s ' % (e)))
+                         raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
                  elif line.amount_type in ('fix', 'func'):
                      amount = line.amount
                  cd = line.category_id.code.lower()
                  slip_line_obj.write(cr, uid, [line.id], {'total':amount}, context=context)
  
              record = {
-                 'allounce':round(allow),
-                 'deduction':round(deduct),
-                 'grows':round(rs.basic + allow),
-                 'net':round(rs.basic + allow - deduct),
+                 'allounce':allow,
+                 'deduction':deduct,
+                 'grows':rs.basic + allow,
+                 'net':rs.basic + allow - deduct,
                  'other_pay':others,
-                 'total_pay':round(rs.basic + allow - deduct)
+                 'total_pay':rs.basic + allow - deduct
              }
              res[rs.id] = record
          return res
              ('done','Paid Salary'),
              ('cancel','Reject'),
          ],'State', select=True, readonly=True),
-         'basic_before_leaves': fields.float('Basic Salary', readonly=True,  digits=(16, 2)),
-         'leaves': fields.float('Leave Deductions', readonly=True,  digits=(16, 2)),
-         'basic': fields.float('Net Basic', readonly=True,  digits=(16, 2)),
-         'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Salary', type='float', digits=(16, 2)),
-         'net': fields.function(_calculate, method=True, store=True, multi='dc', string='Net Salary', digits=(16, 2)),
-         'allounce': fields.function(_calculate, method=True, store=True, multi='dc', string='Allowance', digits=(16, 2)),
-         'deduction': fields.function(_calculate, method=True, store=True, multi='dc', string='Deduction', digits=(16, 2)),
-         'other_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Others', digits=(16, 2)),
-         'total_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Total Payment', digits=(16, 2)),
+         'basic_before_leaves': fields.float('Basic Salary', readonly=True,  digits_compute=dp.get_precision('Account')),
+         'leaves': fields.float('Leave Deductions', readonly=True,  digits_compute=dp.get_precision('Account')),
+         'basic': fields.float('Net Basic', readonly=True,  digits_compute=dp.get_precision('Account')),
+         'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Salary', digits_compute=dp.get_precision('Account')),
+         'net': fields.function(_calculate, method=True, store=True, multi='dc', string='Net Salary', digits_compute=dp.get_precision('Account')),
+         'allounce': fields.function(_calculate, method=True, store=True, multi='dc', string='Allowance', digits_compute=dp.get_precision('Account')),
+         'deduction': fields.function(_calculate, method=True, store=True, multi='dc', string='Deduction', digits_compute=dp.get_precision('Account')),
+         'other_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Others', digits_compute=dp.get_precision('Account')),
+         'total_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Total Payment', digits_compute=dp.get_precision('Account')),
          'line_ids':fields.one2many('hr.payslip.line', 'slip_id', 'Payslip Line', required=False, readonly=True, states={'draft': [('readonly', False)]}),
          'company_id':fields.many2one('res.company', 'Company', required=False, readonly=True, states={'draft': [('readonly', False)]}),
          'holiday_days': fields.float('No of Leaves', readonly=True),
          return True
  
      def verify_sheet(self, cr, uid, ids, context={}):
-         payslip_pool = self.pool.get('hr.payslip.line')
          register_pool = self.pool.get('company.contribution')
          register_line_pool = self.pool.get('hr.contibution.register.line')
  
          return result
  
      def compute_sheet(self, cr, uid, ids, context=None):
          func_pool = self.pool.get('hr.payroll.structure')
          slip_line_pool = self.pool.get('hr.payslip.line')
          holiday_pool = self.pool.get('hr.holidays')
-         contract_obj = self.pool.get('hr.contract')
          sequence_obj = self.pool.get('ir.sequence')
          if context is None:
              context = {}
  
          #Check for the Holidays
          def get_days(start, end, month, year, calc_day):
-             count = 0
              import datetime
+             count = 0
              for day in range(start, end):
                  if datetime.date(year, month, day).weekday() == calc_day:
                      count += 1
              #lines += slip.employee_id.line_ids
  
              ad = []
-             lns = {}
              all_per = 0.0
              ded_per = 0.0
              all_fix = 0.0
                  obj['basic'] = contract.wage
                  update['basic'] = contract.wage
  
-             c_type = { }
              for line in lines:
                  cd = line.code.lower()
                  obj[cd] = line.amount or 0.0
                      exp = line.category_id.condition
                      calculate = eval(exp, obj)
                  except Exception, e:
-                     raise osv.except_osv(_('Variable Error !'), _('Variable Error : %s ' % (e)))
+                     raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
  
                  if not calculate:
                      continue
                  percent = 0.0
                  value = 0.0
                  base = False
-                 company_contrib = 0.0
+ #                company_contrib = 0.0
                  base = line.category_id.base
  
                  try:
                      #Please have a look at the configuration guide.
                      amt = eval(base, obj)
                  except Exception, e:
-                     raise osv.except_osv(_('Variable Error !'), _('Variable Error : %s ' % (e)))
+                     raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
  
                  if sal_type in ('gross', 'net'):
                      if line.amount_type == 'per':
                      per = (all_per - ded_per)
                  else:
                      per = all_per
-                 if per <=0 :
+                 if per <=0:
                      per *= -1
                  final = (per * 100) + 100
                  basic = (sal * 100) / final
  
                  slip_line_pool.create(cr, uid, res, context=context)
              basic = basic - total
-             leaves = total
+ #            leaves = total
              update.update({
                  'basic':basic,
                  'basic_before_leaves': round(basic_before_leaves),
@@@ -1332,7 -1322,6 +1322,6 @@@ class hr_payslip_line(osv.osv)
      _description = 'Payslip Line'
  
      def onchange_category(self, cr, uid, ids, category_id):
-         seq = 0
          res = {
          }
          if category_id:
              ('func','Function Value'),
          ],'Amount Type', select=True, required=True),
          'amount': fields.float('Amount / Percentage', digits=(16, 4)),
-         'total': fields.float('Sub Total', readonly=True, 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'),
@@@ -1459,7 -1448,7 +1448,7 @@@ class hr_employee(osv.osv)
                  try:
                      amt = eval(base, obj)
                  except Exception, e:
-                     raise osv.except_osv(_('Variable Error !'), _('Variable Error : %s ' % (e)))
+                     raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
                  amount = 0.0
                  if line.amount_type == 'per':
                      amount = amt * line.amount
@@@ -8,16 -8,16 +8,16 @@@
  #    d$
  #
  #    This program is free software: you can redistribute it and/or modify
 -#    it under the terms of the GNU General Public License as published by
 +#    it under the terms of the GNU Affero General Public License as published by
  #    the Free Software Foundation, either version 3 of the License, or
  #    (at your option) any later version.
  #
  #    This program is distributed in the hope that it will be useful,
  #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -#    GNU General Public License for more details.
 +#    GNU Affero General Public License for more details.
  #
 -#    You should have received a copy of the GNU General Public License
 +#    You should have received a copy of the GNU Affero General Public License
  #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  #
  ##############################################################################
@@@ -36,15 -36,15 +36,15 @@@ class employees_salary_report(rml_parse
          super(employees_salary_report, self).__init__(cr, uid, name, context)
          self.localcontext.update({
              'time': time,
-             'get_employee' : self.get_employee,
-             'get_employee_detail' : self.get_employee_detail,
-             'cal_monthly_amt':self.cal_monthly_amt,
-             'get_periods'  : self.get_periods,
-             'get_total' : self.get_total,
-             'get_allow':self.get_allow,
-             'get_deduct':self.get_deduct,
-             'get_other':self.get_other,
-             'get_monthly_total':self.get_monthly_total,
+             'get_employee': self.get_employee,
+             'get_employee_detail': self.get_employee_detail,
+             'cal_monthly_amt': self.cal_monthly_amt,
+             'get_periods': self.get_periods,
+             'get_total': self.get_total,
+             'get_allow': self.get_allow,
+             'get_deduct': self.get_deduct,
+             'get_other': self.get_other,
+             'get_monthly_total': self.get_monthly_total,
          })
  
          self.mnths =[]
@@@ -8,16 -8,16 +8,16 @@@
  #    d$
  #
  #    This program is free software: you can redistribute it and/or modify
 -#    it under the terms of the GNU General Public License as published by
 +#    it under the terms of the GNU Affero General Public License as published by
  #    the Free Software Foundation, either version 3 of the License, or
  #    (at your option) any later version.
  #
  #    This program is distributed in the hope that it will be useful,
  #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -#    GNU General Public License for more details.
 +#    GNU Affero General Public License for more details.
  #
 -#    You should have received a copy of the GNU General Public License
 +#    You should have received a copy of the GNU Affero General Public License
  #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  #
  ##############################################################################
@@@ -36,16 -36,16 +36,16 @@@ class payroll_advice_report(report_sxw.
          self.total_bysal = 0.00
          self.localcontext.update({
              'time': time,
-             'get_month'   : self.get_month,
-             'convert'     : self.convert,
-             'get_detail'  : self.get_detail,
-             'get_total'   : self.get_total,
-             'get_bysal_total'   : self.get_bysal_total,
+             'get_month': self.get_month,
+             'convert': self.convert,
+             'get_detail': self.get_detail,
+             'get_total': self.get_total,
+             'get_bysal_total': self.get_bysal_total,
          })
  
      def get_month(self,input_date):
          res = {
-                'mname':''
+                'mname': ''
                 }
          date = datetime.strptime(input_date, '%Y-%m-%d')
          res['mname']= date.strftime('%B')+'-'+date.strftime('%Y')
@@@ -8,16 -8,16 +8,16 @@@
  #    d$
  #
  #    This program is free software: you can redistribute it and/or modify
 -#    it under the terms of the GNU General Public License as published by
 +#    it under the terms of the GNU Affero General Public License as published by
  #    the Free Software Foundation, either version 3 of the License, or
  #    (at your option) any later version.
  #
  #    This program is distributed in the hope that it will be useful,
  #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -#    GNU General Public License for more details.
 +#    GNU Affero General Public License for more details.
  #
 -#    You should have received a copy of the GNU General Public License
 +#    You should have received a copy of the GNU Affero General Public License
  #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  #
  ##############################################################################
@@@ -51,7 -51,7 +51,7 @@@ class payslip_report(report_sxw.rml_par
          for id in range(len(obj)):
              if obj[id].category_id.type in ('advance', 'loan', 'otherpay', 'otherdeduct', 'installment'):
                  ids.append(obj[id].id)
-         if len(ids):
+         if ids:
              res = payslip_line.browse(self.cr, self.uid, ids)
          return res
  
@@@ -62,7 -62,7 +62,7 @@@
          for id in range(len(obj)):
              if obj[id].type == 'leaves':
                  ids.append(obj[id].id)
-         if len(ids):
+         if ids:
              res = payslip_line.browse(self.cr, self.uid, ids)
          return res
  
@@@ -73,7 -73,7 +73,7 @@@
          for id in range(len(obj)):
              if obj[id].category_id.type == 'allowance' and obj[id].type != 'leaves':
                  ids.append(obj[id].id)
-         if len(ids):
+         if ids:
              res = payslip_line.browse(self.cr, self.uid, ids)
          return res
  
@@@ -84,7 -84,7 +84,7 @@@
          for id in range(len(obj)):
              if obj[id].category_id.type == 'deduction' and obj[id].type != 'leaves':
                  ids.append(obj[id].id)
-         if len(ids):
+         if ids:
              res = payslip_line.browse(self.cr, self.uid, ids)
          return res
  
@@@ -8,16 -8,16 +8,16 @@@
  #    d$
  #
  #    This program is free software: you can redistribute it and/or modify
 -#    it under the terms of the GNU General Public License as published by
 +#    it under the terms of the GNU Affero General Public License as published by
  #    the Free Software Foundation, either version 3 of the License, or
  #    (at your option) any later version.
  #
  #    This program is distributed in the hope that it will be useful,
  #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -#    GNU General Public License for more details.
 +#    GNU Affero General Public License for more details.
  #
 -#    You should have received a copy of the GNU General Public License
 +#    You should have received a copy of the GNU Affero General Public License
  #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  #
  ##############################################################################
@@@ -34,10 -34,10 +34,10 @@@ class year_salary_report(rml_parse.rml_
          super(year_salary_report, self).__init__(cr, uid, name, context)
          self.localcontext.update({
              'time': time,
-             'get_employee' : self.get_employee,
-             'get_periods'  : self.get_periods,
-             'get_months_tol' : self.get_months_tol,
-             'get_total' : self.get_total,
+             'get_employee': self.get_employee,
+             'get_periods': self.get_periods,
+             'get_months_tol': self.get_months_tol,
+             'get_total': self.get_total,
          })
  
          self.mnths =[]
@@@ -6,16 -6,16 +6,16 @@@
  #    $Id$
  #
  #    This program is free software: you can redistribute it and/or modify
 -#    it under the terms of the GNU General Public License as published by
 +#    it under the terms of the GNU Affero General Public License as published by
  #    the Free Software Foundation, either version 3 of the License, or
  #    (at your option) any later version.
  #
  #    This program is distributed in the hope that it will be useful,
  #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -#    GNU General Public License for more details.
 +#    GNU Affero General Public License for more details.
  #
 -#    You should have received a copy of the GNU General Public License
 +#    You should have received a copy of the GNU Affero General Public License
  #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  #
  ##############################################################################
@@@ -32,16 -32,16 +32,16 @@@ class rml_parse(report_sxw.rml_parse)
          self.localcontext.update({
              'comma_me': self.comma_me,
              'format_date': self._get_and_change_date_format_for_swiss,
-             'strip_name' : self._strip_name,
-             'explode_name' : self._explode_name,
+             'strip_name': self._strip_name,
+             'explode_name': self._explode_name,
          })
  
      def comma_me(self,amount):
          if not amount:
              amount = 0.0
-         if  type(amount) is float :
+         if  type(amount) is float:
              amount = str('%.2f'%amount)
-         else :
+         else:
              amount = str(amount)
          if (amount == '0'):
               return ' '
          head_dom = etree.XML(rml_head)
          for tag in head_dom:
              found = rml_dom.find('.//'+tag.tag)
-             if found is not None and len(found):
+             if found is not None and found:
                  if tag.get('position'):
                      found.append(tag)
-                 else :
+                 else:
                      found.getparent().replace(found,tag)
          return True
  
@@@ -6,16 -6,16 +6,16 @@@
  #    d$
  #
  #    This program is free software: you can redistribute it and/or modify
 -#    it under the terms of the GNU General Public License as published by
 +#    it under the terms of the GNU Affero General Public License as published by
  #    the Free Software Foundation, either version 3 of the License, or
  #    (at your option) any later version.
  #
  #    This program is distributed in the hope that it will be useful,
  #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -#    GNU General Public License for more details.
 +#    GNU Affero General Public License for more details.
  #
 -#    You should have received a copy of the GNU General Public License
 +#    You should have received a copy of the GNU Affero General Public License
  #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  #
  ##############################################################################
@@@ -42,7 -42,7 +42,7 @@@ def prev_bounds(cdate=False)
  class hr_payroll_structure(osv.osv):
      _inherit = 'hr.payroll.structure'
      _description = 'Salary Structure'
-     
      _columns = {
          'account_id':fields.many2one('account.analytic.account', 'Analytic Account'),
      }
@@@ -97,13 -97,13 +97,13 @@@ hr_employee(
  class payroll_register(osv.osv):
      _inherit = 'hr.payroll.register'
      _description = 'Payroll Register'
-     
      _columns = {
          'journal_id': fields.many2one('account.journal', 'Expanse Journal'),
          'bank_journal_id': fields.many2one('account.journal', 'Bank Journal'),
          'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."),
      }
-     
      def compute_sheet(self, cr, uid, ids, context={}):
          emp_pool = self.pool.get('hr.employee')
          slip_pool = self.pool.get('hr.payslip')
@@@ -141,7 -141,7 +141,7 @@@ payroll_register(
  class payroll_advice(osv.osv):
      _inherit = 'hr.payroll.advice'
      _description = 'Bank Advice Note'
-     
      _columns = {
          'account_id': fields.many2one('account.account', 'Account'),
      }
@@@ -179,7 -179,7 +179,7 @@@ class contrib_register(osv.osv)
                  'yearly_total_by_comp':c_year
              }
          return res
-     
      _columns = {
          'account_id': fields.many2one('account.account', 'Account'),
          'analytic_account_id':fields.many2one('account.analytic.account', 'Analytic Account'),
@@@ -191,7 -191,7 +191,7 @@@ contrib_register(
  class contrib_register_line(osv.osv):
      _inherit = 'hr.contibution.register.line'
      _description = 'Contribution Register Line'
-     
      _columns = {
          'period_id': fields.many2one('account.period', 'Period'),
      }
@@@ -296,29 -296,29 +296,29 @@@ class hr_payslip(osv.osv)
  
              name = "To %s account" % (slip.employee_id.name)
              ded_rec = {
-                 'move_id':move_id,
+                 'move_id': move_id,
                  'name': name,
                  'date': slip.date,
                  'account_id': slip.employee_id.property_bank_account.id,
                  'debit': 0.0,
-                 'credit' : slip.total_pay,
-                 'journal_id' : slip.journal_id.id,
-                 'period_id' :period_id,
-                 'ref':slip.number
+                 'credit': slip.total_pay,
+                 'journal_id': slip.journal_id.id,
+                 'period_id': period_id,
+                 'ref': slip.number
              }
              line_ids += [movel_pool.create(cr, uid, ded_rec, context=context)]
              name = "By %s account" % (slip.employee_id.property_bank_account.name)
              cre_rec = {
-                 'move_id':move_id,
+                 'move_id': move_id,
                  'name': name,
                  'partner_id': partner_id,
                  'date': slip.date,
                  'account_id': partner.property_account_payable.id,
-                 'debit':  slip.total_pay,
-                 'credit' : 0.0,
-                 'journal_id' : slip.journal_id.id,
-                 'period_id' :period_id,
-                 'ref':slip.number
+                 'debit': slip.total_pay,
+                 'credit': 0.0,
+                 'journal_id': slip.journal_id.id,
+                 'period_id': period_id,
+                 'ref': slip.number
              }
              line_ids += [movel_pool.create(cr, uid, cre_rec, context=context)]
  
                      continue
  
                  rec = {
-                     'move_id':move_id,
+                     'move_id': move_id,
                      'name': name,
                      'date': slip.date,
                      'account_id': line.account_id.id,
                      'debit': 0.0,
-                     'credit' : 0.0,
-                     'journal_id' : slip.journal_id.id,
-                     'period_id' :period_id,
-                     'analytic_account_id':False,
-                     'ref':slip.number,
-                     'quantity':1
+                     'credit': 0.0,
+                     'journal_id': slip.journal_id.id,
+                     'period_id': period_id,
+                     'analytic_account_id': False,
+                     'ref': slip.number,
+                     'quantity': 1
                  }
  
                  #Setting Analysis Account for Salary Slip Lines
                      if not partner.property_account_payable:
                          raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Payable Account!!'))
                      ded_rec = {
-                         'move_id':move_id,
+                         'move_id': move_id,
                          'name': name,
                          'partner_id': partner_id,
                          'date': slip.date,
                          'account_id': partner.property_account_payable.id,
                          'debit': 0.0,
-                         'quantity':1,
-                         'credit' : amount,
-                         'journal_id' : slip.journal_id.id,
-                         'period_id' :period_id,
-                         'ref':slip.number
+                         'quantity': 1,
+                         'credit': amount,
+                         'journal_id': slip.journal_id.id,
+                         'period_id': period_id,
+                         'ref': slip.number
                      }
                      line_ids += [movel_pool.create(cr, uid, ded_rec, context=context)]
                  elif line.type == 'deduction' or line.type == 'otherdeduct':
                      rec['credit'] = amount
                      total_deduct += amount
                      ded_rec = {
-                         'move_id':move_id,
+                         'move_id': move_id,
                          'name': name,
                          'partner_id': partner_id,
                          'date': slip.date,
-                         'quantity':1,
+                         'quantity': 1,
                          'account_id': partner.property_account_receivable.id,
                          'debit': amount,
-                         'credit' : 0.0,
-                         'journal_id' : slip.journal_id.id,
-                         'period_id' :period_id,
-                         'ref':slip.number
+                         'credit': 0.0,
+                         'journal_id': slip.journal_id.id,
+                         'period_id': period_id,
+                         'ref': slip.number
                      }
                      line_ids += [movel_pool.create(cr, uid, ded_rec, context=context)]
  
                      'period_id': period_id,
                      'date': slip.date,
                      'ref':slip.number,
-                     'narration': 'Adjustment : %s' % (slip.name)
+                     'narration': 'Adjustment: %s' % (slip.name)
                  }
                  adj_move_id = move_pool.create(cr, uid, move, context=context)
                  name = "Adjustment Entry - %s" % (slip.employee_id.name)
                  self.create_voucher(cr, uid, [slip.id], name, adj_move_id)
  
                  ded_rec = {
-                     'move_id':adj_move_id,
+                     'move_id': adj_move_id,
                      'name': name,
                      'partner_id': partner_id,
                      'date': slip.date,
                      'account_id': partner.property_account_receivable.id,
                      'debit': 0.0,
-                     'quantity':1,
-                     'credit' : total_deduct,
-                     'journal_id' : slip.journal_id.id,
-                     'period_id' :period_id,
-                     'ref':slip.number
+                     'quantity': 1,
+                     'credit': total_deduct,
+                     'journal_id': slip.journal_id.id,
+                     'period_id': period_id,
+                     'ref': slip.number
                  }
                  line_ids += [movel_pool.create(cr, uid, ded_rec, context=context)]
                  cre_rec = {
-                     'move_id':adj_move_id,
+                     'move_id': adj_move_id,
                      'name': name,
                      'partner_id': partner_id,
                      'date': slip.date,
                      'account_id': partner.property_account_payable.id,
                      'debit': total_deduct,
-                     'quantity':1,
-                     'credit' : 0.0,
-                     'journal_id' : slip.journal_id.id,
-                     'period_id' :period_id,
-                     'ref':slip.number
+                     'quantity': 1,
+                     'credit': 0.0,
+                     'journal_id': slip.journal_id.id,
+                     'period_id': period_id,
+                     'ref': slip.number
                  }
                  line_ids += [movel_pool.create(cr, uid, cre_rec, context=context)]
  
@@@ -6,16 -6,16 +6,16 @@@
  #    $Id$
  #
  #    This program is free software: you can redistribute it and/or modify
 -#    it under the terms of the GNU General Public License as published by
 +#    it under the terms of the GNU Affero General Public License as published by
  #    the Free Software Foundation, either version 3 of the License, or
  #    (at your option) any later version.
  #
  #    This program is distributed in the hope that it will be useful,
  #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -#    GNU General Public License for more details.
 +#    GNU Affero General Public License for more details.
  #
 -#    You should have received a copy of the GNU General Public License
 +#    You should have received a copy of the GNU Affero General Public License
  #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  #
  ##############################################################################
@@@ -82,19 -82,19 +82,19 @@@ class job2phonecall(osv.osv_memory)
              id3 = data_obj.browse(cr, uid, id3, context=context).res_id
  
          for job in job_case_obj.browse(cr, uid, context['active_ids'], context=context):
-             #TODO : Take other info from job
+             #TODO: Take other info from job
              new_phonecall_id = phonecall_case_obj.create(cr, uid, {
-                         'name' : job.name,
-                         'user_id' : form['user_id'],
-                         'categ_id' : form['category_id'],
-                         'description' : form['note'],
-                         'date' : form['deadline'],
-                         'description':job.description,
-                         'partner_id':job.partner_id.id,
-                         'partner_address_id':job.partner_address_id.id,
-                         'partner_phone':job.partner_phone,
-                         'partner_mobile':job.partner_mobile,
-                         'description':job.description,
+                         'name': job.name,
+                         'user_id': form['user_id'],
+                         'categ_id': form['category_id'],
+                         'description': form['note'],
+                         'date': form['deadline'],
+                         'description': job.description,
+                         'partner_id': job.partner_id.id,
+                         'partner_address_id': job.partner_address_id.id,
+                         'partner_phone': job.partner_phone,
+                         'partner_mobile': job.partner_mobile,
+                         'description': job.description,
                          'date':job.date,
                      }, context=context)
              new_phonecall = phonecall_case_obj.browse(cr, uid, new_phonecall_id, context=context)
              'view_type': 'form',
              'view_mode': 'tree,form',
              'res_model': 'crm.phonecall',
-             'res_id' : new_phonecall_id,
+             'res_id': new_phonecall_id,
              'views': [(id3,'form'), (id2,'tree'), (False,'calendar'), (False,'graph')],
              'type': 'ir.actions.act_window',
              'search_view_id': res['res_id']