mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[FIX] crm_claim_rma : fix source location for incomming picking
This commit is contained in:
@@ -225,9 +225,26 @@
|
||||
<field name="claim_line_ids" nolabel="1" colspan="3"/>
|
||||
<group col="1" colspan="1">
|
||||
<separator string="Action" colspan="1"/>
|
||||
<button name="%(action_claim_picking_in)d" string="New picking IN" states="draft,open" type="action" target="new" context="{'warehouse_id': warehouse_id}"/>
|
||||
<button name="%(action_claim_picking_out)d" string="New picking OUT" states="draft,open" type="action" target="new" context="{'warehouse_id': warehouse_id, 'customer_id': partner_id}"/>
|
||||
<button name="%(action_claim_picking_loss)d" string="New Product Loss" states="draft,open" type="action" target="new" context="{'warehouse_id': warehouse_id}"/>
|
||||
<button name="%(action_claim_picking_in)d"
|
||||
string="New picking IN" states="draft,open"
|
||||
type="action" target="new"
|
||||
context="{'warehouse_id': warehouse_id,
|
||||
'partner_id': partner_id}"/>
|
||||
|
||||
|
||||
<button name="%(action_claim_picking_out)d"
|
||||
string="New picking OUT" states="draft,open"
|
||||
type="action" target="new"
|
||||
context="{'warehouse_id': warehouse_id,
|
||||
'partner_id': partner_id}"/>
|
||||
|
||||
<button name="%(action_claim_picking_loss)d"
|
||||
string="New Product Loss" states="draft,open"
|
||||
type="action" target="new"
|
||||
context="{'warehouse_id': warehouse_id,
|
||||
'partner_id': partner_id}"/>
|
||||
|
||||
|
||||
<button name="%(account.action_account_invoice_refund)d"
|
||||
type='action' string='New Refund'
|
||||
states='draft,open' icon="gtk-execute"
|
||||
|
||||
@@ -45,8 +45,10 @@ class claim_make_picking(osv.osv_memory):
|
||||
warehouse_id = context['warehouse_id']
|
||||
if context.get('picking_type') == 'out':
|
||||
loc_id = warehouse_obj.read(cr, uid, warehouse_id, ['lot_stock_id'], context=context)['lot_stock_id'][0]
|
||||
elif context.get('picking_type') in ['in', 'loss']:
|
||||
loc_id = warehouse_obj.read(cr, uid, warehouse_id, ['lot_output_id'], context=context)['lot_output_id'][0]
|
||||
elif context.get('picking_type') in ['in', 'loss'] and context.get('partner_id'):
|
||||
loc_id = self.pool.get('res.partner').read(cr, uid, context['partner_id'],
|
||||
['property_stock_customer'],
|
||||
context=context)['property_stock_customer']
|
||||
return loc_id
|
||||
|
||||
# Get default destination location
|
||||
@@ -54,7 +56,7 @@ class claim_make_picking(osv.osv_memory):
|
||||
warehouse_obj = self.pool.get('stock.warehouse')
|
||||
warehouse_id = context['warehouse_id']
|
||||
if context.get('picking_type') == 'out':
|
||||
loc_id = self.pool.get('res.partner').read(cr, uid, context.get('customer_id'), ['property_stock_customer'], context=context)['property_stock_customer'][0]
|
||||
loc_id = self.pool.get('res.partner').read(cr, uid, context.get('partner_id'), ['property_stock_customer'], context=context)['property_stock_customer'][0]
|
||||
elif context.get('picking_type') == 'in':
|
||||
loc_id = warehouse_obj.read(cr, uid, warehouse_id, ['lot_rma_id'], context=context)['lot_rma_id'][0]
|
||||
elif context.get('picking_type') == 'loss':
|
||||
|
||||
Reference in New Issue
Block a user