Ravish Murari(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-polish3_hr_payrool-rmu into
lp:openobject-addons.
Requested reviews:
Amit (Open ERP) (apa-tiny)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-polish3_hr_payrool-rmu/+merge/83015
Hello sir
I have done following changes
* add python constraints date_from < date_to
* Name of the reports should not be 'test.pdf.pdf' but 'payslip.pdf'
* on the "create payslip" pop-up, in the "other info" tab, the "expense
journal" field must have a default value
Thanks
Ravish
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-polish3_hr_payrool-rmu/+merge/83015
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-polish3_hr_payrool-rmu.
=== modified file 'hr_payroll/hr_payroll.py'
--- hr_payroll/hr_payroll.py 2011-11-15 14:07:23 +0000
+++ hr_payroll/hr_payroll.py 2011-11-22 12:52:11 +0000
@@ -297,6 +297,16 @@
self.pool.get('res.users').browse(cr, uid, uid,
context=context).company_id.id,
}
+
+ def _check_dates(self, cr, uid, ids, context=None):
+ for i in self.read(cr, uid, ids, ['date_from', 'date_to'], context=context):
+ if i['date_from'] > i['date_to']:
+ return False
+ return True
+
+ _constraints = [
+ (_check_dates, 'Error! Payslip from-date must be lower then contract to-date.', ['date_from', 'date_to'])
+ ]
def copy(self, cr, uid, id, default=None, context=None):
if not default:
=== modified file 'hr_payroll/hr_payroll_report.xml'
--- hr_payroll/hr_payroll_report.xml 2011-05-24 13:12:57 +0000
+++ hr_payroll/hr_payroll_report.xml 2011-11-22 12:52:11 +0000
@@ -6,7 +6,7 @@
auto="False"
id="payslip_report"
model="hr.payslip"
- name="test.pdf"
+ name="Payslip"
rml="hr_payroll/report/report_payslip.rml"
string="Employee PaySlip" />
=== modified file 'hr_payroll_account/hr_payroll_account.py'
--- hr_payroll_account/hr_payroll_account.py 2011-11-17 19:14:55 +0000
+++ hr_payroll_account/hr_payroll_account.py 2011-11-22 12:52:11 +0000
@@ -33,6 +33,13 @@
'''
_inherit = 'hr.payslip'
_description = 'Pay Slip'
+
+ def _get_journal(self, cr, uid, context=None):
+ if context is None:
+ context = {}
+ journal_obj = self.pool.get('account.journal')
+ res = journal_obj.search(cr, uid, [('type', '=','sale')])
+ return res and res[0] or False
_columns = {
'period_id': fields.many2one('account.period', 'Force Period',states={'draft': [('readonly', False)]}, readonly=True, domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."),
@@ -40,6 +47,10 @@
'move_id': fields.many2one('account.move', 'Accounting Entry', readonly=True),
}
+ _defaults = {
+ 'journal_id': _get_journal,
+ }
+
def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp