[IMP]:review improvement done which are mention in pad

bzr revid: apa@tinyerp.com-20120626131827-hhqjo28jy6wfq6gg
This commit is contained in:
Amit Patel (OpenERP) 2012-06-26 18:48:27 +05:30
parent f90ed319b2
commit d3aa98284c
2 changed files with 7 additions and 4 deletions

View File

@ -346,7 +346,10 @@ class mrp_repair(osv.osv):
"""
mrp_line_obj = self.pool.get('mrp.repair.line')
for repair in self.browse(cr, uid, ids, context=context):
mrp_line_obj.write(cr, uid, [l.id for l in repair.operations], {'state': 'cancel'}, context=context)
if repair.invoiced or repair.invoice_method == 'none':
mrp_line_obj.write(cr, uid, [l.id for l in repair.operations], {'state': 'cancel'}, context=context)
else:
raise osv.except_osv(_('Warning!'),_('Repair order is not invoiced.'))
self.write(cr,uid,ids,{'state':'cancel'})
self.set_cancel_send_note(cr, uid, ids, context)
return True

View File

@ -37,10 +37,10 @@
<button name="action_invoice_create" states="2binvoiced" string="Make Invoice"/>
<button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
<button name="invoice_corrected" states="invoice_except" string="Invoice Corrected"/>
<button name="%(action_cancel_repair)d" states="confirmed,2binvoiced,ready,under_repair" string="Cancel Repair" type="action" attrs="{'invisible':['|',('invoice_method','!=','none')]}"/>
<button name="%(action_cancel_repair)d" states="invoice_except" string="Cancel Repair" type="action" attrs="{'invisible':['|',('invoice_method','!=','none')]}"/>
<button name="action_cancel" states="confirmed,2binvoiced,ready,under_repair" string="Cancel Repair" type="object" attrs="{'invisible':['|',('invoice_method','!=','none')]}"/>
<button name="action_cancel" states="invoice_except" string="Cancel Repair" type="object" attrs="{'invisible':['|',('invoice_method','!=','none')]}"/>
<button name="cancel" states="draft" string="Cancel Repair"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" />
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done"/>
</header>
<sheet string="Repairs order">
<label for="product_id" class="oe_edit_only"/>