Khushboo Bhatt(openerp) has proposed merging
lp:~openerp-dev/openerp-india/payroll-india-trunk-payroll-advice-improvements-kbh
into lp:~openerp-dev/openerp-india/payroll-india-trunk.
Requested reviews:
OpenERP R&D Team (openerp-dev)
For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-india/payroll-india-trunk-payroll-advice-improvements-kbh/+merge/110023
Hello,
====l10n_in_hr_payroll====
I Have done following changes.
- sequence file added for payment advice.
- access rights for payment advice.
- added field tool-tip and read-only true fields.
- default text on field.
- removed buttons from tree view and string of states are changed.
Thank you,
KBH.
--
https://code.launchpad.net/~openerp-dev/openerp-india/payroll-india-trunk-payroll-advice-improvements-kbh/+merge/110023
Your team OpenERP R&D Team is requested to review the proposed merge of
lp:~openerp-dev/openerp-india/payroll-india-trunk-payroll-advice-improvements-kbh
into lp:~openerp-dev/openerp-india/payroll-india-trunk.
=== modified file 'l10n_in_hr_payroll/__openerp__.py'
--- l10n_in_hr_payroll/__openerp__.py 2012-06-12 05:57:10 +0000
+++ l10n_in_hr_payroll/__openerp__.py 2012-06-13 10:20:25 +0000
@@ -49,6 +49,7 @@
'l10n_in_hr_payroll_data.xml',
'data/hr.salary.rule.csv',
'l10n_in_hr_payroll_report.xml',
+ 'l10n_in_hr_payroll_sequence.xml'
],
'demo_xml': ['l10n_in_hr_payroll_demo.xml'],
'installable': True
=== modified file 'l10n_in_hr_payroll/l10n_in_hr_payroll.py'
--- l10n_in_hr_payroll/l10n_in_hr_payroll.py 2012-06-12 05:57:10 +0000
+++ l10n_in_hr_payroll/l10n_in_hr_payroll.py 2012-06-13 10:20:25 +0000
@@ -104,14 +104,14 @@
_columns = {
'name':fields.char('Name', size=32, readonly=True, required=True, states={'draft': [('readonly', False)]},),
'note': fields.text('Description'),
- 'date': fields.date('Date', states={'draft': [('readonly', False)]},),
+ 'date': fields.date('Date', readonly=True, states={'draft': [('readonly', False)]}, help="Date is used to search Payslips."),
'state':fields.selection([
- ('draft','Draft Sheet'),
- ('confirm','Confirm Sheet'),
+ ('draft','Draft'),
+ ('confirm','Confirm'),
('cancel','Cancelled'),
],'State', select=True, readonly=True),
'number':fields.char('Number', size=16, readonly=True),
- 'line_ids':fields.one2many('hr.payroll.advice.line', 'advice_id', 'Employee Salary', states={'draft': [('readonly', False)]}),
+ 'line_ids':fields.one2many('hr.payroll.advice.line', 'advice_id', 'Employee Salary', states={'draft': [('readonly', False)]}, readonly=True),
'chaque_nos':fields.char('Chaque Nos', size=256),
'company_id':fields.many2one('res.company', 'Company',required=True, states={'draft': [('readonly', False)]}),
'bank_id':fields.many2one('res.bank', 'Bank', readonly=True, states={'draft': [('readonly', False)]}, help="Select the Bank Address from whcih the salary is going to be paid"),
@@ -123,12 +123,15 @@
'company_id': lambda self, cr, uid, context: \
self.pool.get('res.users').browse(cr, uid, uid,
context=context).company_id.id,
+ 'note': "Bank Payment advice contain the payment amount, payment date, company name, bank and other information of the payment."
+
}
def compute_advice(self, cr, uid, ids, context=None):
payslip_pool = self.pool.get('hr.payslip')
advice_line_pool = self.pool.get('hr.payroll.advice.line')
payslip_line_pool = self.pool.get('hr.payslip.line')
+ sequence_pool = self.pool.get('ir.sequence')
for advice in self.browse(cr, uid, ids, context=context):
old_line_ids = advice_line_pool.search(cr, uid, [('advice_id','=',advice.id)], context=context)
@@ -152,10 +155,15 @@
'bysal': line.total
}
advice_line_pool.create(cr, uid, advice_line, context=context)
- return True
+ number = self.pool.get('ir.sequence').get(cr, uid, 'payment.advice')
+ self.write(cr, uid, ids, {'number':number}, context=context)
def confirm_sheet(self, cr, uid, ids, context=None):
- return self.write(cr, uid, ids, {'state':'confirm'}, context=context)
+ for advice in self.browse(cr, uid, ids, context=context):
+ if not advice.line_ids:
+ raise osv.except_osv(_('No Payment Advice Lines !'), _('Please create some advice lines.'))
+ else:
+ return self.write(cr, uid, ids, {'state':'confirm'}, context=context)
def set_to_draft(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state':'draft'}, context=context)
=== added file 'l10n_in_hr_payroll/l10n_in_hr_payroll_sequence.xml'
--- l10n_in_hr_payroll/l10n_in_hr_payroll_sequence.xml 1970-01-01 00:00:00 +0000
+++ l10n_in_hr_payroll/l10n_in_hr_payroll_sequence.xml 2012-06-13 10:20:25 +0000
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data noupdate="1">
+ <record id="seq_type_payment_advice" model="ir.sequence.type">
+ <field name="name">Payment Advice</field>
+ <field name="code">payment.advice</field>
+ </record>
+ <record id="seq_payment_advice" model="ir.sequence">
+ <field name="name">Payment Advice</field>
+ <field name="code">payment.advice</field>
+ <field name="prefix">PAY/%(month)s/%(year)s/</field>
+ <field name="padding">3</field>
+ </record>
+ </data>
+</openerp>
\ No newline at end of file
=== modified file 'l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml'
--- l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml 2012-06-12 05:57:10 +0000
+++ l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml 2012-06-13 10:20:25 +0000
@@ -10,7 +10,7 @@
<field name="inherit_id" ref="hr_contract.hr_contract_view_form"/>
<field name="arch" type="xml">
<data>
- <xpath expr="/form/notebook/page[@name='information']/group[@name='right_column']/field[@name='struct_id']" position="after">
+ <xpath expr="//field[@name='struct_id']" position="after">
<group col="2" colspan="2" name="right_column">
<separator colspan="2" string="Allowance"/>
<field name="food_coupon_amount"/>
@@ -61,10 +61,6 @@
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="bank_id" select="1"/>
<field name="state"/>
- <button name="compute_advice" string="Compute Advice" icon="terp-document-new" states="draft" type="object"/>
- <button name="cancel_sheet" string="Cancel Sheet" states="draft" icon="gtk-cancel" type="object"/>
- <button name="confirm_sheet" icon="gtk-apply" string="Confirm Sheet" states="draft" type="object"/>
- <button name="set_to_draft" string="Set to Draft" icon="gtk-convert" states="cancel,confirm" type="object"/>
</tree>
</field>
</record>
=== modified file 'l10n_in_hr_payroll/security/hr.salary.rule.csv'
--- l10n_in_hr_payroll/security/hr.salary.rule.csv 2012-05-23 05:45:19 +0000
+++ l10n_in_hr_payroll/security/hr.salary.rule.csv 2012-06-13 10:20:25 +0000
@@ -1,2 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_salary_rule","hr.salary.rule","model_hr_salary_rule","base.group_hr_user",1,1,1,1
+"access_hr_payroll_advice","hr.payroll.advice","model_hr_payroll_advice","base.group_hr_manager",1,1,1,1
+"access_hr_payroll_advice_line","hr.payroll.advice.line","model_hr_payroll_advice_line","base.group_hr_manager",1,1,1,1
_______________________________________________
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