[REM]: unuse variable name and method
bzr revid: ksa@tinyerp.com-20110921113631-nmkkhood1ozkq46b
This commit is contained in:
parent
5829a12411
commit
c6cb0c8785
|
@ -69,12 +69,13 @@ class mrp_repair(osv.osv):
|
|||
cur = repair.pricelist_id.currency_id
|
||||
for line in repair.operations:
|
||||
#manage prices with tax included use compute_all instead of compute
|
||||
tax_calculate = tax_obj.compute_all(cr, uid, line.tax_id, line.price_unit, line.product_uom_qty, repair.partner_invoice_id.id, line.product_id, repair.partner_id)
|
||||
if line.to_invoice:
|
||||
tax_calculate = tax_obj.compute_all(cr, uid, line.tax_id, line.price_unit, line.product_uom_qty, repair.partner_invoice_id.id, line.product_id, repair.partner_id)
|
||||
for c in tax_calculate['taxes']:
|
||||
val += c['amount']
|
||||
for line in repair.fees_lines:
|
||||
if line.to_invoice:
|
||||
tax_calculate = tax_obj.compute_all(cr, uid, line.tax_id, line.price_unit, line.product_uom_qty, repair.partner_invoice_id.id, line.product_id, repair.partner_id)
|
||||
for c in tax_calculate['taxes']:
|
||||
val += c['amount']
|
||||
res[repair.id] = cur_obj.round(cr, uid, cur, val)
|
||||
|
@ -480,21 +481,23 @@ class mrp_repair(osv.osv):
|
|||
repair.write({'state': 'under_repair'})
|
||||
return True
|
||||
|
||||
def action_invoice_end(self, cr, uid, ids, context=None):
|
||||
""" Writes repair order state to 'Ready' if invoice method is Before repair.
|
||||
@return: True
|
||||
"""
|
||||
repair_line = self.pool.get('mrp.repair.line')
|
||||
for order in self.browse(cr, uid, ids, context=context):
|
||||
val = {}
|
||||
if (order.invoice_method == 'b4repair'):
|
||||
val['state'] = 'ready'
|
||||
repair_line.write(cr, uid, [l.id for
|
||||
l in order.operations], {'state': 'confirmed'}, context=context)
|
||||
else:
|
||||
pass
|
||||
self.write(cr, uid, [order.id], val, context=context)
|
||||
return True
|
||||
# Remove this method because not use any where
|
||||
|
||||
# def action_invoice_end(self, cr, uid, ids, context=None):
|
||||
# """ Writes repair order state to 'Ready' if invoice method is Before repair.
|
||||
# @return: True
|
||||
# """
|
||||
# repair_line = self.pool.get('mrp.repair.line')
|
||||
# for order in self.browse(cr, uid, ids, context=context):
|
||||
# val = {}
|
||||
# if (order.invoice_method == 'b4repair'):
|
||||
# val['state'] = 'ready'
|
||||
# repair_line.write(cr, uid, [l.id for
|
||||
# l in order.operations], {'state': 'confirmed'}, context=context)
|
||||
# else:
|
||||
# pass
|
||||
# self.write(cr, uid, [order.id], val, context=context)
|
||||
# return True
|
||||
|
||||
def action_repair_end(self, cr, uid, ids, context=None):
|
||||
""" Writes repair order state to 'To be invoiced' if invoice method is
|
||||
|
|
|
@ -121,11 +121,6 @@
|
|||
-
|
||||
!python {model: mrp.repair}: |
|
||||
self.action_invoice_cancel(cr, uid, [ref('mrp_repair_rma0')], context=None)
|
||||
- |
|
||||
Writes repair order state to 'Ready' if invoice method is Before repair.
|
||||
-
|
||||
!python {model: mrp.repair}: |
|
||||
self.action_invoice_end(cr, uid, [ref('mrp_repair_rma0')], context=None)
|
||||
- |
|
||||
Creates stock move and picking for repair order
|
||||
-
|
||||
|
@ -136,28 +131,21 @@
|
|||
-
|
||||
!python {model: mrp.repair}: |
|
||||
repair_id = self.browse(cr, uid, [ref('mrp_repair_rma0')], context=context)[0]
|
||||
prod_id=False
|
||||
move_id=repair_id.move_id
|
||||
self.onchange_move_id(cr, uid, [ref('mrp_repair_rma0')], prod_id, move_id)
|
||||
self.onchange_move_id(cr, uid, [ref('mrp_repair_rma0')], False, repair_id.move_id)
|
||||
- |
|
||||
On change of operation type it sets source location, destination location and to invoice field
|
||||
-
|
||||
!python {model: mrp.repair.line}: |
|
||||
guarantee_limit=False
|
||||
self.onchange_operation_type(cr, uid, [ref('mrp_repair_rma0')], type, guarantee_limit)
|
||||
self.onchange_operation_type(cr, uid, [ref('mrp_repair_rma0')], type, False)
|
||||
- |
|
||||
On change of partner sets the values of partner address, partner invoice address and pricelist.
|
||||
-
|
||||
!python {model: mrp.repair}: |
|
||||
repair_id = self.browse(cr, uid, [ref('mrp_repair_rma0')], context=context)[0]
|
||||
part=False
|
||||
address_id=False
|
||||
self.onchange_partner_id(cr, uid, [ref('mrp_repair_rma0')], part, address_id)
|
||||
self.onchange_partner_id(cr, uid, [ref('mrp_repair_rma0')], False, repair_id.address_id)
|
||||
- |
|
||||
On change of production lot sets the values of source location, destination location, move and guarantee limit
|
||||
-
|
||||
!python {model: mrp.repair}: |
|
||||
repair_id = self.browse(cr, uid, [ref('mrp_repair_rma0')], context=context)[0]
|
||||
lot=False
|
||||
product_id=repair_id.product_id
|
||||
self.onchange_lot_id(cr, uid, [ref('mrp_repair_rma0')], lot, product_id)
|
||||
self.onchange_lot_id(cr, uid, [ref('mrp_repair_rma0')], False, repair_id.product_id)
|
||||
|
|
Loading…
Reference in New Issue