← Back to team overview

credativ team mailing list archive

[Bug 1111298] Re: [Trunk/7.0] can not validate invoice in multi-company

 

Hello,

Please try to read the name of the currency from the invoice like this:
inv.company_id.name. The problem is still there!

I think the fix does not address the main issue of this bug, which was
described very precisely in the comment #7 by Nicolas Bessi. For me,
it's not what described in the comment #6 that triggers the error in the
cache function. The main issue here is at the way that ORM is handling
the caching function.

After applying the fix, I still get an error why trying to call
inv.company_id.name.

Take a look at the fix, which was proposed in the comment #8.

I agree with the first two points, which are adding a record rule for
res.currency and updating company_id to False for all currencies, to
make res.currency being handled consistently with the rest of the
system. However, this bug will never gone without taking into account
the third point, which is just a workaround for this specific case.

Correct me if I'm wrong!

Regards,

-- 
You received this bug notification because you are a member of
OpenUpgrade Committers, which is subscribed to OpenUpgrade Server.
https://bugs.launchpad.net/bugs/1111298

Title:
  [Trunk/7.0] can not validate invoice in multi-company

Status in OpenERP Addons (modules):
  Fix Released
Status in OpenERP Server:
  Fix Released
Status in OpenUpgrade Server:
  Fix Committed
Status in OpenUpgrade Server 7.0 series:
  Fix Committed

Bug description:
  Hello,

  When I tried to validate an invoice in multi company mode I have an
  exception "Can not read company".

  The exception is risen by this line:
  company_currency = inv.company_id.currency_id.id in account_invoice.py => action_move_create

  The mutli company setting are correct  (It will be proven below) but
  what is strange is that in pdb:

  pp inv.company_id
    browse_record(res.company, 3)

  It is ok but:

  pp inv.company_id.name
  2013-01-31 09:57:31,983 8617 WARNING None openerp.osv.orm: Access Denied by record rules for operation: read, uid: 5, model: res.company ..

  It raise exception.

  More fun :

  pp self.pool['res.company'].browse(cr, uid, 3).currency_id.name
    u'EUR'

  No exception…

  This one is tricky isnt'it ?

  Regards

  Nicolas

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1111298/+subscriptions