← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/ksa-addons2 into lp:~openerp-dev/openobject-addons/trunk-dev-addons2

 

Kirti Savalia(OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/ksa-addons2 into lp:~openerp-dev/openobject-addons/trunk-dev-addons2.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  #500931 No analytic entry is generated finishing one production order
  https://bugs.launchpad.net/bugs/500931
  #543979 product: check uos not necessary
  https://bugs.launchpad.net/bugs/543979
  #623680 [5.0] stock - Stock Inventory with date past
  https://bugs.launchpad.net/bugs/623680
  #674551 "qunatity" in MRP
  https://bugs.launchpad.net/bugs/674551
  #674578 no pdf report "delivery order" in warehouse management
  https://bugs.launchpad.net/bugs/674578
  #675418 account moves with same account in debit and credit
  https://bugs.launchpad.net/bugs/675418
  #677437 Production : done moves should not be re-considered while completing production order
  https://bugs.launchpad.net/bugs/677437
  #680916 "Work center" spelling is inconsistent
  https://bugs.launchpad.net/bugs/680916
  #683231 [6.0][purchase] destination address inside company makes picking to "customer" location
  https://bugs.launchpad.net/bugs/683231
  #687352 remove the domain on the filter field in segment
  https://bugs.launchpad.net/bugs/687352
  #687360 Warehouse : change order of buttons in incoming and outgoingview 
  https://bugs.launchpad.net/bugs/687360
  #690583 stock.picking.test_finished: write() takes at most 6 arguments (8 given)
  https://bugs.launchpad.net/bugs/690583
  #690700 [purchase-stock] Wrong Partner used when invoicing from picking coming from a puchase with sent_to_address
  https://bugs.launchpad.net/bugs/690700
  #691901 [6.0] delivery data.xml contains demo data
  https://bugs.launchpad.net/bugs/691901
  #692461 [6.0] wiki_faq - update problem - reloads template
  https://bugs.launchpad.net/bugs/692461
  #692467 menuitem for price.type object is missing
  https://bugs.launchpad.net/bugs/692467
  #695343 mrp_repair doesn't work with products with lot tracking
  https://bugs.launchpad.net/bugs/695343
  #697273 [6.0 rc2] regression - cannot specify dedicated inventory accounts for periodical inventory or production
  https://bugs.launchpad.net/bugs/697273
  #697554 Custom Reports do not display any values
  https://bugs.launchpad.net/bugs/697554
  #699821 add access group on button used to update stock on product
  https://bugs.launchpad.net/bugs/699821
  #701017 Duplication of product should not duplicate its BoM if the product is a component.
  https://bugs.launchpad.net/bugs/701017
  #704289 "Deliveries to Invoice" lists "Put in new pack" twice
  https://bugs.launchpad.net/bugs/704289
  #710516 Purchase: Try to select destination address which has no partner on it
  https://bugs.launchpad.net/bugs/710516
  #710717 Internal Stock move have problem if wearhouse input location = Input
  https://bugs.launchpad.net/bugs/710717
  #711778 Synchronization with all objects
  https://bugs.launchpad.net/bugs/711778
  #718685 [PS] Inventory : production lot doesn't work
  https://bugs.launchpad.net/bugs/718685

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/ksa-addons2/+merge/49799

[1] https://bugs.launchpad.net/openobject-addons/+bug/711778
[2] https://bugs.launchpad.net/openobject-addons/+bug/718685
 hr related changes
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/ksa-addons2/+merge/49799
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/ksa-addons2.
=== modified file 'account/wizard/account_automatic_reconcile.py'
--- account/wizard/account_automatic_reconcile.py	2011-02-15 12:13:39 +0000
+++ account/wizard/account_automatic_reconcile.py	2011-02-15 12:48:06 +0000
@@ -144,6 +144,9 @@
         if context is None:
             context = {}
         form = self.read(cr, uid, ids, [])[0]
+        for m2o_field in ['journal_id','period_id','writeoff_acc_id']:
+            if form[m2o_field] and isinstance(form[m2o_field], tuple):
+                form[m2o_field] = form[m2o_field][0]
         max_amount = form.get('max_amount', False) and form.get('max_amount') or 0.0
         power = form['power']
         allow_write_off = form['allow_write_off']
@@ -252,4 +255,4 @@
 
 account_automatic_reconcile()
 
-# 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_change_currency.py'
--- account/wizard/account_change_currency.py	2011-02-15 12:13:39 +0000
+++ account/wizard/account_change_currency.py	2011-02-15 12:48:06 +0000
@@ -45,8 +45,8 @@
         obj_currency = self.pool.get('res.currency')
         if context is None:
             context = {}
-        data = self.read(cr, uid, ids)[0]
-        new_currency = data['currency_id']
+        data = self.browse(cr, uid, ids)[0]
+        new_currency = data.currency_id.id
 
         invoice = obj_inv.browse(cr, uid, context['active_id'], context=context)
         if invoice.currency_id.id == new_currency:
@@ -76,4 +76,4 @@
 
 account_change_currency()
 
-# 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_chart.py'
--- account/wizard/account_chart.py	2011-02-15 12:13:39 +0000
+++ account/wizard/account_chart.py	2011-02-15 12:48:06 +0000
@@ -79,17 +79,17 @@
         fy_obj = self.pool.get('account.fiscalyear')
         if context is None:
             context = {}
-        data = self.read(cr, uid, ids, [], context=context)[0]
+        data = self.browse(cr, uid, ids, context=context)[0]
         result = mod_obj.get_object_reference(cr, uid, 'account', 'action_account_tree')
         id = result and result[1] or False
         result = act_obj.read(cr, uid, [id], context=context)[0]
         result['periods'] = []
-        if data['period_from'] and data['period_to']:
-            result['periods'] = period_obj.build_ctx_periods(cr, uid, data['period_from'], data['period_to'])
-        result['context'] = str({'fiscalyear': data['fiscalyear'], 'periods': result['periods'], \
-                                    'state': data['target_move']})
-        if data['fiscalyear']:
-            result['name'] += ':' + fy_obj.read(cr, uid, [data['fiscalyear']], context=context)[0]['code']
+        if data.period_from and data.period_to:
+            result['periods'] = period_obj.build_ctx_periods(cr, uid, data.period_from.id, data.period_to.id)
+        result['context'] = str({'fiscalyear': data.fiscalyear.id, 'periods': result['periods'], \
+                                    'state': data.target_move})
+        if data.fiscalyear:
+            result['name'] += ':' + fy_obj.read(cr, uid, [data.fiscalyear.id], context=context)[0]['code']
         return result
 
     _defaults = {

=== modified file 'account/wizard/account_fiscalyear_close.py'
--- account/wizard/account_fiscalyear_close.py	2011-02-15 12:13:39 +0000
+++ account/wizard/account_fiscalyear_close.py	2011-02-15 12:48:06 +0000
@@ -56,7 +56,10 @@
         obj_acc_account = self.pool.get('account.account')
         obj_acc_journal_period = self.pool.get('account.journal.period')
 
-        data =  self.read(cr, uid, ids, context=context)
+        data = self.read(cr, uid, ids, context=context)
+        for m2o_field in ['fy_id','fy2_id','journal_id','period_id']:
+            if isinstance(data[0][m2o_field], tuple):
+                data[0][m2o_field] = data[0][m2o_field][0]
 
         if context is None:
             context = {}

=== modified file 'account/wizard/account_fiscalyear_close_state.py'
--- account/wizard/account_fiscalyear_close_state.py	2011-02-15 12:13:39 +0000
+++ account/wizard/account_fiscalyear_close_state.py	2011-02-15 12:48:06 +0000
@@ -40,8 +40,8 @@
         @param ids: List of Account fiscalyear close state’s IDs
 
         """
-        for data in  self.read(cr, uid, ids, context=context):
-            fy_id = data['fy_id']
+        for data in  self.browse(cr, uid, ids, context=context):
+            fy_id = data.fy_id.id
 
             cr.execute('UPDATE account_journal_period ' \
                         'SET state = %s ' \
@@ -61,4 +61,4 @@
 
 account_fiscalyear_close_state()
 
-# 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_invoice_refund.py'
--- account/wizard/account_invoice_refund.py	2011-02-15 12:13:39 +0000
+++ account/wizard/account_invoice_refund.py	2011-02-15 12:48:06 +0000
@@ -95,6 +95,8 @@
             description = False
             company = res_users_obj.browse(cr, uid, uid, context=context).company_id
             journal_id = form.get('journal_id', False)
+            if isinstance(journal_id, tuple):
+                journal_id = journal_id[0]
             for inv in inv_obj.browse(cr, uid, context.get('active_ids'), context=context):
                 if inv.state in ['draft', 'proforma2', 'cancel']:
                     raise osv.except_osv(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode))
@@ -102,6 +104,8 @@
                     raise osv.except_osv(_('Error !'), _('Can not %s invoice which is already reconciled, invoice should be unreconciled first. You can only Refund this invoice') % (mode))
                 if form['period']:
                     period = form['period']
+                    if isinstance(period, tuple):
+                        period = period[0]
                 else:
                     period = inv.period_id and inv.period_id.id or False
 
@@ -217,4 +221,4 @@
 
 account_invoice_refund()
 
-# 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_move_bank_reconcile.py'
--- account/wizard/account_move_bank_reconcile.py	2011-02-15 12:13:39 +0000
+++ account/wizard/account_move_bank_reconcile.py	2011-02-15 12:48:06 +0000
@@ -41,15 +41,15 @@
         """
         if context is None:
             context = {}
-        data = self.read(cr, uid, ids, context=context)[0]
+        data = self.browse(cr, uid, ids, context=context)[0]
         cr.execute('select default_credit_account_id \
-                        from account_journal where id=%s', (data['journal_id'],))
+                        from account_journal where id=%s', (data.journal_id.id,))
         account_id = cr.fetchone()[0]
         if not account_id:
              raise osv.except_osv(_('Error'), _('You have to define \
 the bank account\nin the journal definition for reconciliation.'))
         return {
-            'domain': "[('journal_id','=',%d), ('account_id','=',%d), ('state','<>','draft')]" % (data['journal_id'], account_id),
+            'domain': "[('journal_id','=',%d), ('account_id','=',%d), ('state','<>','draft')]" % (data.journal_id.id, account_id),
             'name': _('Standard Encoding'),
             'view_type': 'form',
             'view_mode': 'tree,form',
@@ -61,4 +61,4 @@
 
 account_move_bank_reconcile()
 
-# 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_move_line_reconcile_select.py'
--- account/wizard/account_move_line_reconcile_select.py	2011-02-15 12:13:39 +0000
+++ account/wizard/account_move_line_reconcile_select.py	2011-02-15 12:48:06 +0000
@@ -39,9 +39,9 @@
         @return: dictionary of  Open  account move line window for reconcile on given account id
 
          """
-        data = self.read(cr, uid, ids, context=context)[0]
+        data = self.browse(cr, uid, ids, context=context)[0]
         return {
-            'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data['account_id'],
+            'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data.account_id.id,
             'name': _('Reconciliation'),
             'view_type': 'form',
             'view_mode': 'tree,form',
@@ -52,4 +52,4 @@
 
 account_move_line_reconcile_select()
 
-# 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_move_line_unreconcile_select.py'
--- account/wizard/account_move_line_unreconcile_select.py	2011-02-15 12:13:39 +0000
+++ account/wizard/account_move_line_unreconcile_select.py	2011-02-15 12:48:06 +0000
@@ -28,9 +28,9 @@
        'account_id': fields.many2one('account.account','Account',required=True),
     }
     def action_open_window(self, cr, uid, ids, context=None):
-        data = self.read(cr, uid, ids, context=context)[0]
+        data = self.browse(cr, uid, ids, context=context)[0]
         return {
-                'domain': "[('account_id','=',%d),('reconcile_id','<>',False),('state','<>','draft')]" % data['account_id'],
+                'domain': "[('account_id','=',%d),('reconcile_id','<>',False),('state','<>','draft')]" % data.account_id.id,
                 'name': 'Unreconciliation',
                 'view_type': 'form',
                 'view_mode': 'tree,form',
@@ -41,4 +41,4 @@
 
 account_move_line_unreconcile_select()
 
-# 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_reconcile.py'
--- account/wizard/account_reconcile.py	2011-02-15 12:13:39 +0000
+++ account/wizard/account_reconcile.py	2011-02-15 12:48:06 +0000
@@ -152,13 +152,13 @@
         period_obj = self.pool.get('account.period')
         if context is None:
             context = {}
-        data = self.read(cr, uid, ids,context=context)[0]
-        account_id = data['writeoff_acc_id']
-        context['date_p'] = data['date_p']
-        journal_id = data['journal_id']
-        context['comment'] = data['comment']
-        if data['analytic_id']:
-            context['analytic_id'] = data['analytic_id']
+        data = self.browse(cr, uid, ids,context=context)[0]
+        account_id = data.writeoff_acc_id.id
+        context['date_p'] = data.date_p
+        journal_id = data.journal_id.id
+        context['comment'] = data.comment
+        if data.analytic_id:
+            context['analytic_id'] = data.analytic_id.id
         if context['date_p']:
             date = context['date_p']
 
@@ -173,4 +173,4 @@
 
 account_move_line_reconcile_writeoff()
 
-# 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_tax_chart.py'
--- account/wizard/account_tax_chart.py	2011-02-15 12:13:39 +0000
+++ account/wizard/account_tax_chart.py	2011-02-15 12:48:06 +0000
@@ -54,20 +54,20 @@
         period_obj = self.pool.get('account.period')
         if context is None:
             context = {}
-        data = self.read(cr, uid, ids, [], context=context)[0]
+        data = self.browse(cr, uid, ids, context=context)[0]
         result = mod_obj.get_object_reference(cr, uid, 'account', 'action_tax_code_tree')
         id = result and result[1] or False
         result = act_obj.read(cr, uid, [id], context=context)[0]
-        if data['period_id']:
-            fiscalyear_id = period_obj.read(cr, uid, [data['period_id']], context=context)[0]['fiscalyear_id'][0]
-            result['context'] = str({'period_id': data['period_id'], \
+        if data.period_id:
+            fiscalyear_id = period_obj.read(cr, uid, [data.period_id.id], context=context)[0]['fiscalyear_id'][0]
+            result['context'] = str({'period_id': data.period_id.id, \
                                      'fiscalyear_id': fiscalyear_id, \
-                                        'state': data['target_move']})
+                                        'state': data.target_move})
         else:
-            result['context'] = str({'state': data['target_move']})
+            result['context'] = str({'state': data.target_move})
 
-        if data['period_id']:
-            period_code = period_obj.read(cr, uid, [data['period_id']], context=context)[0]['code']
+        if data.period_id:
+            period_code = period_obj.read(cr, uid, [data.period_id.id], context=context)[0]['code']
             result['name'] += period_code and (':' + period_code) or ''
         return result
 
@@ -78,4 +78,4 @@
 
 account_tax_chart()
 
-# 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_analytic_plans/wizard/account_crossovered_analytic.py'
--- account_analytic_plans/wizard/account_crossovered_analytic.py	2011-02-15 12:13:39 +0000
+++ account_analytic_plans/wizard/account_crossovered_analytic.py	2011-02-15 12:48:06 +0000
@@ -45,6 +45,8 @@
         acc_ids = [x[0] for x in res]
 
         data = self.read(cr, uid, ids, [], context=context)[0]
+        if isinstance(data['ref'],tuple):
+            data['ref'] = data['ref'][0]
 
         obj_acc = self.pool.get('account.analytic.account').browse(cr, uid, data['ref'], context=context)
         name = obj_acc.name
@@ -72,4 +74,4 @@
 
 account_crossovered_analytic()
 
-# 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_coda/wizard/account_coda_import.py'
--- account_coda/wizard/account_coda_import.py	2011-02-15 12:13:39 +0000
+++ account_coda/wizard/account_coda_import.py	2011-02-15 12:48:06 +0000
@@ -69,14 +69,14 @@
         if context is None:
             context = {}
 
-        data = self.read(cr, uid, ids)[0]
+        data = self.browse(cr, uid, ids)[0]
 
-        codafile = data['coda']
-        journal_code = journal_obj.browse(cr, uid, data['journal_id'], context=context).code
+        codafile = data.coda
+        journal_code = journal_obj.browse(cr, uid, data.journal_id.id, context=context).code
 
         period = account_period_obj.find(cr, uid, context=context)[0]
-        def_pay_acc = data['def_payable']
-        def_rec_acc = data['def_receivable']
+        def_pay_acc = data.def_payable.id
+        def_rec_acc = data.def_receivable.id
 
         err_log = "Errors:\n------\n"
         nb_err=0
@@ -96,7 +96,7 @@
                 bank_statement["bank_statement_line"]={}
                 bank_statement_lines = {}
                 bank_statement['date'] = str2date(line[5:11])
-                bank_statement['journal_id']=data['journal_id']
+                bank_statement['journal_id']=data.journal_id.id
                 period_id = account_period_obj.search(cr, uid, [('date_start', '<=', time.strftime('%Y-%m-%d', time.strptime(bank_statement['date'], "%y/%m/%d"))), ('date_stop', '>=', time.strftime('%Y-%m-%d', time.strptime(bank_statement['date'], "%y/%m/%d")))])
                 bank_statement['period_id'] = period_id and period_id[0] or False
                 bank_statement['state']='draft'
@@ -144,7 +144,7 @@
                     bank_statement["bank_statement_line"]=bank_statement_lines
                 elif line[1] == '2':
                     st_line_name = line[2:6]
-                    bank_statement_lines[st_line_name].update({'account_id': data['awaiting_account']})
+                    bank_statement_lines[st_line_name].update({'account_id': data.awaiting_account.id})
 
                 elif line[1] == '3':
                     # movement data record 3.1
@@ -165,7 +165,7 @@
                     else:
                         nb_err += 1
                         err_log += _('The bank account %s is not defined for the partner %s.\n')%(cntry_number, contry_name)
-                        bank_statement_lines[st_line_name].update({'account_id': data['awaiting_account']})
+                        bank_statement_lines[st_line_name].update({'account_id': data.awaiting_account.id})
 
                     bank_statement["bank_statement_line"]=bank_statement_lines
             elif line[0]=='3':
@@ -296,7 +296,7 @@
             'name': codafile,
             'statement_ids': [(6, 0, bkst_list,)],
             'note': str_log1+str_not+std_log+err_log,
-            'journal_id': data['journal_id'],
+            'journal_id': data.journal_id.id,
             'date': time.strftime("%Y-%m-%d"),
             'user_id': uid,
         })
@@ -336,4 +336,4 @@
 
 account_coda_import()
 
-# 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_followup/wizard/account_followup_print.py'
--- account_followup/wizard/account_followup_print.py	2011-02-15 12:13:39 +0000
+++ account_followup/wizard/account_followup_print.py	2011-02-15 12:48:06 +0000
@@ -48,10 +48,10 @@
 
         if context is None:
             context = {}
-        data = self.read(cr, uid, ids, [], context=context)[0]
+        data = self.browse(cr, uid, ids, context=context)[0]
         model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all')], context=context)
         resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
-        context.update({'followup_id': data['followup_id'], 'date':data['date']})
+        context.update({'followup_id': data.followup_id.id, 'date':data.date})
         return {
             'name': _('Select Partners'),
             'view_type': 'form',

=== modified file 'account_invoice_layout/report/special_message_invoice.py'
--- account_invoice_layout/report/special_message_invoice.py	2011-02-15 12:13:39 +0000
+++ account_invoice_layout/report/special_message_invoice.py	2011-02-15 12:48:06 +0000
@@ -37,7 +37,10 @@
         self.context = context
 
     def spcl_msg(self, form):
-        account_msg_data = pooler.get_pool(self.cr.dbname).get('notify.message').browse(self.cr, self.uid, form['message'])
+        msg_id = form['message']
+        if isinstance(msg_id, (tuple,list)):
+            msg_id = msg_id[0]
+        account_msg_data = pooler.get_pool(self.cr.dbname).get('notify.message').browse(self.cr, self.uid, msg_id)
         msg = account_msg_data.msg
         return msg
 

=== modified file 'base_synchro/wizard/base_synchro.py'
--- base_synchro/wizard/base_synchro.py	2011-01-14 00:11:01 +0000
+++ base_synchro/wizard/base_synchro.py	2011-02-15 12:48:06 +0000
@@ -32,13 +32,13 @@
     def __init__(self, server, ressource):
         self.server = server
         local_url = 'http://%s:%d/xmlrpc/common'%(server.server_url,server.server_port)
-        rpc = xmlrpclib.ServerProxy(local_url)
+        rpc = xmlrpclib.ServerProxy(local_url, allow_none=True)
         self.uid = rpc.login(server.server_db, server.login, server.password)
         local_url = 'http://%s:%d/xmlrpc/object'%(server.server_url,server.server_port)
-        self.rpc = xmlrpclib.ServerProxy(local_url)
+        self.rpc = xmlrpclib.ServerProxy(local_url, allow_none=True)
         self.ressource = ressource
     def __getattr__(self, name):
-        return lambda cr, uid, *args, **kwargs: self.rpc.execute(self.server.server_db, self.uid, self.server.password, self.ressource, name, *args, **kwargs)
+        return lambda cr, uid, *args, **kwargs: self.rpc.execute(self.server.server_db, self.uid, self.server.password, self.ressource, name, *args)
 
 class RPCProxy(object):
     def __init__(self, server):
@@ -79,6 +79,7 @@
                 eval(object.domain),
                 {'action':'d'}
             )
+
         if object.action in ('u','b'):
             ids += pool2.get('base.synchro.obj').get_ids(cr, uid,
                 object.model_id.model,
@@ -102,7 +103,7 @@
             if object.model_id.model=='crm.case.history':
                 fields = ['email','description','log_id']
             value = pool_src.get(object.model_id.model).read(cr, uid, [id], fields)[0]
-            value = self.data_transform(cr, uid, pool_src, pool_dest, object.model_id.model, value, action)
+            value = self.data_transform(cr, uid, pool_src, pool_dest, object.model_id.model, value, action, context=context)
             id2 = self.get_id(cr, uid, object.id, id, action, context)
             #
             # Transform value
@@ -110,7 +111,6 @@
             #tid=pool_dest.get(object.model_id.model).name_search(cr, uid, value['name'],[],'=',)
             if not (iii%50):
                 print 'Record', iii
-
             # Filter fields to not sync
             for field in object.avoid_ids:
                 if field.name in value:
@@ -133,7 +133,7 @@
                 })
                 self.report_total+=1
                 self.report_create+=1
-        self.meta = {}
+            self.meta = {}
         return True
 
     def get_id(self, cr, uid, object_id, id, action, context=None):
@@ -216,16 +216,16 @@
         start_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
         syn_obj = self.browse(cr, uid, ids, context=context)[0]
         pool = pooler.get_pool(cr.dbname)
-        server = pool.get('base.synchro.server').browse(cr, uid, ids, context=context)[0]
+        server = pool.get('base.synchro.server').browse(cr, uid, syn_obj.server_url.id, context=context)
         for object in server.obj_ids:
             dt = time.strftime('%Y-%m-%d %H:%M:%S')
-            self.synchronize(cr, uid, server, object, context)
+            self.synchronize(cr, uid, server, object, context=context)
             if object.action=='b':
                 time.sleep(1)
                 dt = time.strftime('%Y-%m-%d %H:%M:%S')
             self.pool.get('base.synchro.obj').write(cr, uid, [object.id], {'synchronize_date': dt})
         end_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
-        if 'user_id' in syn_obj.user_id:
+        if syn_obj.user_id:
             request = pooler.get_pool(cr.dbname).get('res.request')
             if not self.report:
                 self.report.append('No exception.')
@@ -244,7 +244,7 @@
             request.create(cr, uid, {
                 'name' : "Synchronization report",
                 'act_from' : uid,
-                'act_to' : syn_obj.user_id,
+                'act_to' : syn_obj.user_id.id,
                 'body': summary,
             })
             return True
@@ -256,6 +256,7 @@
         id2 = data_obj._get_id(cr, uid, 'base_synchro', 'view_base_synchro_finish')
         if id2:
             id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+        cr.commit()
         return {
             'view_type': 'form',
             'view_mode': 'form',

=== modified file 'base_synchro/wizard/base_synchro_view.xml'
--- base_synchro/wizard/base_synchro_view.xml	2011-01-14 00:11:01 +0000
+++ base_synchro/wizard/base_synchro_view.xml	2011-02-15 12:48:06 +0000
@@ -25,6 +25,7 @@
             <field name="res_model">base.synchro</field>
             <field name="view_type">form</field>
             <field name="view_mode">form</field>
+            <field name="view_id" ref="view_base_synchro"/>
             <field name="target">new</field>
         </record>
 

=== modified file 'hr/hr.py'
--- hr/hr.py	2011-01-17 18:02:22 +0000
+++ hr/hr.py	2011-02-15 12:48:06 +0000
@@ -204,15 +204,15 @@
             level -= 1
         return True
 
-    def _check_department_id(self, cr, uid, ids, context=None):
-        for emp in self.browse(cr, uid, ids, context=context):
-            if emp.department_id.manager_id and emp.id == emp.department_id.manager_id.id:
-                return False
-        return True
+#    def _check_department_id(self, cr, uid, ids, context=None):
+#        for emp in self.browse(cr, uid, ids, context=context):
+#            if emp.department_id.manager_id and emp.id == emp.department_id.manager_id.id:
+#                return False
+#        return True
 
     _constraints = [
         (_check_recursion, 'Error ! You cannot create recursive Hierarchy of Employees.', ['parent_id']),
-        (_check_department_id, 'Error ! You cannot select a department for which the employee is the manager.', ['department_id']),
+#        (_check_department_id, 'Error ! You cannot select a department for which the employee is the manager.', ['department_id']),
     ]
 
 hr_employee()

=== modified file 'hr/security/hr_security.xml'
--- hr/security/hr_security.xml	2011-01-14 00:11:01 +0000
+++ hr/security/hr_security.xml	2011-02-15 12:48:06 +0000
@@ -7,7 +7,7 @@
     </record>
 
     <record id="base.group_hr_user" model="res.groups">
-        <field name="name">Human Resources / User</field>
+        <field name="name">Human Resources / Officer</field>
     </record>
 </data>
 </openerp>

=== modified file 'hr_holidays/hr_holidays_view.xml'
--- hr_holidays/hr_holidays_view.xml	2011-01-21 06:59:40 +0000
+++ hr_holidays/hr_holidays_view.xml	2011-02-15 12:48:06 +0000
@@ -94,7 +94,7 @@
                             <field name="state" colspan="2"/>
                             <group colspan="2" col="6">
                                 <button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_user,base.group_hr_manager"/>
-                                <button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
+                                <button string="Submit to Manager" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
                                 <button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_user"/>
                                 <button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_user"/>
                                 <button string="Set to Draft" name="set_to_draft" states="refuse" type="object" icon="gtk-convert" groups="base.group_hr_user"/>
@@ -414,7 +414,7 @@
         </record>
 
         <menuitem sequence="3" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Holidays"/>
-        
+
         <menuitem name="Leave Type"
             action="open_view_holiday_status"
             id="menu_open_view_holiday_status"

=== modified file 'hr_recruitment/wizard/hr_recruitment_phonecall.py'
--- hr_recruitment/wizard/hr_recruitment_phonecall.py	2011-02-15 12:13:39 +0000
+++ hr_recruitment/wizard/hr_recruitment_phonecall.py	2011-02-15 12:48:06 +0000
@@ -69,7 +69,7 @@
         phonecall_case_obj = self.pool.get('crm.phonecall')
         if context is None:
             context = {}
-        form = self.read(cr, uid, ids, [], context=context)[0]
+        form = self.browse(cr, uid, ids, context=context)[0]
         result = mod_obj._get_id(cr, uid, 'crm', 'view_crm_case_phonecalls_filter')
         res = mod_obj.read(cr, uid, result, ['res_id'], context=context)
         # Select the view
@@ -85,10 +85,10 @@
             #TODO: Take other info from job
             new_phonecall_id = phonecall_case_obj.create(cr, uid, {
                         'name': job.name,
-                        'user_id': form['user_id'],
-                        'categ_id': form['category_id'],
-                        'description': form['note'],
-                        'date': form['deadline'],
+                        'user_id': form.user_id.id,
+                        'categ_id': form.category_id.id,
+                        'description': form.note,
+                        'date': form.deadline,
                         'description': job.description,
                         'partner_id': job.partner_id.id,
                         'partner_address_id': job.partner_address_id.id,

=== modified file 'hr_timesheet/wizard/hr_timesheet_print_employee.py'
--- hr_timesheet/wizard/hr_timesheet_print_employee.py	2011-01-14 00:11:01 +0000
+++ hr_timesheet/wizard/hr_timesheet_print_employee.py	2011-02-15 12:48:06 +0000
@@ -31,7 +31,7 @@
                                   'Month', required=True),
         'year': fields.integer('Year', required=True),
         'employee_id': fields.many2one('hr.employee', 'Employee', required=True)
-    
+
                 }
 
     def _get_user(self, cr, uid, context=None):
@@ -50,6 +50,8 @@
 
     def print_report(self, cr, uid, ids, context=None):
         data = self.read(cr, uid, ids, context=context)[0]
+        if isinstance(data['employee_id'], tuple):
+            data['employee_id'] = data['employee_id'][0]
         datas = {
              'ids': [],
              'model': 'hr.employee',

=== modified file 'hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py'
--- hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py	2011-01-14 00:11:01 +0000
+++ hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py	2011-02-15 12:48:06 +0000
@@ -59,6 +59,9 @@
         res = mod_obj.read(cr, uid, result, ['res_id'], context=context)
 
         data = self.read(cr, uid, ids, [], context=context)[0]
+        if isinstance(data['balance_product'], tuple):
+            data['balance_product'] = data['balance_product'][0]
+
         account_ids = 'active_ids' in context and context['active_ids'] or []
 
         for account in analytic_account_obj.browse(cr, uid, account_ids, context=context):

=== modified file 'hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py'
--- hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py	2011-02-15 12:13:39 +0000
+++ hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py	2011-02-15 12:48:06 +0000
@@ -63,13 +63,13 @@
         if context is None:
             context = {}
         result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
-        data = self.read(cr, uid, ids, [], context=context)[0]
+        data = self.browse(cr, uid, ids, context=context)[0]
 
         account_ids = {}
         for line in self.pool.get('account.analytic.line').browse(cr, uid, context['active_ids'], context=context):
             account_ids[line.account_id.id] = True
 
-        account_ids = account_ids.keys() #data['accounts']
+        account_ids = account_ids.keys() #data.accounts
         for account in analytic_account_obj.browse(cr, uid, account_ids, context=context):
             partner = account.partner_id
             if (not partner) or not (account.pricelist_id):
@@ -121,17 +121,17 @@
                 factor_name = ''
                 factor = invoice_factor_obj.browse(cr, uid, factor_id, context2)
 
-                if not data['product']:
+                if not data.product:
                     if factor.customer_name:
                         factor_name = product.name+' - '+factor.customer_name
                     else:
                         factor_name = product.name
                 else:
-                    factor_name = product_obj.name_get(cr, uid, [data['product']], context=context)[0][1]
+                    factor_name = product_obj.name_get(cr, uid, [data.product.id], context=context)[0][1]
 
                 if account.pricelist_id:
                     pl = account.pricelist_id.id
-                    price = pro_price_obj.price_get(cr,uid,[pl], data['product'] or product_id, qty or 1.0, account.partner_id.id)[pl]
+                    price = pro_price_obj.price_get(cr,uid,[pl], data.product.id or product_id, qty or 1.0, account.partner_id.id)[pl]
                 else:
                     price = 0.0
 
@@ -145,7 +145,7 @@
                     'invoice_line_tax_id': [(6,0,tax )],
                     'invoice_id': last_invoice,
                     'name': factor_name,
-                    'product_id': data['product'] or product_id,
+                    'product_id': data.product.id or product_id,
                     'invoice_line_tax_id': [(6,0,tax)],
                     'uos_id': product.uom_id.id,
                     'account_id': account_id,
@@ -162,14 +162,14 @@
                 for line in line_ids:
                     # set invoice_line_note
                     details = []
-                    if data['date']:
+                    if data.date:
                         details.append(line['date'])
-                    if data['time']:
+                    if data.time:
                         if line['product_uom_id']:
                             details.append("%s %s" % (line['unit_amount'], product_uom_obj.browse(cr, uid, [line['product_uom_id']],context2)[0].name))
                         else:
                             details.append("%s" % (line['unit_amount'], ))
-                    if data['name']:
+                    if data.name:
                         details.append(line['name'])
                     note.append(u' - '.join(map(lambda x: unicode(x) or '',details)))
 

=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py'
--- hr_timesheet_sheet/hr_timesheet_sheet.py	2011-01-17 11:20:56 +0000
+++ hr_timesheet_sheet/hr_timesheet_sheet.py	2011-02-15 12:48:06 +0000
@@ -269,7 +269,7 @@
                 'draft': [('readonly', False)],
                 'new': [('readonly', False)]}
             ),
-        'attendances_ids' : one2many_mod2('hr.attendance', 'sheet_id', 'Attendances', readonly=True,),
+        'attendances_ids' : one2many_mod2('hr.attendance', 'sheet_id', 'Attendances', readonly=True, states={'draft':[('readonly',False)],'new':[('readonly',False)]}),
         'state' : fields.selection([
             ('new', 'New'),
             ('draft','Draft'),

=== modified file 'lunch/wizard/lunch_order_confirm.py'
--- lunch/wizard/lunch_order_confirm.py	2011-02-15 12:13:39 +0000
+++ lunch/wizard/lunch_order_confirm.py	2011-02-15 12:48:06 +0000
@@ -46,8 +46,8 @@
         data = context and context.get('active_ids', []) or []
         order_ref = self.pool.get('lunch.order')
 
-        for confirm_obj in self.read(cr, uid, ids):
-            order_ref.confirm(cr, uid, data, confirm_obj['confirm_cashbox'], context)
+        for confirm_obj in self.browse(cr, uid, ids):
+            order_ref.confirm(cr, uid, data, confirm_obj.confirm_cashbox.id, context)
             return {'type': 'ir.actions.act_window_close'}
 
 lunch_order_confirm()

=== modified file 'mrp/wizard/mrp_product_produce.py'
--- mrp/wizard/mrp_product_produce.py	2011-01-14 00:11:01 +0000
+++ mrp/wizard/mrp_product_produce.py	2011-02-15 12:48:06 +0000
@@ -70,10 +70,10 @@
             context = {}
         prod_obj = self.pool.get('mrp.production')
         move_ids = context.get('active_ids', [])
-        for data in self.read(cr, uid, ids, context=context):
+        for data in self.browse(cr, uid, ids, context=context):
             for move_id in move_ids:
                 prod_obj.action_produce(cr, uid, move_id,
-                                    data['product_qty'], data['mode'], context=context)
+                                    data.product_qty, data.mode, context=context)
         return {}
 
 mrp_product_produce()

=== modified file 'point_of_sale/wizard/pos_payment.py'
--- point_of_sale/wizard/pos_payment.py	2011-02-15 12:13:39 +0000
+++ point_of_sale/wizard/pos_payment.py	2011-02-15 12:48:06 +0000
@@ -148,6 +148,9 @@
         order = order_obj.browse(cr, uid, active_id, context=context)
         amount = order.amount_total - order.amount_paid
         data =  self.read(cr, uid, ids, context=context)[0]
+        for m2o_field in ['product_id','pricelist_id','partner_id']:
+            if data[m2o_field] and isinstance(data[m2o_field], (list,tuple)):
+               data[m2o_field] = data[m2o_field][0]
         if data['is_acc']:
             amount = self.pool.get('product.product').browse(cr, uid, data['product_id'], context=context).list_price
 

=== modified file 'point_of_sale/wizard/pos_return.py'
--- point_of_sale/wizard/pos_return.py	2011-02-15 12:13:39 +0000
+++ point_of_sale/wizard/pos_return.py	2011-02-15 12:48:06 +0000
@@ -353,8 +353,8 @@
             data = return_boj.read(cr,uid,return_id,[])[0]
 
         wf_service = netsvc.LocalService("workflow")
-        self_data = self.read(cr, uid, ids)[0]
-        order_obj.add_product(cr, uid, active_ids[0], self_data['product_id'], self_data['quantity'], context=context)
+        self_data = self.browse(cr, uid, ids)[0]
+        order_obj.add_product(cr, uid, active_ids[0], self_data.product_id.id, self_data.quantity, context=context)
         
         for order_id in order_obj.browse(cr, uid, active_ids, context=context):
             prop_ids =property_obj.search(cr, uid, [('name', '=', 'property_stock_customer')])

=== modified file 'product/product.py'
=== modified file 'product/wizard/product_price.py'
--- product/wizard/product_price.py	2011-02-15 12:13:39 +0000
+++ product/wizard/product_price.py	2011-02-15 12:48:06 +0000
@@ -53,6 +53,8 @@
         datas = {'ids': context.get('active_ids', [])}
         res = self.read(cr, uid, ids, ['price_list','qty1', 'qty2','qty3','qty4','qty5'], context=context)
         res = res and res[0] or {}
+        if isinstance(res['price_list'], (tuple,list)):
+            res['price_list'] = res['price_list'][0]
         datas['form'] = res
         return {
             'type': 'ir.actions.report.xml',

=== modified file 'project/wizard/project_task_delegate.py'
--- project/wizard/project_task_delegate.py	2011-02-15 12:13:39 +0000
+++ project/wizard/project_task_delegate.py	2011-02-15 12:48:06 +0000
@@ -105,6 +105,8 @@
         task_id = context.get('active_id', False)
         task_pool = self.pool.get('project.task')
         delegate_data = self.read(cr, uid, ids, context=context)[0]
+        if isinstance(delegate_data['user_id'], tuple):
+            delegate_data['user_id'] = delegate_data['user_id'][0]
         delegate_data['name'] = tools.ustr(delegate_data['name'])
         task_pool.do_delegate(cr, uid, task_id, delegate_data, context=context)
         return {}

=== modified file 'project_gtd/wizard/project_gtd_fill.py'
--- project_gtd/wizard/project_gtd_fill.py	2011-02-15 12:13:39 +0000
+++ project_gtd/wizard/project_gtd_fill.py	2011-02-15 12:48:06 +0000
@@ -50,10 +50,10 @@
     def process(self, cr, uid, ids, context=None):
         if not ids:
             return {}
-        data = self.read(cr, uid, ids, [], context=context)
-        if not data[0]['task_ids']:
+        data = self.browse(cr, uid, ids, context=context)
+        if not data[0].task_ids:
             return {}
-        self.pool.get('project.task').write(cr, uid, data[0]['task_ids'], {'timebox_id':data[0]['timebox_to_id']})
+        self.pool.get('project.task').write(cr, uid, [x.id for x in data[0].task_ids], {'timebox_id':data[0].timebox_to_id.id})
         return {'type': 'ir.actions.act_window_close'}
 
 project_timebox_fill()

=== modified file 'project_long_term/wizard/project_compute_phases.py'
--- project_long_term/wizard/project_compute_phases.py	2011-02-15 12:13:39 +0000
+++ project_long_term/wizard/project_compute_phases.py	2011-02-15 12:48:06 +0000
@@ -45,12 +45,12 @@
         Compute the phases for scheduling.
         """
         project_pool = self.pool.get('project.project')
-        data = self.read(cr, uid, ids, [], context=context)[0]
-        if not data['project_id'] and data['target_project'] == 'one':
+        data = self.browse(cr, uid, ids, context=context)[0]
+        if not data.project_id and data.target_project == 'one':
             raise osv.except_osv(_('Error!'), _('Please Specify Project to be schedule'))
 
-        if data['project_id']:        # If project mentioned find its phases
-            project_ids = [data['project_id']]
+        if data.project_id:        # If project mentioned find its phases
+            project_ids = [data.project_id.id]
         else:                        # Else take all the draft,open,pending states phases
             project_ids = project_pool.search(cr, uid, [], context=context)
 
@@ -69,7 +69,7 @@
         id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
         result = act_obj.read(cr, uid, [id], context=context)[0]
         result['target'] = 'current'
-        result['context'] = {"search_default_project_id":data['project_id'], "default_project_id":data['project_id'], "search_default_responsible_id":uid, "search_default_current": 1}
+        result['context'] = {"search_default_project_id":data.project_id.id or False, "default_project_id":data.project_id.id or False, "search_default_responsible_id":uid, "search_default_current": 1}
         return result
 
 project_compute_phases()

=== modified file 'project_long_term/wizard/project_compute_tasks.py'
--- project_long_term/wizard/project_compute_tasks.py	2011-02-15 12:13:39 +0000
+++ project_long_term/wizard/project_compute_tasks.py	2011-02-15 12:48:06 +0000
@@ -37,8 +37,8 @@
         if context is None:
             context = {}
         context['compute_by'] = 'project'
-        data = self.read(cr, uid, ids, [])[0]
-        project_id = data['project_id']
+        data = self.browse(cr, uid, ids)[0]
+        project_id = data.project_id.id
         project_pool.schedule_tasks(cr, uid, [project_id], context=context)
         return self._open_task_list(cr, uid, data, context=context)
 

=== modified file 'project_scrum/wizard/project_scrum_backlog_create_task.py'
--- project_scrum/wizard/project_scrum_backlog_create_task.py	2011-01-14 00:11:01 +0000
+++ project_scrum/wizard/project_scrum_backlog_create_task.py	2011-02-15 12:48:06 +0000
@@ -35,6 +35,9 @@
         ids_task = []
 
         data = self.read(cr, uid, ids, [], context=context)[0]
+        if isinstance(data['user_id'], tuple):
+            data['user_id'] = data['user_id'][0]
+
         backlogs = backlog_id.browse(cr, uid, context['active_ids'], context=context)
         result = mod_obj._get_id(cr, uid, 'project', 'view_task_search_form')
         id = mod_obj.read(cr, uid, result, ['res_id'])

=== modified file 'project_scrum/wizard/project_scrum_backlog_sprint.py'
--- project_scrum/wizard/project_scrum_backlog_sprint.py	2011-01-14 00:11:01 +0000
+++ project_scrum/wizard/project_scrum_backlog_sprint.py	2011-02-15 12:48:06 +0000
@@ -42,6 +42,9 @@
         if context is None:
             context = {}
         data = self.read(cr, uid, ids, [], context=context)[0]
+        if isinstance(data['sprint_id'], tuple):
+            data['sprint_id'] = data['sprint_id'][0]
+
         for backlog in backlog_obj.browse(cr, uid, context['active_ids'], context=context):
             backlog_ids.append(backlog.id)
             if data['convert_to_task']:

=== modified file 'purchase/purchase.py'
=== modified file 'purchase_requisition/wizard/purchase_requisition_partner.py'
--- purchase_requisition/wizard/purchase_requisition_partner.py	2011-01-14 00:11:01 +0000
+++ purchase_requisition/wizard/purchase_requisition_partner.py	2011-02-15 12:48:06 +0000
@@ -67,7 +67,11 @@
             context = {}
         record_ids = context and context.get('active_ids', False)
         if record_ids:
-            data =  self.read(cr, uid, ids)
+            data =  self.read(cr, uid, ids,context=context)
+            for m2o_field in ['partner_id','partner_address_id']:
+                if isinstance(data[0][m2o_field], tuple):
+                    data[0][m2o_field] = data[0][m2o_field][0]
+
             company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
             order_obj = self.pool.get('purchase.order')
             order_line_obj = self.pool.get('purchase.order.line')

=== modified file 'stock/wizard/stock_inventory_line_split.py'
--- stock/wizard/stock_inventory_line_split.py	2011-01-14 00:11:01 +0000
+++ stock/wizard/stock_inventory_line_split.py	2011-02-15 12:48:06 +0000
@@ -29,65 +29,68 @@
     _name = "stock.inventory.line.split"
     _description = "Split inventory lines"
 
-    
+
     def default_get(self, cr, uid, fields, context=None):
-        """ To check the availability of production lot. 
+        """ To check the availability of production lot.
         @param self: The object pointer.
         @param cr: A database cursor
         @param uid: ID of the user currently logged in
-        @param fields: List of fields for which we want default values 
-        @param context: A standard dictionary 
-        @return: A dictionary which of fields with values. 
-        """        
+        @param fields: List of fields for which we want default values
+        @param context: A standard dictionary
+        @return: A dictionary which of fields with values.
+        """
         if context is None:
             context = {}
         record_id = context and context.get('active_id',False)
         res = {}
-        line = self.pool.get('stock.inventory.line').browse(cr, uid, record_id, context=context)        
+        line = self.pool.get('stock.inventory.line').browse(cr, uid, record_id, context=context)
         if 'product_id' in fields:
             res.update({'product_id':line.product_id.id})
         if 'product_uom' in fields:
             res.update({'product_uom': line.product_uom.id})
         if 'qty' in fields:
-            res.update({'qty': line.product_qty})       
+            res.update({'qty': line.product_qty})
         return res
-    
+
     def split(self, cr, uid, ids, line_ids, context=None):
         """ To split stock inventory lines according to production lot.
         @param self: The object pointer.
         @param cr: A database cursor
         @param uid: ID of the user currently logged in
-        @param ids: the ID or list of IDs if we want more than one 
+        @param ids: the ID or list of IDs if we want more than one
         @param line_ids: the ID or list of IDs of inventory lines we want to split
-        @param context: A standard dictionary 
-        @return: 
-        """                    
+        @param context: A standard dictionary
+        @return:
+        """
         prodlot_obj = self.pool.get('stock.production.lot')
         ir_sequence_obj = self.pool.get('ir.sequence')
         line_obj = self.pool.get('stock.inventory.line')
-        new_line = []        
+        new_line = []
         for data in self.browse(cr, uid, ids, context=context):
             for inv_line in line_obj.browse(cr, uid, line_ids, context=context):
                 line_qty = inv_line.product_qty
-                quantity_rest = inv_line.product_qty                
-                new_line = []   
+                quantity_rest = inv_line.product_qty
+                new_line = []
                 if data.use_exist:
                     lines = [l for l in data.line_exist_ids if l]
                 else:
-                    lines = [l for l in data.line_ids if l]                         
+                    lines = [l for l in data.line_ids if l]
                 for line in lines:
                     quantity = line.quantity
                     if quantity <= 0 or line_qty == 0:
                         continue
-                    quantity_rest -= quantity                    
-                    if quantity_rest <= 0:
+                    quantity_rest -= quantity
+                    if quantity_rest < 0:
                         quantity_rest = quantity
                         break
                     default_val = {
-                        'product_qty': quantity,                         
+                        'product_qty': quantity,
                     }
-                    current_line = line_obj.copy(cr, uid, inv_line.id, default_val)
-                    new_line.append(current_line)
+                    if quantity_rest > 0:
+                        current_line = line_obj.copy(cr, uid, inv_line.id, default_val)
+                        new_line.append(current_line)
+                    if quantity_rest == 0:
+                        current_line = inv_line.id
                     prodlot_id = False
                     if data.use_exist:
                         prodlot_id = line.prodlot_id.id
@@ -97,13 +100,13 @@
                             'product_id': inv_line.product_id.id},
                         context=context)
                     line_obj.write(cr, uid, [current_line], {'prod_lot_id': prodlot_id})
-                    prodlot = prodlot_obj.browse(cr, uid, prodlot_id)                    
-                    
+                    prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
+
                     update_val = {}
-                    if quantity_rest > 0:                        
-                        update_val['product_qty'] = quantity_rest                                            
+                    if quantity_rest > 0:
+                        update_val['product_qty'] = quantity_rest
                         line_obj.write(cr, uid, [inv_line.id], update_val)
-                    
+
         return new_line
 stock_inventory_line_split()
 

=== modified file 'stock/wizard/stock_move.py'
--- stock/wizard/stock_move.py	2011-02-15 12:13:39 +0000
+++ stock/wizard/stock_move.py	2011-02-15 12:48:06 +0000
@@ -98,9 +98,9 @@
             context = {}
         move_obj = self.pool.get('stock.move')
         move_ids = context['active_ids']
-        for data in self.read(cr, uid, ids):
+        for data in self.browse(cr, uid, ids):
             move_obj.action_consume(cr, uid, move_ids,
-                             data['product_qty'], data['location_id'],
+                             data.product_qty, data.location_id.id,
                              context=context)
         return {'type': 'ir.actions.act_window_close'}
 
@@ -159,9 +159,9 @@
             context = {}
         move_obj = self.pool.get('stock.move')
         move_ids = context['active_ids']
-        for data in self.read(cr, uid, ids):
+        for data in self.browse(cr, uid, ids):
             move_obj.action_scrap(cr, uid, move_ids,
-                             data['product_qty'], data['location_id'],
+                             data.product_qty, data.location_id.id,
                              context=context)
         return {'type': 'ir.actions.act_window_close'}
 


Follow ups