[FIX] sale_stock
bzr revid: fp@openerp.com-20130804141750-vr17iy49764ga2m0
This commit is contained in:
parent
22e60e3dda
commit
c19419b6b6
|
@ -30,13 +30,13 @@
|
|||
<button name="run" states="confirmed,exception" string="Run Procurement" class="oe_highlight" type="object"/>
|
||||
<button name="check" states="running" string="Check Procurement" class="oe_highlight" type="object"/>
|
||||
<button name="cancel" states="exception,confirmed,running" string="Cancel Procurement" type="object"/>
|
||||
<field name="state" readonly="1" widget="statusbar" statusbar_visible="draft,confirmed" />
|
||||
<field name="state" readonly="1" widget="statusbar" statusbar_visible="draft,confirmed,running,done" />
|
||||
</header>
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="product_id" on_change="onchange_product_id(product_id)"/>
|
||||
<label for="product_qty" class="oe_edit_only"/>
|
||||
<label for="product_qty"/>
|
||||
<div>
|
||||
<div>
|
||||
<field name="product_qty" class="oe_inline"/>
|
||||
|
@ -49,6 +49,7 @@
|
|||
<field name="product_uos" class="oe_inline"/>
|
||||
</div>
|
||||
</group>
|
||||
<newline/>
|
||||
<group>
|
||||
<field name="rule_id"/>
|
||||
<field name="date_planned"/>
|
||||
|
|
|
@ -658,7 +658,9 @@ class sale_order(osv.osv):
|
|||
procurement_obj = self.pool.get('procurement.order')
|
||||
for order in self.browse(cr, uid, ids, context=context):
|
||||
proc_ids = []
|
||||
group_id = self.pool.get("procurement.group").create(cr, uid, {'name': order.name}, context=context)
|
||||
group_id = self.pool.get("procurement.group").create(cr, uid, {
|
||||
'name': order.name, 'partner_id': order.partner_shipping_id.id
|
||||
}, context=context)
|
||||
order.write({'procurement_group_id': group_id}, context=context)
|
||||
for line in order.order_line:
|
||||
if (line.state == 'done') or not line.product_id:
|
||||
|
|
|
@ -84,6 +84,7 @@ class procurement_order(osv.osv):
|
|||
'move_dest_id': procurement.move_dest_id and procurement.move_dest_id.id or False,
|
||||
'procurement_id': procurement.id,
|
||||
'rule_id': procurement.rule_id.id,
|
||||
'origin': procurement.origin,
|
||||
'picking_type_id': procurement.rule_id.picking_type_id.id,
|
||||
}
|
||||
|
||||
|
@ -94,7 +95,9 @@ class procurement_order(osv.osv):
|
|||
return False
|
||||
move_obj = self.pool.get('stock.move')
|
||||
move_dict = self._run_move_create(cr, uid, procurement, context=context)
|
||||
print '***', move_dict
|
||||
move_id = move_obj.create(cr, uid, move_dict, context=context)
|
||||
print '***', move_id, move_dict
|
||||
move_obj.action_confirm(cr, uid, [move_id], context=context)
|
||||
return move_id
|
||||
return super(procurement_order, self)._run(cr, uid, procurement, context)
|
||||
|
|
|
@ -942,7 +942,7 @@ class stock_move(osv.osv):
|
|||
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True, select=True),
|
||||
'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Order of", select=True),
|
||||
'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Source", store=True),
|
||||
'origin': fields.char("Source"),
|
||||
'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procurement Method', required=True, help="Make to Stock: When needed, the product is taken from the stock or we wait for replenishment. \nMake to Order: When needed, the product is purchased or produced."),
|
||||
|
||||
# used for colors in tree views:
|
||||
|
@ -1164,7 +1164,7 @@ class stock_move(osv.osv):
|
|||
'origin': move.origin,
|
||||
'company_id': move.company_id and move.company_id.id or False,
|
||||
'move_type': move.group_id and move.group_id.move_type or 'one',
|
||||
'partner_id': move.partner_id and move.partner_id.id or False,
|
||||
'partner_id': move.group_id and move.group_id.partner_id and move.group_id.partner_id.id or False,
|
||||
'date_done': move.date_expected,
|
||||
'state': 'confirmed',
|
||||
'group_id': move.group_id and move.group_id.id or False,
|
||||
|
|
|
@ -566,12 +566,12 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state == 'draft';grey:state == 'cancel';red:state not in ('cancel', 'done') and date < current_date" string="Picking list">
|
||||
<field name="name"/>
|
||||
<field name="backorder_id"/>
|
||||
<field name="origin"/>
|
||||
<field name="date"/>
|
||||
<field name="min_date"/>
|
||||
<field name="backorder_id"/>
|
||||
<field name="state"/>
|
||||
<field name="picking_type_id"/>
|
||||
<field name="picking_type_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
Loading…
Reference in New Issue