Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.0] web_pytz: prevents from connecting to instance #141

Closed
gurneyalex opened this issue Jun 1, 2015 · 19 comments
Closed

[7.0] web_pytz: prevents from connecting to instance #141

gurneyalex opened this issue Jun 1, 2015 · 19 comments
Assignees

Comments

@gurneyalex
Copy link
Member

When this addon is installed, the instance becomes unusable.

TypeError: moment.tz is undefined
tz = moment.tz.zone(args.tz_name.toJSON()),

this is from web_pytz.js (line 55, col 12)

@gurneyalex
Copy link
Member Author

@hbrunn if you have any idea what is amiss your advice is welcome.

@hbrunn
Copy link
Member

hbrunn commented Jun 1, 2015

I'd start with verifying that static/lib/moment-timezone.min.js is loaded

@OSguard
Copy link

OSguard commented Jun 1, 2015

i just figure out that this is the reason why runbot not working:
http://2947807-7-0-5b1147.runbot2.odoo-community.org/?db=2947807-7-0-5b1147-all&debug=

@OSguard
Copy link

OSguard commented Jun 1, 2015

after installing web_list_html_widget together with web_pytz it fails, i will validate this with a new database

@OSguard
Copy link

OSguard commented Jun 1, 2015

now the error hits after installing "web_nocreatedb" Oo

@OSguard
Copy link

OSguard commented Jun 1, 2015

you need to install this 13 modules to reproduce the error:
name | author
-----------------------------+------------------------------------------------------------------------
web_m2x_options | Tuxservices,Odoo Community Association (OCA)
web_list_html_widget | initOS GmbH & Co. KG,Odoo Community Association (OCA)
web_recipients_uncheck | initOS GmbH & Co. KG,Odoo Community Association (OCA)
web_search_alphabetic | Serpent Consulting Services Pvt. Ltd.,Odoo Community Association (OCA)
web_pytz | Therp BV,Odoo Community Association (OCA)
web_popup_large | Therp BV,Odoo Community Association (OCA)
web_tree_many2one_clickable | Therp BV,Odoo Community Association (OCA)
web_polymorphic_many2one | Elico Corp,Odoo Community Association (OCA)
web_send_message_popup | Camptocamp,Odoo Community Association (OCA)
web_relativedelta | Therp BV,Odoo Community Association (OCA)
web_widget_float_formula | GRAP,Odoo Community Association (OCA)
web_warning_sound | HacBee UAB,Odoo Community Association (OCA)
web_nocreatedb | Vauxoo,Odoo Community Association (OCA)

@hbrunn
Copy link
Member

hbrunn commented Jun 1, 2015

@OSguard any chance web_relativedelta is the culprit? This also pulls moment.js, but in an older version (2.6.0 vs. 2.8.3). The first who loads wins, and it seems like that's the case for the 2.6.0 version. Maybe moment-timezone.js refuses to load with this version?

It should not be a problem to simply update web_relativedelta's moment.js For a quick and dirty test, I'd simply copy web_pytz's moment.js to web_relativedelta/static/lib, reload and see what happens.

It might be even worth a try to update both modules to current upstream from http://momentjs.com

@hbrunn
Copy link
Member

hbrunn commented Jun 1, 2015

...if you do the update, don't repeat my mistake and use the non-minified versions. OpenERP minifies them anyways, and this way, you save a lot of headaches when debugging

@OSguard
Copy link

OSguard commented Jun 1, 2015

only installing both modules are fine. Having all other modules install always failing. So this was also my first idea but i find no evidence for that. But i can try to replace it in my broken installation. (but not today)

@hbrunn
Copy link
Member

hbrunn commented Jun 1, 2015

have a look at load order. On the runbot you linked, web_pytz's momentjs is loaded first and then probably overwritten by web_relativedelta's version. If on your isolated database this order is reversed, then things should be fine. So the trick is for your test to manipulate load order to test both cases.

@hbrunn
Copy link
Member

hbrunn commented Jun 1, 2015

Of course not today, now you code sprinters should go for the well deserved belgian beers!

@hbrunn
Copy link
Member

hbrunn commented Jun 1, 2015

another hypothesis: The lib-mechanism should avoid loading the same library multiple times, and to my knowledge, this goes by filename. But here, one is called moment.min.js while the other is moment.js, possibly this screws up things? Try changing the min-version to just moment.js and see if odoo still loads both. If everything works then, you might still give the update a try in order to avoid future version incompatibilities.

@OSguard
Copy link

OSguard commented Jun 2, 2015

  • rename to moment.js loads both with the same name and error still there
  • replacing the older version with '2.8.3' also did not solve the problem.

@OSguard
Copy link

OSguard commented Jun 2, 2015

removing one moment.js from one of the modules solves the problem.
I suggest either:

  • merge the two modules in one
  • make a single module with only holds the lib for moments.js

@hbrunn and @gurneyalex what do you think?

@hbrunn
Copy link
Member

hbrunn commented Jun 2, 2015

depending both on a module web_moment seems the proper choice then in my opinion.

@OSguard
Copy link

OSguard commented Jun 2, 2015

@hbrunn can you do this, as you are more familiar with this modules?

@hbrunn
Copy link
Member

hbrunn commented Jun 2, 2015

yes, but not before end of this week

@hbrunn hbrunn assigned hbrunn and unassigned OSguard Jun 2, 2015
hbrunn added a commit to hbrunn/web that referenced this issue Jun 3, 2015
web_relativedelta to coexist by adding moment.js in its own module.

Fixes OCA#141
@hbrunn
Copy link
Member

hbrunn commented Jun 3, 2015

@OSguard @gurneyalex I proposed a fix in #142

@hbrunn
Copy link
Member

hbrunn commented Jun 9, 2015

closed as of #142

@hbrunn hbrunn closed this as completed Jun 9, 2015
BT-fgarbely pushed a commit to BT-fgarbely/web that referenced this issue Apr 3, 2018
Syncing from upstream OCA/web (10.0)
gfcapalbo pushed a commit to gfcapalbo/web that referenced this issue Apr 30, 2018
web_relativedelta to coexist by adding moment.js in its own module.

Fixes OCA#141
leemannd pushed a commit to camptocamp/web that referenced this issue May 29, 2018
DT-84: Fix generate payment mode wizard
vrenaville pushed a commit to camptocamp/web that referenced this issue Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants