[IMP]purchase:Added a Print Button in New state
bzr revid: mma@tinyerp.com-20120229061332-gagzxe9tf5pywhju
This commit is contained in:
@@ -322,6 +322,24 @@ class purchase_order(osv.osv):
|
||||
'res_id': pick_ids and pick_ids[0] or False,
|
||||
}
|
||||
|
||||
def view_report(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
self.write(cr, uid, ids, {'state' : 'send'})
|
||||
|
||||
data = self.read(cr, uid, ids, [], context=context)[0]
|
||||
datas = {
|
||||
'ids': [],
|
||||
'model': 'purchase.order',
|
||||
'form': data
|
||||
}
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'purchase.quotation',
|
||||
'nodestroy': True,
|
||||
'datas': datas,
|
||||
}
|
||||
|
||||
def wkf_approve_order(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state': 'approved', 'date_approve': fields.date.context_today(self,cr,uid,context=context)})
|
||||
return True
|
||||
|
||||
@@ -197,6 +197,7 @@
|
||||
<group col="16" colspan="4">
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,approved,done" statusbar_colors='{"except_picking":"red","except_invoice":"red","confirmed":"blue","wait":"blue"}' readonly="1"/>
|
||||
<button name="send_rfq" states="draft" string="Send" icon="terp-mail-message-new"/>
|
||||
<button name="view_report" string="Print" states="draft" type="object" icon="gtk-print"/>
|
||||
<button name="action_cancel" states="except_picking,except_invoice,wait" string="Cancel" type="object" icon="gtk-cancel"/>
|
||||
<button name="picking_ok" states="except_picking" string="Manually Corrected" icon="gtk-convert"/>
|
||||
<button name="invoice_ok" states="except_invoice" string="Manually Corrected" icon="gtk-convert"/>
|
||||
|
||||
Reference in New Issue
Block a user