From 9074c429ec083016f01ea307413f2c3ab1a4f872 Mon Sep 17 00:00:00 2001 From: "Amit Patel (OpenERP)" Date: Mon, 16 Jul 2012 17:00:30 +0530 Subject: [PATCH] [FIX]:mrp_repair:fixed need fixing bzr revid: apa@tinyerp.com-20120716113030-quymmj96dyrmd64j --- addons/mrp_repair/mrp_repair.py | 41 ++++++++++++++++----------- addons/mrp_repair/mrp_repair_view.xml | 6 ++-- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 2992c1d4e7f..71ceb9e7a9d 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -569,34 +569,43 @@ class mrp_repair(osv.osv): return repair_id def create_send_note(self, cr, uid, ids, context=None): - return self.message_append_note(cr, uid, ids, body=_("Repair has been created."), context=context) + for repair in self.browse(cr, uid, ids, context): + message = _("Repair Order for %s has been created." % (repair.product_id.name)) + self.message_append_note(cr, uid, ids, body=message, context=context) + return True def set_start_send_note(self, cr, uid, ids, context=None): - message = _("Repair has been Started.") - return self.message_append_note(cr, uid, ids, body=message, context=context) + for repair in self.browse(cr, uid, ids, context): + message = _("Repair Order for %s has been started." % (repair.product_id.name)) + self.message_append_note(cr, uid, ids, body=message, context=context) + return True def set_toinvoiced_send_note(self, cr, uid, ids, context=None): - for repair in self.browse(cr,uid,ids,context): - message = _("Invoice is created with %s reference.") % (repair.invoice_id.origin) - return self.message_append_note(cr, uid, ids, body=message, context=context) + for repair in self.browse(cr, uid, ids, context): + message = _("Draft Invoice of %s %s waiting for validation.") % (repair.invoice_id.amount_total, repair.invoice_id.currency_id.symbol) + self.message_append_note(cr, uid, ids, body=message, context=context) + return True def set_confirm_send_note(self, cr, uid, ids, context=None): - message = _("Repair order has been Confirmed.") - return self.message_append_note(cr, uid, ids, body=message, context=context) + for repair in self.browse(cr, uid, ids, context): + message = _( "Repair Order for %s has been accepted." % (repair.product_id.name)) + self.message_append_note(cr, uid, ids, body=message, context=context) + return True def set_cancel_send_note(self, cr, uid, ids, context=None): message = _("Repair has been cancelled.") - return self.message_append_note(cr, uid, ids, body=message, context=context) + self.message_append_note(cr, uid, ids, body=message, context=context) + return True def set_ready_send_note(self, cr, uid, ids, context=None): - message = _("Repair is now Ready.") - return self.message_append_note(cr, uid, ids, body=message, context=context) + message = _("Repair Order is now ready to repair.") + self.message_append_note(cr, uid, ids, body=message, context=context) + return True def set_done_send_note(self, cr, uid, ids, context=None): - message = _("Repair is now Done.") - return self.message_append_note(cr, uid, ids, body=message, context=context) - - + message = _("Repair Order is closed.") + self.message_append_note(cr, uid, ids, body=message, context=context) + return True mrp_repair() @@ -686,7 +695,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price')), 'price_subtotal': fields.function(_amount_line, string='Subtotal',digits_compute= dp.get_precision('Sale Price')), 'tax_id': fields.many2many('account.tax', 'repair_operation_line_tax', 'repair_operation_line_id', 'tax_id', 'Taxes'), - 'product_uom_qty': fields.float('Quantity', digits=(16,2), required=True), + 'product_uom_qty': fields.float('Quantity', digits_compute= dp.get_precision('Product UoS'), required=True), 'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True), 'prodlot_id': fields.many2one('stock.production.lot', 'Lot Number',domain="[('product_id','=',product_id)]"), 'invoice_line_id': fields.many2one('account.invoice.line', 'Invoice Line', readonly=True), diff --git a/addons/mrp_repair/mrp_repair_view.xml b/addons/mrp_repair/mrp_repair_view.xml index 14f23a09d5f..f9d4bd5fb13 100644 --- a/addons/mrp_repair/mrp_repair_view.xml +++ b/addons/mrp_repair/mrp_repair_view.xml @@ -190,9 +190,9 @@ -
- -
+
+ +