← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 705043] Re: Selection of multi-company products account in invoices lines

 

Hello Mustafa,

I use Spanish charts. But, the tree account in my case and the default
income and expense accounts in category and product are corrects. My
problem is not there, is just when i change the product in invoice line
after changing the company in a multi-company enviroment, i reproduce it
when i change the default company with another i have created after
installation.

My steps are:

1. I create an invoice and change the default company with a new one
that i created after installation (Its accounting has been configured
correctly, i checked it)

2. I create an invoice line and select a product.

3. I check that the account that is selected by default with the product
is not the Regular one, is a View.

When I checked the code, I saw that in the block where the company_id is
been checked, the View and the Regular account are in in_obj_acc[0]
(View) in_obj_acc[1] (Regular). The same case in exp_obj_acc. What i saw
is the View account corresponds with Regular parent of the product
(category) account. What I don't know is if I can have a solution in
configuration without changing code and in that case how.

Thanks and regards

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/705043

Title:
  Selection of multi-company products account in invoices lines

Status in OpenERP Modules (addons):
  Confirmed

Bug description:
  version 6.0 on Ubuntu10.10 64bits

  When you change the product in invoice line selects a view account not
  the subaccount where movements are registered. This problem is in
  multi-company, not in the default company installed with openerp.
  Position [0] in in_obj_acc has the view id of the company account, in
  position [1] the correct subaccount.

  This code is in addons/account/invoice.py

  lines 1359 to 1364

  Actual code:

  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]
  else:
     res.categ_id.property_account_income_categ = in_obj_acc[0]
     res.categ_id.property_account_expense_categ = exp_obj_acc[0]

  Proposed code:

  if in_acc or ex_acc:
     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[1]
     res.categ_id.property_account_expense_categ = exp_obj_acc[1]





References