← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 727939] Re: [6.1dev][account_voucher] Period not properly assigned in a multicompany environment

 

** Patch added: "Fixing period problem in a multicompany environment"
   https://bugs.launchpad.net/bugs/727939/+attachment/1881210/+files/account_voucher_020311.diff

-- 
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/727939

Title:
  [6.1dev][account_voucher] Period not properly assigned in a
  multicompany environment

Status in OpenERP Modules (addons):
  New

Bug description:
  Hi all, using addons revision 4033 from 2011-02-26, I get following
  errors using 'account_voucher' module:

  * In 'invoice.py' file, the 'period_id' field of the voucher is not being assigned by default when it's created from an invoice. This makes that when '_get_period' function (line ~42) in 'account_voucher.py' is called, it gets the first period of the table. This is obviously wrong in a multicompany environment, because this search is made with the root_uid and there may be multiple periods for different companies.
  * Because of previous error, in 'account_voucher.py' file, when a voucher is validated through 'action_move_line_create' function, at the moment the account_move object is generated (line ~660), the period associated to this move is obtained directly from the voucher, not checking the 'company_id' field, resulting in a wrong validation.

  I attach a path that solves these problems. Hope it will be useful.
  Regards,



References