[IMP]:review improvement done which are mention in pad
bzr revid: apa@tinyerp.com-20120626124236-ydfjxg2c4xgps1se
This commit is contained in:
@@ -120,7 +120,7 @@ class mrp_repair(osv.osv):
|
||||
'partner_id' : fields.many2one('res.partner', 'Partner', select=True, help='This field allow you to choose the parner that will be invoiced and delivered'),
|
||||
'address_id': fields.many2one('res.partner', 'Delivery Address', domain="[('parent_id','=',partner_id)]"),
|
||||
'default_address_id': fields.function(_get_default_address, type="many2one", relation="res.partner"),
|
||||
'prodlot_id': fields.many2one('stock.production.lot', 'Lot Number', select=True, domain="[('product_id','=',product_id)]"),
|
||||
'prodlot_id': fields.many2one('stock.production.lot', 'Lot Number', select=True, states={'draft':[('readonly',False)]},domain="[('product_id','=',product_id)]"),
|
||||
'state': fields.selection([
|
||||
('draft','Quotation'),
|
||||
('cancel','Cancelled'),
|
||||
@@ -140,7 +140,7 @@ class mrp_repair(osv.osv):
|
||||
'location_id': fields.many2one('stock.location', 'Current Location', select=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'location_dest_id': fields.many2one('stock.location', 'Delivery Location', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'move_id': fields.many2one('stock.move', 'Move',required=True, domain="[('product_id','=',product_id)]", readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'guarantee_limit': fields.date('Guarantee limit', help="The guarantee limit is computed as: last move date + warranty defined on selected product. If the current date is below the guarantee limit, each operation and fee you will add will be set as 'not to invoiced' by default. Note that you can change manually afterwards."),
|
||||
'guarantee_limit': fields.date('Guarantee limit', states={'draft':[('readonly',False)]},help="The guarantee limit is computed as: last move date + warranty defined on selected product. If the current date is below the guarantee limit, each operation and fee you will add will be set as 'not to invoiced' by default. Note that you can change manually afterwards."),
|
||||
'operations' : fields.one2many('mrp.repair.line', 'repair_id', 'Operation Lines', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', help='The pricelist comes from the selected partner, by default.'),
|
||||
'partner_invoice_id':fields.many2one('res.partner', 'Invoicing Address'),
|
||||
@@ -156,7 +156,7 @@ class mrp_repair(osv.osv):
|
||||
'internal_notes': fields.text('Internal Notes'),
|
||||
'quotation_notes': fields.text('Quotation Notes'),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
'deliver_bool': fields.boolean('Deliver', help="Check this box if you want to manage the delivery once the product is repaired. If cheked, it will create a picking with selected product. Note that you can select the locations in the Info tab, if you have the extended view."),
|
||||
'deliver_bool': fields.boolean('Deliver', states={'draft':[('readonly',False)]},help="Check this box if you want to manage the delivery once the product is repaired. If cheked, it will create a picking with selected product. Note that you can select the locations in the Info tab, if you have the extended view."),
|
||||
'invoiced': fields.boolean('Invoiced', readonly=True),
|
||||
'repaired': fields.boolean('Repaired', readonly=True),
|
||||
'amount_untaxed': fields.function(_amount_untaxed, string='Untaxed Amount',
|
||||
@@ -220,7 +220,7 @@ class mrp_repair(osv.osv):
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
data = {}
|
||||
data['value'] = {}
|
||||
data['value'] = {'guarantee_limit':False}
|
||||
if not prod_id:
|
||||
return data
|
||||
if move_id:
|
||||
@@ -230,6 +230,7 @@ class mrp_repair(osv.osv):
|
||||
data['value']['guarantee_limit'] = limit.strftime('%Y-%m-%d')
|
||||
data['value']['location_id'] = move.location_dest_id.id
|
||||
data['value']['location_dest_id'] = move.location_dest_id.id
|
||||
data['value']['prodlot_id'] = move.prodlot_id.id
|
||||
if move.partner_id:
|
||||
data['value']['partner_id'] = move.partner_id.id
|
||||
else:
|
||||
@@ -498,6 +499,7 @@ class mrp_repair(osv.osv):
|
||||
else:
|
||||
pass
|
||||
self.write(cr, uid, [order.id], val)
|
||||
self.set_end_repair_send_note(cr, uid, [order.id], context)
|
||||
return True
|
||||
|
||||
def wkf_repair_done(self, cr, uid, ids, *args):
|
||||
@@ -559,7 +561,7 @@ class mrp_repair(osv.osv):
|
||||
res[repair.id] = picking
|
||||
else:
|
||||
self.write(cr, uid, [repair.id], {'state': 'done'})
|
||||
self.set_done_send_note(cr, uid, ids, context)
|
||||
self.set_done_send_note(cr, uid, [repair.id], context)
|
||||
return res
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
@@ -568,10 +570,10 @@ 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 order has been <b>created</b>."), context=context)
|
||||
return self.message_append_note(cr, uid, ids, body=_("Repair has been <b>created</b>."), context=context)
|
||||
|
||||
def set_start_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Repair order has been <b>Started</b>.")
|
||||
message = _("Repair has been <b>Started</b>.")
|
||||
return self.message_append_note(cr, uid, ids, body=message, context=context)
|
||||
|
||||
def set_toinvoiced_send_note(self, cr, uid, ids, context=None):
|
||||
@@ -584,19 +586,19 @@ class mrp_repair(osv.osv):
|
||||
return self.message_append_note(cr, uid, ids, body=message, context=context)
|
||||
|
||||
def set_end_repair_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Repair order is now <b>Ended</b>.")
|
||||
message = _("Repair is now <b>Ended</b>.")
|
||||
return self.message_append_note(cr, uid, ids, body=message, context=context)
|
||||
|
||||
def set_cancel_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Repair order has been <b>cancelled</b>.")
|
||||
message = _("Repair has been <b>cancelled</b>.")
|
||||
return self.message_append_note(cr, uid, ids, body=message, context=context)
|
||||
|
||||
def set_ready_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Repair order is now <b>Ready</b>.")
|
||||
message = _("Repair is now <b>Ready</b>.")
|
||||
return self.message_append_note(cr, uid, ids, body=message, context=context)
|
||||
|
||||
def set_done_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Repair order is now <b>Done</b>.")
|
||||
message = _("Repair is now <b>Done</b>.")
|
||||
return self.message_append_note(cr, uid, ids, body=message, context=context)
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<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="cancel" states="draft" string="Cancel Repair"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,ready" />
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" />
|
||||
</header>
|
||||
<sheet string="Repairs order">
|
||||
<label for="product_id" class="oe_edit_only"/>
|
||||
@@ -68,11 +68,6 @@
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Operations">
|
||||
<group col="4">
|
||||
<field
|
||||
name="pricelist_id" groups="product.group_sale_pricelist" context="{'product_id':product_id}"
|
||||
attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
|
||||
</group>
|
||||
<field name="operations">
|
||||
<form string="Operations" version="7.0">
|
||||
<notebook>
|
||||
@@ -91,9 +86,9 @@
|
||||
<field name="to_invoice"/>
|
||||
<field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','<>','purchase')]"/>
|
||||
<field name="invoiced"/>
|
||||
<field name='prodlot_id'/>
|
||||
<field name="location_id"/>
|
||||
<field name="location_dest_id"/>
|
||||
<field name='prodlot_id' groups="stock.group_production_lot" string="Serial Number"/>
|
||||
<field name="location_id" groups="stock.group_locations"/>
|
||||
<field name="location_dest_id" groups="stock.group_locations"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="History">
|
||||
@@ -108,29 +103,32 @@
|
||||
<field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit,parent.company_id,context)"/>
|
||||
<field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
|
||||
<field name='name'/>
|
||||
<field name="prodlot_id" />
|
||||
<field name="location_id"/>
|
||||
<field name="location_dest_id"/>
|
||||
<field name="prodlot_id" groups="stock.group_production_lot" string="Serial Number"/>
|
||||
<field name="location_id" groups="stock.group_locations"/>
|
||||
<field name="location_dest_id" groups="stock.group_locations"/>
|
||||
<field name="product_uom_qty" string="Quantity"/>
|
||||
<field name="product_uom" string="Unit of Measure"/>
|
||||
<field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="tax_id" widget="many2many_tags"/>
|
||||
<field name="to_invoice"/>
|
||||
<field name="price_subtotal"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group class="oe_subtotal_footer">
|
||||
<group class="oe_subtotal_footer oe_right">
|
||||
<field name="amount_untaxed" sum="Untaxed amount"/>
|
||||
<field name="amount_tax"/>
|
||||
<field name="amount_total" sum="Total amount" class="oe_subtotal_footer_separator"/>
|
||||
<button name="button_dummy" states="draft" string="Compute" type="object" icon="terp-stock_format-scientific"/>
|
||||
</group>
|
||||
<button name="button_dummy" states="draft" string="Compute" type="object" icon="terp-stock_format-scientific"/>
|
||||
<div class="oe_clear"/>
|
||||
</page>
|
||||
<page string="Invoicing">
|
||||
<group col="4">
|
||||
<field name="invoice_method"/>
|
||||
<field name="partner_invoice_id" attrs="{'readonly':[('invoice_method','=', 'none')],'required':[('invoice_method','!=','none')]}" groups="sale.group_delivery_invoice_address"/>
|
||||
<field
|
||||
name="pricelist_id" groups="product.group_sale_pricelist" context="{'product_id':product_id}"
|
||||
attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
|
||||
</group>
|
||||
<!-- <field name="invoice_id"/> -->
|
||||
<field name="fees_lines">
|
||||
@@ -161,7 +159,7 @@
|
||||
<field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)"/>
|
||||
<field name='name'/>
|
||||
<field name="product_uom_qty" string="Quantity"/>
|
||||
<field name="product_uom" string="Unit of Measure"/>
|
||||
<field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="to_invoice"/>
|
||||
<field name="price_subtotal"/>
|
||||
@@ -176,15 +174,13 @@
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<group col="2">
|
||||
<field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}"/>
|
||||
<field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}" groups="stock.group_locations"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Notes">
|
||||
<separator string="Internal Notes"/>
|
||||
<field name="internal_notes"/>
|
||||
<separator string="Quotation Notes"/>
|
||||
<field name="quotation_notes"/>
|
||||
<field name="internal_notes" placeholder="Add internal notes..."/>
|
||||
<field name="quotation_notes" placeholder="Add quotation notes..."/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
|
||||
Reference in New Issue
Block a user