← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-psi2 into lp:~openerp-dev/openobject-addons/trunk-dev-addons3

 

Purnendu Singh (OpenERP) has proposed merging lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-psi2 into lp:~openerp-dev/openobject-addons/trunk-dev-addons3.

Requested reviews:
  OpenERP R&D Team (openerp-dev)
Related bugs:
  #568537 The __compute method of account_account needs optmization to improve Accounting Performance!
  https://bugs.launchpad.net/bugs/568537
  #588776 Error when closing fiscal year
  https://bugs.launchpad.net/bugs/588776
  #686508 Not able to validate sales receipt
  https://bugs.launchpad.net/bugs/686508
  #686513 Not able to validate supplier vouchers
  https://bugs.launchpad.net/bugs/686513
  #691218 add an employee to a department
  https://bugs.launchpad.net/bugs/691218
  #692139 Account Journal onchange_type method context undefined error
  https://bugs.launchpad.net/bugs/692139
  #692962 In hr contract, shouldn't be able to enter an end date lower than a start date
  https://bugs.launchpad.net/bugs/692962
  #693476 [6.0] sale manager dashboard - "Sales by Customer" - incomplete
  https://bugs.launchpad.net/bugs/693476
  #693810 [RC1]Pay button when you pay directly in Sales receipt form
  https://bugs.launchpad.net/bugs/693810
  #693833 [6.0] performance issues - stock_move, account_move_lines and others
  https://bugs.launchpad.net/bugs/693833
  #694937 [6.0] account entry analysis - unreconciled does not filter 
  https://bugs.launchpad.net/bugs/694937
  #695439 membership: can't open members via GTK client
  https://bugs.launchpad.net/bugs/695439
  #697080 Payment Invoice is not considering the currency in Invoice
  https://bugs.launchpad.net/bugs/697080
  #697207 Bug when sending followups without specifying any email address
  https://bugs.launchpad.net/bugs/697207
  #697714 Unclear warning on cancel opening entries
  https://bugs.launchpad.net/bugs/697714
  #699809 [6.0 and 5.0] Installing account_analytic_analysis you have a maximu of 2147 analytic accounts
  https://bugs.launchpad.net/bugs/699809
  #701895 [Trunk] account_analytic_plan  break the creation of inovice from analytic lines
  https://bugs.launchpad.net/bugs/701895
  #702027 [trunk]hr_payroll minor typos
  https://bugs.launchpad.net/bugs/702027
  #705043 Selection of multi-company products account in invoices lines
  https://bugs.launchpad.net/bugs/705043

For more details, see:
https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-dev-addons3-psi2/+merge/47375

Hello sir,

Fixes:
https://bugs.launchpad.net/openobject-addons/+bug/705043
Selection of multi-company products account in invoices lines

Thanks
PSI
-- 
https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-dev-addons3-psi2/+merge/47375
Your team OpenERP R&D Team is requested to review the proposed merge of lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-psi2 into lp:~openerp-dev/openobject-addons/trunk-dev-addons3.
=== modified file 'account/invoice.py'
--- account/invoice.py	2011-01-18 11:57:43 +0000
+++ account/invoice.py	2011-01-25 10:05:22 +0000
@@ -518,7 +518,7 @@
                                 if not result_id:
                                     raise osv.except_osv(_('Configuration Error !'),
                                         _('Can not find account chart for this company in invoice line account, Please Create account.'))
-                                inv_line_obj.write(cr, uid, [line.id], {'account_id': result_id[0]})
+                                inv_line_obj.write(cr, uid, [line.id], {'account_id': result_id[-1]})
             else:
                 if invoice_line:
                     for inv_line in invoice_line:
@@ -1313,7 +1313,6 @@
             exp_pro_id = property_obj.search(cr, uid, [('name','=','property_account_expense'),('res_id','=','product.template,'+str(res.product_tmpl_id.id)+''),('company_id','=',company_id)])
             if not exp_pro_id:
                 exp_pro_id = property_obj.search(cr, uid, [('name','=','property_account_expense_categ'),('res_id','=','product.template,'+str(res.categ_id.id)+''),('company_id','=',company_id)])
-
             if not in_pro_id:
                 in_acc = res.product_tmpl_id.property_account_income
                 in_acc_cate = res.categ_id.property_account_income_categ
@@ -1357,11 +1356,11 @@
                 in_obj_acc = account_obj.browse(cr, uid, in_res_id, context=context)
                 exp_obj_acc = account_obj.browse(cr, uid, exp_res_id, context=context)
                 if in_acc or ex_acc:
-                    res.product_tmpl_id.property_account_income = in_obj_acc[0]
-                    res.product_tmpl_id.property_account_expense = exp_obj_acc[0]
+                    res.product_tmpl_id.property_account_income = in_obj_acc[-1]
+                    res.product_tmpl_id.property_account_expense = exp_obj_acc[-1]
                 else:
-                    res.categ_id.property_account_income_categ = in_obj_acc[0]
-                    res.categ_id.property_account_expense_categ = exp_obj_acc[0]
+                    res.categ_id.property_account_income_categ = in_obj_acc[-1]
+                    res.categ_id.property_account_expense_categ = exp_obj_acc[-1]
 
         if type in ('out_invoice','out_refund'):
             a = res.product_tmpl_id.property_account_income.id


Follow ups