Bharat Devnani (Open ERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-bug-808704-bde into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #808704 in OpenERP Addons: "hr-expense : incmplete handling of canceld
and reopened invoices"
https://bugs.launchpad.net/openobject-addons/+bug/808704
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-808704-bde/+merge/68238
Hello Sir,
I have added the state in HR Expense Sheet and modified the hr expense workflow
accordingly.
Thanks & Regards,
Devnani Bharat R.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-808704-bde/+merge/68238
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-bug-808704-bde.
=== modified file 'hr_expense/hr_expense.py'
--- hr_expense/hr_expense.py 2011-07-06 14:56:44 +0000
+++ hr_expense/hr_expense.py 2011-07-18 11:41:32 +0000
@@ -20,7 +20,7 @@
##############################################################################
import time
-
+import netsvc
from osv import fields, osv
from tools.translate import _
import decimal_precision as dp
@@ -81,7 +81,8 @@
('accepted', 'Approved'),
('invoiced', 'Invoiced'),
('paid', 'Reimbursed'),
- ('cancelled', 'Refused')],
+ ('cancelled', 'Refused'),
+ ('invoice_cancelled', 'Invoice Cancelled')],
'State', readonly=True, help='When the expense request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Confirmation\'.\
\nIf the admin accepts it, the state is \'Accepted\'.\n If an invoice is made for the expense request, the state is \'Invoiced\'.\n If the expense is paid to user, the state is \'Reimbursed\'.'),
}
@@ -107,6 +108,12 @@
})
return True
+ def invoice_cancelled(self, cr, uid, ids, *args):
+ self.write(cr, uid, ids, {
+ 'state':'invoice_cancelled',
+ })
+ return True
+
def expense_accept(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {
'state':'accepted',
=== modified file 'hr_expense/hr_expense_workflow.xml'
--- hr_expense/hr_expense_workflow.xml 2011-01-14 00:11:01 +0000
+++ hr_expense/hr_expense_workflow.xml 2011-07-18 11:41:32 +0000
@@ -17,6 +17,13 @@
<field name="kind">function</field>
<field name="action">write({'state': 'draft'})</field>
</record>
+
+ <record id="act_inv_cncl" model="workflow.activity">
+ <field name="wkf_id" ref="wkf_expenses"/>
+ <field name="name">invoice cancelled</field>
+ <field name="kind">function</field>
+ <field name="action">invoice_cancelled()</field>
+ </record>
<record id="act_confirm" model="workflow.activity">
<field name="wkf_id" ref="wkf_expenses"/>
@@ -105,7 +112,7 @@
<record id="t10" model="workflow.transition">
<field name="act_from" ref="act_invoice"/>
- <field name="act_to" ref="act_refused"/>
+ <field name="act_to" ref="act_inv_cncl"/>
<field name="signal">subflow.cancel</field>
<field name="group_id" ref="base.group_hr_user"/>
</record>
@@ -119,3 +126,4 @@
</data>
</openerp>
+
_______________________________________________
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