Hardik Ansodariya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-381990-han into 
lp:openobject-addons/6.0.

Requested reviews:
  Vinay Rana (openerp) (vra-openerp)
  Rifakat (OpenERP) (rha-openerp)
  Hardik Ansodariya (OpenERP) (han-tinyerp)
  nel (nel-tinyerp)
  Naresh(OpenERP) (nch-openerp)
Related bugs:
  Bug #924009 in OpenERP Addons: "Problem with side effect of automatic 
chaining moves"
  https://bugs.launchpad.net/openobject-addons/+bug/924009

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-381990-han/+merge/92258

Hello,

Fixed the issue Problem with side effect of automatic chaining moves

Thanks
Hardik
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-381990-han/+merge/92258
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-381990-han.
=== modified file 'account/report/account_tax_report.py'
--- account/report/account_tax_report.py	2011-01-14 00:11:01 +0000
+++ account/report/account_tax_report.py	2012-02-09 12:19:25 +0000
@@ -229,4 +229,4 @@
 report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
     'addons/account/report/account_tax_report.rml', parser=tax_report, header="internal")
 
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'account/wizard/account_vat.py'
--- account/wizard/account_vat.py	2011-01-14 00:11:01 +0000
+++ account/wizard/account_vat.py	2012-02-09 12:19:25 +0000
@@ -35,10 +35,10 @@
     def _get_tax(self, cr, uid, context=None):
         taxes = self.pool.get('account.tax.code').search(cr, uid, [('parent_id', '=', False)], limit=1)
         return taxes and taxes[0] or False
-
+    
     _defaults = {
         'based_on': 'invoices',
-        'chart_tax_id': _get_tax
+        'chart_tax_id': _get_tax,
     }
 
     def create_vat(self, cr, uid, ids, context=None):
@@ -56,4 +56,4 @@
 
 account_vat_declaration()
 
-#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'stock/stock.py'
--- stock/stock.py	2012-01-10 12:52:13 +0000
+++ stock/stock.py	2012-02-09 12:19:25 +0000
@@ -1648,6 +1648,15 @@
             default = {}
         default = default.copy()
         return super(stock_move, self).copy(cr, uid, id, default, context=context)
+    
+    def _recursive_chain_location(self, cr, uid, move):
+        dest = True and move.location_dest_id
+        chained_loc = False
+        while dest:
+            final_loc = dest
+            chained_loc = dest.chained_location_id
+            dest = dest and chained_loc
+        return final_loc
 
     def _auto_init(self, cursor, context=None):
         res = super(stock_move, self)._auto_init(cursor, context=context)

=== modified file 'stock/wizard/stock_return_picking.py'
--- stock/wizard/stock_return_picking.py	2011-01-18 13:41:41 +0000
+++ stock/wizard/stock_return_picking.py	2012-02-09 12:19:25 +0000
@@ -147,6 +147,7 @@
         record_id = context and context.get('active_id', False) or False
         move_obj = self.pool.get('stock.move')
         pick_obj = self.pool.get('stock.picking')
+        location_obj = self.pool.get('stock.location')
         uom_obj = self.pool.get('product.uom')
         wf_service = netsvc.LocalService("workflow")
     
@@ -168,7 +169,8 @@
                 new_picking = pick_obj.copy(cr, uid, pick.id, {'name':'%s-return' % pick.name,
                         'move_lines':[], 'state':'draft', 'type':new_type,
                         'date':date_cur, 'invoice_state':data['invoice_state'],})
-            new_location=move.location_dest_id.id
+            location = move_obj._recursive_chain_location(cr, uid, move)
+            new_location= location.id
             if move.state=='done':
                 new_qty = data['return%s' % move.id]
                 returned_qty = move.product_qty
@@ -215,6 +217,7 @@
             'type':'ir.actions.act_window',
             'context':context,
         }
+    
 
 stock_return_picking()
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to