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

[MIG] website_portal_contact: Migration to 12.0 #701

Closed
wants to merge 2 commits into from

Conversation

mathben
Copy link

@mathben mathben commented Mar 7, 2020

Related to #350

Since the pot has changed, what is there to do with all the traductions?

@mathben
Copy link
Author

mathben commented Mar 8, 2020

I tried to fix the test, but I cannot reproduce the error.
In my local dev, I have an error with test_crawl.
About the test_UI, I don't understand why the test passes on my local dev. Maybe, is it because I am using Odoo instead of OCB?
Thanks for you feedback.

@mathben
Copy link
Author

mathben commented Mar 8, 2020

Log of test_crawl

2020-03-08 18:39:43,266 12017 INFO runtest4 odoo.addons.website.tests.test_crawl: admin /my/contacts/yourcompany-marc-demo-7/disable?redirect=http%3A%2F%2F127.0.0.1%3A8069%2Fmy%2Fcontacts 
2020-03-08 18:39:43,296 12017 ERROR runtest4 odoo.addons.website.models.ir_http: 500 Internal Server Error:

Traceback (most recent call last):
  File "/home/mathben/git/odoo/odoo/odoo/addons/base/models/ir_http.py", line 203, in _dispatch
    result = request.dispatch()
  File "/home/mathben/git/odoo/odoo/odoo/http.py", line 835, in dispatch
    r = self._call_function(**self.params)
  File "/home/mathben/git/odoo/odoo/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/mathben/git/odoo/odoo/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/mathben/git/odoo/odoo/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/mathben/git/odoo/odoo/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/home/mathben/git/odoo/odoo/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/home/mathben/git/odoo/addons/website/website_portal_contact/controllers/main.py", line 206, in portal_my_contacts_disable
    contact.sudo().active = False
  File "/home/mathben/git/odoo/odoo/odoo/fields.py", line 1032, in __set__
    record.write({self.name: write_value})
  File "/home/mathben/git/odoo/odoo/addons/partner_autocomplete/models/res_partner.py", line 183, in write
    res = super(ResPartner, self).write(values)
  File "/home/mathben/git/odoo/odoo/odoo/addons/base/models/res_partner.py", line 546, in write
    raise ValidationError(_('You cannot archive a contact linked to an internal user.'))
odoo.exceptions.ValidationError: ('You cannot archive a contact linked to an internal user.', None)
 
2020-03-08 18:39:43,392 12017 INFO runtest4 werkzeug: 127.0.0.1 - - [08/Mar/2020 18:39:43] "GET /my/contacts/yourcompany-marc-demo-7/disable?redirect=http%3A%2F%2F127.0.0.1%3A8069%2Fmy%2Fcontacts HTTP/1.1" 500 - 46 0.023 0.100
2020-03-08 18:39:43,396 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: FAIL 
2020-03-08 18:39:43,401 12017 INFO runtest4 odoo.addons.website.tests.test_crawl: ====================================================================== 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: FAIL: test_30_crawl_admin (odoo.addons.website.tests.test_crawl.Crawler) 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: Traceback (most recent call last): 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: `   File "/home/mathben/git/odoo/odoo/addons/website/tests/test_crawl.py", line 87, in test_30_crawl_admin 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: `     seen = self.crawl('/', msg='admin') 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: `   File "/home/mathben/git/odoo/odoo/addons/website/tests/test_crawl.py", line 61, in crawl 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: `     self.crawl(href, seen, msg) 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: `   File "/home/mathben/git/odoo/odoo/addons/website/tests/test_crawl.py", line 61, in crawl 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: `     self.crawl(href, seen, msg) 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: `   File "/home/mathben/git/odoo/odoo/addons/website/tests/test_crawl.py", line 61, in crawl 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: `     self.crawl(href, seen, msg) 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: `   [Previous line repeated 5 more times] 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: `   File "/home/mathben/git/odoo/odoo/addons/website/tests/test_crawl.py", line 41, in crawl 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: `     self.assertIn(code, range(200, 300), "%s Fetching %s returned error response (%d)" % (msg, url, code)) 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: ` AssertionError: 500 not found in range(200, 300) : admin Fetching /my/contacts/yourcompany-marc-demo-7/disable?redirect=http%3A%2F%2F127.0.0.1%3A8069%2Fmy%2Fcontacts returned error response (500) 
2020-03-08 18:39:43,402 12017 INFO runtest4 odoo.addons.website.tests.test_crawl: Ran 3 tests in 19.456s 
2020-03-08 18:39:43,402 12017 ERROR runtest4 odoo.addons.website.tests.test_crawl: FAILED 
2020-03-08 18:39:43,402 12017 INFO runtest4 odoo.addons.website.tests.test_crawl:  (failures=1) 
2020-03-08 18:39:43,403 12017 INFO runtest4 odoo.modules.module: odoo.addons.website.tests.test_crawl tested in 19.46s, 5840 queries 
2020-03-08 18:39:43,403 12017 ERROR runtest4 odoo.modules.module: Module website: 1 failures, 0 errors 

@mathben mathben force-pushed the 12.0-mig-website_portal_contact branch from 56fa69f to ab71273 Compare March 8, 2020 20:54
@mathben
Copy link
Author

mathben commented Mar 8, 2020

I fixed the test :D

@Tardo
Copy link
Member

Tardo commented May 18, 2020

@mathben
Copy link
Author

mathben commented Aug 6, 2020

Hi @Tardo , I would like to understand how to preserve commit history, in the context I use the script https://github.com/grap/odoo-module-migrator and this generate 1, 2 and 3. The commits 4 update code with deprecated function from Odoo 10, 5 with translation, and 6 with fix.
Do you ask me to merge 1, 2 and 3, or merge all commits in 1?

  1. [MIG] website_portal_contact from Odoo 9
  2. [REF] website_portal_contact: Black python code
  3. [MIG] website_portal_contact: Migration to 12.0
  4. [MIG] website_portal_contact: replace website_portal_v10 by portal
  5. [ADD] website_portal_contact: translate fr_CA.po, fr.po and pot
  6. [FIX] website_portal_contact: don't set parent_id with the same partner_id
    Thanks for your feedback.

@pedrobaeza
Copy link
Member

@mathben mathben force-pushed the 12.0-mig-website_portal_contact branch from ab71273 to 3f5602a Compare August 6, 2020 08:01
@mathben
Copy link
Author

mathben commented Aug 6, 2020

"You may just want to merge all these commits into a single one, and provide a nice summary of the changes that the commit introduces."
Ok, done :-)

@pedrobaeza
Copy link
Member

I think you're not interpreting correctly the instructions. There must be the commits for each of the past contributors of the module, not only one.

@mathben mathben force-pushed the 12.0-mig-website_portal_contact branch from 3f5602a to 7135fac Compare August 6, 2020 08:33
@mathben
Copy link
Author

mathben commented Aug 6, 2020

Done, thanks for your precious time and your help for the community.
I keep the author of the module, Jairo Llopis, and add a second commit with my modification.

Jairo Llopis and others added 2 commits August 6, 2020 05:25
- Replace website_portal_v10 by portal
- Fix menu, breadcumb and contact_count
- Adapt test with tour
- Translate fr_CA.po, fr.po and pot
- Fix parent_id with the same partner_id
@mathben mathben force-pushed the 12.0-mig-website_portal_contact branch from 7135fac to a8bf245 Compare August 6, 2020 09:25
Copy link

@HaraldPanten HaraldPanten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, please try this:

1- I create a portal user and I give him portal access.
2- Log in with that portal user.
3- Go to my account --> contacts and try to create a contact.
4- Once you try to save, you'll see a forbidden error.

Could you check?

Copy link
Contributor

@claudiagn claudiagn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same error pops up!
@HaraldPanten

@HaraldPanten
Copy link

Same error pops up!
@HaraldPanten

Yep, no changes since the last push.

@mathben will you continue with this PR?

@mathben
Copy link
Author

mathben commented Mar 30, 2021

It's on hold for now. Thanks for your involvement.

@llabusch93
Copy link

Okay so how does this work now. If @mathben does not work on this anymore, can I take his branch and continue with it to complete the PR?

Thanks for the clarification.

@mathben
Copy link
Author

mathben commented Jun 23, 2021

PR closed, continued in #840

@mathben mathben closed this Jun 23, 2021
@mathben
Copy link
Author

mathben commented Jul 21, 2022

Merge done by #882

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

Successfully merging this pull request may close these issues.

6 participants