[FIX] hr : modified the workflow inorder to keep separate functionality between hr_expense and supplier_invoice

bzr revid: bde@tinyerp.com-20111118114453-bd7vc3urjbepo3rt
This commit is contained in:
Bharat (OpenERP) 2011-11-18 17:14:53 +05:30
parent 6864ce3414
commit bd94429713
3 changed files with 2 additions and 33 deletions

View File

@ -82,7 +82,6 @@ class hr_expense_expense(osv.osv):
('accepted', 'Approved'),
('invoiced', 'Invoiced'),
('paid', 'Reimbursed'),
('invoice_except', 'Invoice Exception'),
('cancelled', 'Refused')],
'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\'.'),
@ -138,8 +137,9 @@ class hr_expense_expense(osv.osv):
inv_ids.append(self.browse(cr, uid, id).invoice_id.id)
return {
'name': _('Supplier Invoices'),
'view_type': 'form',
'view_mode': 'form',
'view_id': [res[1] if res else False],
'view_id': [res and res[1] or False],
'res_model': 'account.invoice',
'context': "{'type':'out_invoice', 'journal_type': 'purchase'}",
'type': 'ir.actions.act_window',
@ -223,9 +223,6 @@ class hr_expense_expense(osv.osv):
res = inv_id
return res
def action_invoice_cancel(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state': 'invoice_except'}, context=context)
hr_expense_expense()
class product_product(osv.osv):

View File

@ -106,7 +106,6 @@
<button name="confirm" states="draft" string="Submit to Manager" type="workflow" icon="gtk-apply"/>
<button name="invoice" states="accepted" string="Invoice" type="object" icon="gtk-go-forward" groups="base.group_hr_user"/>
<button name="validate" states="confirm" string="Approve" type="workflow" icon="gtk-go-forward" groups="base.group_hr_user"/>
<button name="invoice_recreate_hr_expense" states="invoice_except" string="Recreate Invoice" icon="gtk-go-forward"/>
</group>
</page>
<page string="Other Info" groups="base.group_extended">

View File

@ -55,13 +55,6 @@
<field name="action">action_invoice_create()</field>
</record>
<record id="act_invoice_except" model="workflow.activity">
<field name="wkf_id" ref="wkf_expenses"/>
<field name="name">invoice_except</field>
<field name="kind">function</field>
<field name="action">action_invoice_cancel()</field>
</record>
<record id="t1" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_confirm"/>
@ -111,31 +104,11 @@
</record>
<record id="t10" model="workflow.transition">
<field name="act_from" ref="act_invoice"/>
<field name="act_to" ref="act_refused"/>
<field name="signal">subflow.cancel</field>
<field name="group_id" ref="base.group_hr_user"/>
</record>
<record id="t11" model="workflow.transition">
<field name="act_from" ref="act_refused"/>
<field name="act_to" ref="act_draft"/>
<field name="signal">draft</field>
<field name="group_id" ref="base.group_hr_user"/>
</record>
<record id="t12" model="workflow.transition">
<field name="act_from" ref="act_invoice"/>
<field name="act_to" ref="act_invoice_except"/>
<field name="signal">subflow.cancel</field>
<field name="group_id" ref="base.group_hr_user"/>
</record>
<record id="t13" model="workflow.transition">
<field name="act_from" ref="act_invoice_except"/>
<field name="act_to" ref="act_invoice"/>
<field name="signal">invoice_recreate_hr_expense</field>
</record>
</data>
</openerp>