Git Product home page Git Product logo

Comments (5)

laetitia-gangloff avatar laetitia-gangloff commented on August 19, 2024

Hello,

I see that you have replaced some osv.except_osv by orm.except_orm in try except during your pep8 issue. I think it is not a good idea for the compatibility. Because in some case openerp raise osv.except_osv and not orm.except_orm.

Sorry to come too late :(

Stack trace sample:
File "/home/lga/openerp/addons-banking/account_statement_ext/statement.py", line 608, in get_period
periods = period_obj.find(cr, uid, dt=date, context=local_context)
File "/home/lga/openerp/addons/account/account.py", line 1027, in find
raise osv.except_osv(
('Error!'), _('There is no period defined for this date: %s.\nPlease create one.')%dt)
except_osv: (u'Error!', u'There is no period defined for this date: 2014-08-20.\nPlease create one.')

from account-reconcile.

bwrsandman avatar bwrsandman commented on August 19, 2024

Indeed, when catching, you must catch both except_orm and except_osv:

In [3]: try:
    raise osv.except_osv('', '')
except orm.except_orm:
    print('caught')
   ...:     
---------------------------------------------------------------------------
except_osv                                Traceback (most recent call last)
python_dev in <module>()
      1 try:
----> 2     raise osv.except_osv('', '')
      3 except orm.except_orm:
      4     print('caught')
      5 

except_osv: ('', '')

from account-reconcile.

pedrobaeza avatar pedrobaeza commented on August 19, 2024

You're right, Laetitia, although improbable, because all launch exceptions in the module are with orm.except_orm, but here it is the fix BTW: #38

from account-reconcile.

laetitia-gangloff avatar laetitia-gangloff commented on August 19, 2024

The stack trace sample come from a new installation. Maybe it is not the case for all try/except ;).
Thank you for the correction.

from account-reconcile.

bwrsandman avatar bwrsandman commented on August 19, 2024

PEP8 is clean on 7.0 so I will close this. Consider cleaning 6.1

from account-reconcile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.