[FIX] payroll-related modules are back as installable = True (disabled because of former conflicts with the new accounting that are now solved in this commit)
This commit is contained in:
@@ -46,10 +46,10 @@ class hr_payslip(osv.osv):
|
||||
}
|
||||
|
||||
def _get_default_journal(self, cr, uid, context=None):
|
||||
model_data = self.pool.get('ir.model.data')
|
||||
res = model_data.search(cr, uid, [('name', '=', 'expenses_journal')])
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
res = journal_obj.search(cr, uid, [('type', '=', 'general')])
|
||||
if res:
|
||||
return model_data.browse(cr, uid, res[0]).res_id
|
||||
return res[0]
|
||||
return False
|
||||
|
||||
_defaults = {
|
||||
@@ -204,10 +204,10 @@ class hr_payslip_run(osv.osv):
|
||||
}
|
||||
|
||||
def _get_default_journal(self, cr, uid, context=None):
|
||||
model_data = self.pool.get('ir.model.data')
|
||||
res = model_data.search(cr, uid, [('name', '=', 'expenses_journal')])
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
res = journal_obj.search(cr, uid, [('type', '=', 'general')])
|
||||
if res:
|
||||
return model_data.browse(cr, uid, res[0]).res_id
|
||||
return res[0]
|
||||
return False
|
||||
|
||||
_defaults = {
|
||||
|
||||
@@ -28,5 +28,5 @@ Belgian Payroll Rules.
|
||||
'l10n_be_hr_payroll_data.xml',
|
||||
'data/hr.salary.rule.csv',
|
||||
],
|
||||
'installable': False
|
||||
'installable': True
|
||||
}
|
||||
|
||||
@@ -1,2 +1,14 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from openerp import SUPERUSER_ID
|
||||
|
||||
def _set_accounts(cr, registry):
|
||||
#write the default debit account on salary rule having xml_id like 'l10n_be_hr_payroll.1' up to 'l10n_be_hr_payroll.1409'
|
||||
model_obj = registry['ir.model.data']
|
||||
names = [str(x) for x in range(1,1410)]
|
||||
rec_ids = model_obj.search(cr, SUPERUSER_ID, [('model', '=', 'hr.salary.rule'), ('module', '=', 'l10n_be_hr_payroll'), ('name', 'in', names)], {})
|
||||
account_ids = registry['account.account'].search(cr, SUPERUSER_ID, [('code', 'like', '4530%')], {})
|
||||
if account_ids and rec_ids:
|
||||
rule_ids = [x['res_id'] for x in model_obj.read(cr, SUPERUSER_ID, rec_ids, ['res_id'])]
|
||||
registry['hr.salary.rule'].write(cr, SUPERUSER_ID, rule_ids, {'account_debit': account_ids[0]})
|
||||
|
||||
@@ -15,7 +15,7 @@ Accounting Data for Belgian Payroll Rules.
|
||||
'demo': [],
|
||||
'data':[
|
||||
'l10n_be_hr_payroll_account_data.xml',
|
||||
'data/hr.salary.rule.csv',
|
||||
],
|
||||
'installable': False
|
||||
'post_init_hook': '_set_accounts',
|
||||
'installable': True
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,5 +33,5 @@ TODO:
|
||||
'views/report_l10nfrfichepaye.xml',
|
||||
'l10n_fr_hr_payroll_reports.xml',
|
||||
],
|
||||
'installable': False
|
||||
'installable': True
|
||||
}
|
||||
|
||||
@@ -45,5 +45,5 @@ Indian Payroll Salary Rules.
|
||||
],
|
||||
|
||||
'demo': ['l10n_in_hr_payroll_demo.xml'],
|
||||
'installable': False
|
||||
'installable': True
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ class payroll_advice(osv.osv):
|
||||
if company_id:
|
||||
company = self.pool.get('res.company').browse(cr, uid, [company_id], context=context)[0]
|
||||
if company.partner_id.bank_ids:
|
||||
res.update({'bank_id': company.partner_id.bank_ids[0].bank.id})
|
||||
res.update({'bank_id': company.partner_id.bank_ids[0].bank_id.id})
|
||||
return {
|
||||
'value':res
|
||||
}
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
|
||||
<data noupdate="1">
|
||||
<record id="action_client_l10n_in_hr_menu" model="ir.actions.client">
|
||||
<field name="name">Open Account Dashboard Menu</field>
|
||||
<field name="tag">reload</field>
|
||||
<field name="params" eval="{'menu_id': ref('account.menu_board_journal_1')}"/>
|
||||
</record>
|
||||
<record id="base.open_menu" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_client_l10n_in_hr_menu"/>
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
</data>
|
||||
<data>
|
||||
|
||||
<record id="hr_contract_form_in_inherit" model="ir.ui.view">
|
||||
|
||||
Reference in New Issue
Block a user