← Back to team overview

c2c-oerpscenario team mailing list archive

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

 

Hello Mustafa,

The problem is not in Product Category or Product, I mean, I have by
default correct accounts in both, this accounts are owned by the default
company (Company A) that was created in the OpenERP installation. Now,
in the invoice form, I create an invoice ant sets it to another company
(Company B) different to the default company (Company A). After that I
cretate an invoice line, select a product and the account is select
automatically. The account selected is not the default one that we set
in the Category or Product because is a different company, that is
completly logical because i need the account of the new company. But the
account that appears is the View one not the Regular (not in the select
list, just in the field automatically). When I checked the values of the
variables that i mentioned above, and the system was selecting the View
ID value not the Regular ID of the account. The position [0] of the
variables corresponds with the View ID account and [1] with the Regular
one.

Something really important is that you can't reproduce it with the
company that is created by default at the installation process of the
database, we need a new company independent from the first activating
with it the multi-company. That piece of code i wrote above to change is
inside the conditional check of company_id.

Thanks

-- 
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):
  Incomplete

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