*improvement of mrp_repair module (lots of things)
bzr revid: qdp@tinyerp.com-20081203112925-flb88fatksd18l51
This commit is contained in:
parent
5bd81b51da
commit
b5de92db2c
|
@ -77,6 +77,7 @@ class mrp_repair(osv.osv):
|
||||||
'state': fields.selection([
|
'state': fields.selection([
|
||||||
('draft','Quotation'),
|
('draft','Quotation'),
|
||||||
('confirmed','Confirmed'),
|
('confirmed','Confirmed'),
|
||||||
|
('ready','Ready to Repair'),
|
||||||
('under_repair','Under Repair'),
|
('under_repair','Under Repair'),
|
||||||
('2binvoiced','To be Invoiced'),
|
('2binvoiced','To be Invoiced'),
|
||||||
('invoice_except','Invoice Exception'),
|
('invoice_except','Invoice Exception'),
|
||||||
|
@ -84,7 +85,7 @@ class mrp_repair(osv.osv):
|
||||||
('cancel','Cancel')
|
('cancel','Cancel')
|
||||||
], 'Repair State', readonly=True, help="Gives the state of the Repair Order"),
|
], 'Repair State', readonly=True, help="Gives the state of the Repair Order"),
|
||||||
'location_id': fields.many2one('stock.location', 'Current Location', required=True, select=True, readonly=True, states={'draft':[('readonly',False)]}),
|
'location_id': fields.many2one('stock.location', 'Current Location', required=True, select=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||||
'location_dest_id': fields.many2one('stock.location', 'Delivery Location', required=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)]}),#,('location_dest_id','=',location_id),('prodlot_id','=',prodlot_id)
|
'move_id': fields.many2one('stock.move', 'Move',required=True, domain="[('product_id','=',product_id)]", readonly=True, states={'draft':[('readonly',False)]}),#,('location_dest_id','=',location_id),('prodlot_id','=',prodlot_id)
|
||||||
'guarantee_limit': fields.date('Guarantee limit'),
|
'guarantee_limit': fields.date('Guarantee limit'),
|
||||||
'operations' : fields.one2many('mrp.repair.line', 'repair_id', 'Operation Lines', readonly=True, states={'draft':[('readonly',False)]}),
|
'operations' : fields.one2many('mrp.repair.line', 'repair_id', 'Operation Lines', readonly=True, states={'draft':[('readonly',False)]}),
|
||||||
|
@ -95,12 +96,13 @@ class mrp_repair(osv.osv):
|
||||||
("b4repair","Before Repair"),
|
("b4repair","Before Repair"),
|
||||||
("after_repair","After Repair")
|
("after_repair","After Repair")
|
||||||
], "Invoice Method",
|
], "Invoice Method",
|
||||||
select=True, states={'draft':[('readonly',False)]}, readonly=True),
|
select=True, required=True, states={'draft':[('readonly',False)]}, readonly=True),
|
||||||
'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True),
|
'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True),
|
||||||
'picking_id': fields.many2one('stock.picking', 'Packing',readonly=True),
|
'picking_id': fields.many2one('stock.picking', 'Packing',readonly=True),
|
||||||
'fees_lines' : fields.one2many('mrp.repair.fee', 'repair_id', 'Fees Lines', readonly=True, states={'draft':[('readonly',False)]}),
|
'fees_lines' : fields.one2many('mrp.repair.fee', 'repair_id', 'Fees Lines', readonly=True, states={'draft':[('readonly',False)]}),
|
||||||
'internal_notes' : fields.text('Internal Notes'),
|
'internal_notes' : fields.text('Internal Notes'),
|
||||||
'quotation_notes' : fields.text('Quotation Notes'),
|
'quotation_notes' : fields.text('Quotation Notes'),
|
||||||
|
'deliver_bool': fields.boolean('Deliver'),
|
||||||
'invoiced': fields.boolean('Invoiced', readonly=True),
|
'invoiced': fields.boolean('Invoiced', readonly=True),
|
||||||
'repaired' : fields.boolean('Repaired', readonly=True),
|
'repaired' : fields.boolean('Repaired', readonly=True),
|
||||||
'amount_untaxed': fields.function(_amount_untaxed, method=True, string='Untaxed Amount'),
|
'amount_untaxed': fields.function(_amount_untaxed, method=True, string='Untaxed Amount'),
|
||||||
|
@ -110,6 +112,7 @@ class mrp_repair(osv.osv):
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'state': lambda *a: 'draft',
|
'state': lambda *a: 'draft',
|
||||||
|
'deliver_bool': lambda *a: True,
|
||||||
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'mrp.repair'),
|
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'mrp.repair'),
|
||||||
'invoice_method': lambda *a: 'none',
|
'invoice_method': lambda *a: 'none',
|
||||||
'pricelist_id': lambda self, cr, uid,context : self.pool.get('product.pricelist').search(cr,uid,[('type','=','sale')])[0]
|
'pricelist_id': lambda self, cr, uid,context : self.pool.get('product.pricelist').search(cr,uid,[('type','=','sale')])[0]
|
||||||
|
@ -140,29 +143,28 @@ class mrp_repair(osv.osv):
|
||||||
}
|
}
|
||||||
|
|
||||||
def onchange_move_id(self, cr, uid, ids, prod_id=False, move_id=False):
|
def onchange_move_id(self, cr, uid, ids, prod_id=False, move_id=False):
|
||||||
|
data = {}
|
||||||
|
data['value'] = {}
|
||||||
if not prod_id:
|
if not prod_id:
|
||||||
return {'value': {
|
return data
|
||||||
'prodlot_id': False,
|
|
||||||
'move_id': False,
|
|
||||||
'guarantee_limit' :False,
|
|
||||||
'location_id': False,
|
|
||||||
'location_dest_id': False
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if move_id:
|
if move_id:
|
||||||
move = self.pool.get('stock.move').browse(cr, uid, move_id)
|
move = self.pool.get('stock.move').browse(cr, uid, move_id)
|
||||||
product = self.pool.get('product.product').browse(cr, uid, prod_id)
|
product = self.pool.get('product.product').browse(cr, uid, prod_id)
|
||||||
date = move.date_planned
|
date = move.picking_id.date_done
|
||||||
limit = mx.DateTime.strptime(date, '%Y-%m-%d %H:%M:%S') + RelativeDateTime(months=product.warranty)
|
limit = mx.DateTime.strptime(date, '%Y-%m-%d %H:%M:%S') + RelativeDateTime(months=product.warranty)
|
||||||
return {'value': {
|
data['value']['guarantee_limit'] = limit.strftime('%Y-%m-%d')
|
||||||
'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']['partner_id'] = move.address_id and move.address_id.partner_id and move.address_id.partner_id.id
|
||||||
|
data['value']['address_id'] = move.address_id and move.address_id.id
|
||||||
|
d = self.onchange_partner_id(cr, uid, ids, data['value']['partner_id'], data['value']['address_id'])
|
||||||
|
data['value'].update(d['value'])
|
||||||
|
return data
|
||||||
|
|
||||||
def button_dummy(self, cr, uid, ids, context=None):
|
def button_dummy(self, cr, uid, ids, context=None):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def onchange_partner_id(self, cr, uid, ids, part):
|
def onchange_partner_id(self, cr, uid, ids, part, address_id):
|
||||||
if not part:
|
if not part:
|
||||||
return {'value': {
|
return {'value': {
|
||||||
'address_id': False,
|
'address_id': False,
|
||||||
|
@ -174,33 +176,28 @@ class mrp_repair(osv.osv):
|
||||||
partner = self.pool.get('res.partner').browse(cr, uid, part)
|
partner = self.pool.get('res.partner').browse(cr, uid, part)
|
||||||
pricelist = partner.property_product_pricelist and partner.property_product_pricelist.id or False
|
pricelist = partner.property_product_pricelist and partner.property_product_pricelist.id or False
|
||||||
return {'value': {
|
return {'value': {
|
||||||
'address_id': addr['delivery'],
|
'address_id': address_id or addr['delivery'],
|
||||||
'partner_invoice_id': addr['invoice'],
|
'partner_invoice_id': addr['invoice'],
|
||||||
'pricelist_id': pricelist
|
'pricelist_id': pricelist
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def onchange_lot_id(self, cr, uid, ids, lot, product_id):
|
def onchange_lot_id(self, cr, uid, ids, lot, product_id):
|
||||||
|
data = {}
|
||||||
|
data['value'] = {
|
||||||
|
'location_id': False,
|
||||||
|
'location_dest_id': False,
|
||||||
|
'move_id': False,
|
||||||
|
'guarantee_limit': False
|
||||||
|
}
|
||||||
|
|
||||||
if not lot:
|
if not lot:
|
||||||
return {'value': {
|
return data
|
||||||
'location_id': False,
|
|
||||||
'location_dest_id': False,
|
|
||||||
'move_id': False,
|
|
||||||
'guarantee_limit': False
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lot_info = self.pool.get('stock.production.lot').browse(cr, uid, lot)
|
lot_info = self.pool.get('stock.production.lot').browse(cr, uid, lot)
|
||||||
move_ids = self.pool.get('stock.move').search(cr, uid, [('prodlot_id', '=', lot)])
|
move_ids = self.pool.get('stock.move').search(cr, uid, [('prodlot_id', '=', lot)])
|
||||||
|
|
||||||
if not len(move_ids):
|
if not len(move_ids):
|
||||||
return {'value': {
|
return data
|
||||||
'location_id': False,
|
|
||||||
'location_dest_id': False,
|
|
||||||
'move_id': False,
|
|
||||||
'guarantee_limit':False
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def get_last_move(lst_move):
|
def get_last_move(lst_move):
|
||||||
while lst_move.move_dest_id and lst_move.move_dest_id and lst_move.move_dest_id.picking_id.state == 'done':
|
while lst_move.move_dest_id and lst_move.move_dest_id and lst_move.move_dest_id.picking_id.state == 'done':
|
||||||
|
@ -208,17 +205,11 @@ class mrp_repair(osv.osv):
|
||||||
return lst_move
|
return lst_move
|
||||||
|
|
||||||
move_id = move_ids[0]
|
move_id = move_ids[0]
|
||||||
move = get_last_move(self.pool.get('stock.move').browse(cr, uid, move_id))
|
move = get_last_move(self.pool.get('stock.move').browse(cr, uid, move_id))
|
||||||
product = self.pool.get('product.product').browse(cr, uid, product_id)
|
data['value']['move_id'] = move.id
|
||||||
date = move.picking_id.date_done
|
d = self.onchange_move_id(cr, uid, ids, product_id, move.id)
|
||||||
limit = mx.DateTime.strptime(date, '%Y-%m-%d %H:%M:%S') + RelativeDateTime(months=product.warranty)
|
data['value'].update(d['value'])
|
||||||
return {'value': {
|
return data
|
||||||
'location_id': move.location_dest_id.id,
|
|
||||||
'location_dest_id': move.location_dest_id.id,
|
|
||||||
'move_id': move.id,
|
|
||||||
'guarantee_limit': limit.strftime('%Y-%m-%d')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def action_cancel_draft(self, cr, uid, ids, *args):
|
def action_cancel_draft(self, cr, uid, ids, *args):
|
||||||
if not len(ids):
|
if not len(ids):
|
||||||
|
@ -332,6 +323,10 @@ class mrp_repair(osv.osv):
|
||||||
#self.action_invoice_end(cr, uid, ids)
|
#self.action_invoice_end(cr, uid, ids)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def action_repair_ready(self, cr, uid, ids, context=None):
|
||||||
|
self.write(cr, uid, ids, {'state':'ready'})
|
||||||
|
return True
|
||||||
|
|
||||||
def action_invoice_cancel(self, cr, uid, ids, context=None):
|
def action_invoice_cancel(self, cr, uid, ids, context=None):
|
||||||
self.write(cr, uid, ids, {'state':'invoice_except'})
|
self.write(cr, uid, ids, {'state':'invoice_except'})
|
||||||
return True
|
return True
|
||||||
|
@ -344,7 +339,7 @@ class mrp_repair(osv.osv):
|
||||||
for order in self.browse(cr, uid, ids):
|
for order in self.browse(cr, uid, ids):
|
||||||
val = {}
|
val = {}
|
||||||
if (order.invoice_method=='b4repair'):
|
if (order.invoice_method=='b4repair'):
|
||||||
val['state'] = 'under_repair'
|
val['state'] = 'ready'
|
||||||
else:
|
else:
|
||||||
#val['state'] = 'done'
|
#val['state'] = 'done'
|
||||||
pass
|
pass
|
||||||
|
@ -358,7 +353,7 @@ class mrp_repair(osv.osv):
|
||||||
if (not order.invoiced and order.invoice_method=='after_repair'):
|
if (not order.invoiced and order.invoice_method=='after_repair'):
|
||||||
val['state'] = '2binvoiced'
|
val['state'] = '2binvoiced'
|
||||||
elif (not order.invoiced and order.invoice_method=='b4repair'):
|
elif (not order.invoiced and order.invoice_method=='b4repair'):
|
||||||
val['state'] = 'confirmed'
|
val['state'] = 'ready'
|
||||||
else:
|
else:
|
||||||
#val['state'] = 'done'
|
#val['state'] = 'done'
|
||||||
pass
|
pass
|
||||||
|
@ -373,37 +368,38 @@ class mrp_repair(osv.osv):
|
||||||
res = {}
|
res = {}
|
||||||
company = self.pool.get('res.users').browse(cr, uid, uid).company_id
|
company = self.pool.get('res.users').browse(cr, uid, uid).company_id
|
||||||
for repair in self.browse(cr, uid, ids, context=context):
|
for repair in self.browse(cr, uid, ids, context=context):
|
||||||
|
if repair.deliver_bool:
|
||||||
picking = self.pool.get('stock.picking').create(cr, uid, {
|
picking = self.pool.get('stock.picking').create(cr, uid, {
|
||||||
'origin': repair.name,
|
'origin': repair.name,
|
||||||
'state': 'draft',
|
'state': 'draft',
|
||||||
'move_type': 'one',
|
'move_type': 'one',
|
||||||
'address_id': repair.address_id and repair.address_id.id or False,
|
'address_id': repair.address_id and repair.address_id.id or False,
|
||||||
'note': repair.internal_notes,
|
'note': repair.internal_notes,
|
||||||
'invoice_state': 'none',
|
'invoice_state': 'none',
|
||||||
'type': 'out', # FIXME delivery ?
|
'type': 'out', # FIXME delivery ?
|
||||||
})
|
})
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
wf_service.trg_validate(uid, 'stock.picking', picking, 'button_confirm', cr)
|
wf_service.trg_validate(uid, 'stock.picking', picking, 'button_confirm', cr)
|
||||||
|
|
||||||
move_id = self.pool.get('stock.move').create(cr, uid, {
|
move_id = self.pool.get('stock.move').create(cr, uid, {
|
||||||
'name': repair.name,
|
'name': repair.name,
|
||||||
'picking_id': picking,
|
'picking_id': picking,
|
||||||
'product_id': repair.product_id.id,
|
'product_id': repair.product_id.id,
|
||||||
'product_qty': 1.0,
|
'product_qty': 1.0,
|
||||||
'product_uom': repair.product_id.uom_id.id,
|
'product_uom': repair.product_id.uom_id.id,
|
||||||
#'product_uos_qty': line.product_uom_qty,
|
#'product_uos_qty': line.product_uom_qty,
|
||||||
#'product_uos': line.product_uom.id,
|
#'product_uos': line.product_uom.id,
|
||||||
'prodlot_id': repair.prodlot_id and repair.prodlot_id.id or False,
|
'prodlot_id': repair.prodlot_id and repair.prodlot_id.id or False,
|
||||||
'address_id': repair.address_id and repair.address_id.id or False,
|
'address_id': repair.address_id and repair.address_id.id or False,
|
||||||
'location_id': repair.location_id.id,
|
'location_id': repair.location_id.id,
|
||||||
'location_dest_id': repair.location_dest_id.id,
|
'location_dest_id': repair.location_dest_id.id,
|
||||||
'tracking_id': False,
|
'tracking_id': False,
|
||||||
'state': 'assigned', # FIXME done ?
|
'state': 'assigned', # FIXME done ?
|
||||||
})
|
})
|
||||||
|
self.write(cr, uid, [repair.id], {'state':'done', 'picking_id':picking})
|
||||||
self.write(cr, uid, [repair.id], {'state':'done', 'picking_id':picking})
|
res[repair.id] = picking
|
||||||
res[repair.id] = picking
|
else:
|
||||||
|
self.write(cr, uid, [repair.id], {'state':'done'})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
@ -449,7 +445,7 @@ class ProductChangeMixin(object):
|
||||||
|
|
||||||
class mrp_repair_line(osv.osv, ProductChangeMixin):
|
class mrp_repair_line(osv.osv, ProductChangeMixin):
|
||||||
_name = 'mrp.repair.line'
|
_name = 'mrp.repair.line'
|
||||||
_description = 'Repair Operations Lines'
|
_description = 'Repair Operations Lines'
|
||||||
|
|
||||||
def copy(self, cr, uid, id, default=None, context=None):
|
def copy(self, cr, uid, id, default=None, context=None):
|
||||||
if not default: default = {}
|
if not default: default = {}
|
||||||
|
@ -466,7 +462,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name' : fields.char('Name',size=64,required=True),
|
'name' : fields.char('Description',size=64,required=True),
|
||||||
'repair_id': fields.many2one('mrp.repair', 'Repair Order Ref',ondelete='cascade', select=True),
|
'repair_id': fields.many2one('mrp.repair', 'Repair Order Ref',ondelete='cascade', select=True),
|
||||||
'type': fields.selection([('add','Add'),('remove','Remove')],'Type'),
|
'type': fields.selection([('add','Add'),('remove','Remove')],'Type'),
|
||||||
'to_invoice': fields.boolean('To Invoice'),
|
'to_invoice': fields.boolean('To Invoice'),
|
||||||
|
@ -509,7 +505,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
|
||||||
}
|
}
|
||||||
if type == 'remove':
|
if type == 'remove':
|
||||||
return {'value': {
|
return {'value': {
|
||||||
'to_invoice': to_invoice,
|
'to_invoice': False,
|
||||||
'location_id': produc_id,
|
'location_id': produc_id,
|
||||||
'location_dest_id':False
|
'location_dest_id':False
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,22 +10,23 @@
|
||||||
<form string="Repairs order">
|
<form string="Repairs order">
|
||||||
<group col="6" colspan="4">
|
<group col="6" colspan="4">
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<newline/>
|
|
||||||
<field name="product_id" select="1" on_change="onchange_product_id(product_id)"/>
|
<field name="product_id" select="1" on_change="onchange_product_id(product_id)"/>
|
||||||
|
<field name="deliver_bool"/>
|
||||||
|
<newline/>
|
||||||
<field name="prodlot_id" select="2" on_change="onchange_lot_id(prodlot_id,product_id)"/>
|
<field name="prodlot_id" select="2" on_change="onchange_lot_id(prodlot_id,product_id)"/>
|
||||||
|
<field name="move_id" on_change="onchange_move_id(product_id, move_id)"/>
|
||||||
<field name="repaired"/>
|
<field name="repaired"/>
|
||||||
<field name="partner_id" select="2" on_change="onchange_partner_id(partner_id)" />
|
<newline/>
|
||||||
<field name="address_id"/>
|
<field name="partner_id" select="2" on_change="onchange_partner_id(partner_id,address_id)" attrs="{'readonly':[('deliver_bool','=', False)]}"/>
|
||||||
|
<field name="address_id" attrs="{'readonly':[('deliver_bool','=', False)]}"/>
|
||||||
<field name="invoiced"/>
|
<field name="invoiced"/>
|
||||||
</group>
|
</group>
|
||||||
<notebook colspan="4">
|
<notebook colspan="4">
|
||||||
<page string="Products">
|
<page string="Products">
|
||||||
<field name="location_id"/>
|
<field name="location_id"/>
|
||||||
<field name="move_id" on_change="onchange_move_id(product_id, move_id)"/>
|
<field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}"/>
|
||||||
<field name="location_dest_id"/>
|
|
||||||
<field name="guarantee_limit" />
|
<field name="guarantee_limit" />
|
||||||
<newline/>
|
<newline/>
|
||||||
<separator colspan="4" string="Operations"/>
|
|
||||||
<field colspan="4" mode="tree,form" name="operations" nolabel="1" widget="one2many_list">
|
<field colspan="4" mode="tree,form" name="operations" nolabel="1" widget="one2many_list">
|
||||||
<form string="Operations">
|
<form string="Operations">
|
||||||
<notebook>
|
<notebook>
|
||||||
|
@ -59,17 +60,17 @@
|
||||||
|
|
||||||
</notebook>
|
</notebook>
|
||||||
</form>
|
</form>
|
||||||
<tree string="Operations lines" editable="bottom">
|
<tree string="Operations" editable="bottom">
|
||||||
<field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit)"/>
|
<field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit)"/>
|
||||||
<field name='name'/>
|
<field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
|
||||||
<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="location_id"/>
|
<field name="location_id"/>
|
||||||
<field name="location_dest_id"/>
|
<field name="location_dest_id"/>
|
||||||
<field name="product_uom_qty" string="Qty" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
|
<field name="product_uom_qty" string="Qty" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
|
||||||
<field name="product_uom" string="UoM"/>
|
<field name="product_uom" string="UoM"/>
|
||||||
<field name="price_unit"/>
|
<field name="price_unit"/>
|
||||||
<field name="price_subtotal"/>
|
|
||||||
<field name="to_invoice"/>
|
<field name="to_invoice"/>
|
||||||
|
<field name="price_subtotal"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
<newline/>
|
<newline/>
|
||||||
|
@ -82,26 +83,26 @@
|
||||||
<newline/>
|
<newline/>
|
||||||
<group col="13" colspan="4">
|
<group col="13" colspan="4">
|
||||||
<field name="state" select="2"/>
|
<field name="state" select="2"/>
|
||||||
<button name="repair_confirm" states="draft" string="Confirm Repair"/>
|
<button name="repair_confirm" states="draft" string="Confirm Repair"/>
|
||||||
<button name="action_repair_start" states="confirmed" string="Start Repair"/>
|
<button name="repair_ready" states="confirmed" string="Start Repair"/>
|
||||||
<button name="action_repair_end" states="under_repair" string="End Repair"/>
|
<button name="action_repair_start" states="ready" string="Start Repair"/>
|
||||||
|
<button name="action_repair_end" states="under_repair" string="End Repair"/>
|
||||||
<button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
|
<button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
|
||||||
<button name="invoice_corrected" states="invoice_except" string="Invoice Corrected"/>
|
<button name="invoice_corrected" states="invoice_except" string="Invoice Corrected"/>
|
||||||
<button name="action_invoice_create" states="2binvoiced" string="Make Invoice"/>
|
<button name="action_invoice_create" states="2binvoiced" string="Make Invoice"/>
|
||||||
<button name="%(action_cancel_repair)d" states="invoice_except" string="Cancel Repair" type="action"/>
|
<button name="%(action_cancel_repair)d" states="invoice_except" string="Cancel Repair" type="action"/>
|
||||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
|
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
|
||||||
<button name="cancel" states="draft" string="Cancel Repair"/>
|
<button name="cancel" states="draft" string="Cancel Repair"/>
|
||||||
<button name="%(action_cancel_repair)d" states="confirmed,2binvoiced,under_repair" string="Cancel Repair" type="action"/>
|
<button name="%(action_cancel_repair)d" states="confirmed,2binvoiced,ready,under_repair" string="Cancel Repair" type="action"/>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
<page string="Invoicing">
|
<page string="Invoicing">
|
||||||
<field name="pricelist_id" context="product_id=product_id"/>
|
<field name="pricelist_id" context="product_id=product_id"/>
|
||||||
<field name="partner_invoice_id"/>
|
<field name="partner_invoice_id"/>
|
||||||
<field name="invoice_method"/>
|
<field name="invoice_method" attrs="{'readonly':[('deliver_bool','=', False)]}"/>
|
||||||
<field name="invoice_id"/>
|
<field name="invoice_id"/>
|
||||||
<separator colspan="4" string="Fees"/>
|
|
||||||
<field colspan="4" mode="tree,form" name="fees_lines" nolabel="1" widget="one2many_list">
|
<field colspan="4" mode="tree,form" name="fees_lines" nolabel="1" widget="one2many_list">
|
||||||
<form string="Fees Line">
|
<form string="Fees">
|
||||||
<notebook>
|
<notebook>
|
||||||
<page string="Fees Line">
|
<page string="Fees Line">
|
||||||
<field name='name'/>
|
<field name='name'/>
|
||||||
|
@ -123,16 +124,16 @@
|
||||||
</page>
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
</form>
|
</form>
|
||||||
<tree string="Fees lines" editable="bottom">
|
<tree string="Fees" editable="bottom">
|
||||||
<field name='name'/>
|
|
||||||
<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="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="Qty" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)"/>
|
<field name="product_uom_qty" string="Qty" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)"/>
|
||||||
<field name="product_uom" string="UoM"/>
|
<field name="product_uom" string="UoM"/>
|
||||||
<field name="price_unit"/>
|
<field name="price_unit"/>
|
||||||
<field name="price_subtotal"/>
|
<field name="to_invoice"/>
|
||||||
<field name="to_invoice"/>
|
<field name="price_subtotal"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
<page string="Quality">
|
<page string="Quality">
|
||||||
<separator colspan="4" string="Internal Notes"/>
|
<separator colspan="4" string="Internal Notes"/>
|
||||||
|
|
|
@ -29,7 +29,19 @@
|
||||||
<field name="wkf_id" ref="wkf_repair"/>
|
<field name="wkf_id" ref="wkf_repair"/>
|
||||||
<field name="name">wait_repair</field>
|
<field name="name">wait_repair</field>
|
||||||
</record>
|
</record>
|
||||||
|
<record id="act_repair_ready" model="workflow.activity">
|
||||||
|
<field name="wkf_id" ref="wkf_repair"/>
|
||||||
|
<field name="name">Ready Repair</field>
|
||||||
|
<field name="kind">function</field>
|
||||||
|
<field name="action">action_repair_ready()</field>
|
||||||
|
</record>
|
||||||
|
<record id="act_cancel3" model="workflow.activity">
|
||||||
|
<field name="wkf_id" ref="wkf_repair"/>
|
||||||
|
<field name="name">cancel3</field>
|
||||||
|
<field name="flow_stop">True</field>
|
||||||
|
<field name="kind">stopall</field>
|
||||||
|
<field name="action">action_cancel()</field>
|
||||||
|
</record>
|
||||||
<record id="act_done" model="workflow.activity">
|
<record id="act_done" model="workflow.activity">
|
||||||
<field name="wkf_id" ref="wkf_repair"/>
|
<field name="wkf_id" ref="wkf_repair"/>
|
||||||
<field name="name">done</field>
|
<field name="name">done</field>
|
||||||
|
@ -135,8 +147,8 @@
|
||||||
|
|
||||||
<record id="trans_invoice_start_repair" model="workflow.transition">
|
<record id="trans_invoice_start_repair" model="workflow.transition">
|
||||||
<field name="act_from" ref="act_invoice_end"/>
|
<field name="act_from" ref="act_invoice_end"/>
|
||||||
<field name="act_to" ref="act_repair_start"/>
|
<field name="act_to" ref="act_repair_ready"/>
|
||||||
<field name="condition">invoice_method=='b4repair'</field>
|
<field name="condition">invoice_method=='b4repair'</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="trans_wait_invoice_cancel2" model="workflow.transition">
|
<record id="trans_wait_invoice_cancel2" model="workflow.transition">
|
||||||
|
@ -151,10 +163,16 @@
|
||||||
<field name="condition">invoice_method=='after_repair'</field>
|
<field name="condition">invoice_method=='after_repair'</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="trans_wait_repair_ready" model="workflow.transition">
|
<record id="trans_wait_repair_start" model="workflow.transition">
|
||||||
<field name="act_from" ref="act_wait_repair"/>
|
<field name="act_from" ref="act_wait_repair"/>
|
||||||
<field name="act_to" ref="act_repair_start"/>
|
<field name="act_to" ref="act_repair_start"/>
|
||||||
<field name="signal">repair_ready</field>
|
<field name="signal">repair_ready</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="trans_ready_repair_start" model="workflow.transition">
|
||||||
|
<field name="act_from" ref="act_repair_ready"/>
|
||||||
|
<field name="act_to" ref="act_repair_start"/>
|
||||||
|
<field name="signal">action_repair_start</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="trans_repair_repair_end" model="workflow.transition">
|
<record id="trans_repair_repair_end" model="workflow.transition">
|
||||||
|
@ -171,10 +189,14 @@
|
||||||
|
|
||||||
<record id="trans_reapir_end_invoice" model="workflow.transition">
|
<record id="trans_reapir_end_invoice" model="workflow.transition">
|
||||||
<field name="act_from" ref="act_repair_end"/>
|
<field name="act_from" ref="act_repair_end"/>
|
||||||
<field name="act_to" ref="act_wait_invoice"/>
|
<field name="act_to" ref="act_wait_invoice"/>
|
||||||
<field name="condition">invoice_method=='after_repair'</field>
|
<field name="condition">invoice_method=='after_repair'</field>
|
||||||
</record>
|
</record>
|
||||||
|
<record id="trans_wait_repair_cancel3" model="workflow.transition">
|
||||||
|
<field name="act_from" ref="act_wait_repair"/>
|
||||||
|
<field name="act_to" ref="act_cancel3"/>
|
||||||
|
<field name="signal">cancel</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
Loading…
Reference in New Issue