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

[9.0][MIG][website_portal_purchase_product] Migration of website_product_supplier #211

Closed

Conversation

yajo
Copy link
Member

@yajo yajo commented Jun 13, 2016

Module has been renamed from website_product_supplier to website_portal_purchase_product, which follows better the guidelines.

Many code has changed to make it compatible with the backported website_portal_v10 collection.

Complete refactor of module.

  • It now uses the supplier flag on user's commercial partner to grant access to features.
  • No controllers use sudo(), but ACLs and record access rules.
  • JavaScript and CSS are simplified or directly removed.
  • Controllers now are product.template-oriented, not product.supplierinfo-oriented.
  • ... although product.supplierinfo is still used for record access rules.
  • Based completely on website_portal_v10.
  • Views are better split in files.
  • Benefit of new website_form module for Odoo v9.
  • LGPL, with original author's consent.

WIP until these are merged:

@Tecnativa

@yajo yajo force-pushed the 9.0-website_portal_purchase_product-migration branch 4 times, most recently from 63b0f29 to 0bb75bb Compare June 15, 2016 09:11
@@ -6,3 +6,4 @@ access_product_supplierinfo,Access product supplier info,product.model_product_s
access_stock_warehouse,Access warehouse,stock.model_stock_warehouse,base.group_portal,1,0,0,0
access_stock_location,Access location,stock.model_stock_location,base.group_portal,1,0,0,0
access_stock_quant,Access quant,stock.model_stock_quant,base.group_portal,1,0,0,0
access_ir_translation,Access translations,base.model_ir_translation,base.group_portal,1,1,1,1
Copy link
Member

Choose a reason for hiding this comment

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

Better to make it with rules.

@yajo yajo force-pushed the 9.0-website_portal_purchase_product-migration branch from 4e2709e to 38580b9 Compare July 13, 2016 10:24
@rafaelbn rafaelbn added this to the 9.0 milestone Jul 21, 2016
@yajo yajo force-pushed the 9.0-website_portal_purchase_product-migration branch 2 times, most recently from 175cffa to 8e74e9a Compare August 16, 2016 07:53
@yajo yajo force-pushed the 9.0-website_portal_purchase_product-migration branch from 77f056d to 74e2f5c Compare October 18, 2016 10:08
@yajo
Copy link
Member Author

yajo commented Oct 18, 2016

Dependencies are merged, rebased, please someone tag as ready to review.

@yajo
Copy link
Member Author

yajo commented Oct 18, 2016

@rafaelbn please comment on PR, not on commits. Your requests were already addressed.

@rafaelbn
Copy link
Member

Rebuilding for testing, this PR is ready @yajo @sergio-teruel

@yajo
Copy link
Member Author

yajo commented Dec 16, 2016

It's waiting approvals

@rafaelbn
Copy link
Member

Please @yajo try to test it in runbot, I get:
2016-12-16_12-17-57

@yajo yajo force-pushed the 9.0-website_portal_purchase_product-migration branch from 7b4426f to 69f240b Compare December 16, 2016 11:35
@yajo
Copy link
Member Author

yajo commented Dec 16, 2016

That's because no sass is available in runbot, I rebased to see if it gets fixed.

@pedrobaeza
Copy link
Member

FYI, we fixed it some time ago. Rebasing should be enough.

@yajo
Copy link
Member Author

yajo commented Dec 19, 2016

Travis hits #296

@yajo yajo force-pushed the 9.0-website_portal_purchase_product-migration branch from 69f240b to 7da4c41 Compare December 19, 2016 11:09
@yajo
Copy link
Member Author

yajo commented Dec 19, 2016

Travis should go ✔️ now.

@pedrobaeza
Copy link
Member

You can take the occasion to squash a bit the commits.

@yajo
Copy link
Member Author

yajo commented Dec 19, 2016

Seems like the tour is broken now, I'll try fix; and squash when it goes ✔️

@yajo
Copy link
Member Author

yajo commented Dec 20, 2016

Weird, if you create a demo user for the tour using the strategy outlined in odoo/odoo#13902, you cannot use it as the tour's login, because test fails with:

Traceback (most recent call last):
`   File "/home/travis/build/OCA/website/website_portal_purchase_product/tests/test_ui.py", line 35, in test_ui_website_portal_product_manager
`     login="tourman")
`   File "/home/travis/odoo-9.0/openerp/tests/common.py", line 437, in phantom_js
`     self.authenticate(login, login)
`   File "/home/travis/odoo-9.0/openerp/tests/common.py", line 295, in authenticate
`     session.context = Users.context_get(self.cr, uid) or {}
`   File "/home/travis/odoo-9.0/openerp/api.py", line 250, in wrapper
`     return old_api(self, *args, **kwargs)
`   File "<decorator-gen-21>", line 2, in context_get
`   File "/home/travis/odoo-9.0/openerp/tools/cache.py", line 85, in lookup
`     value = d[key] = self.method(*args, **kwargs)
`   File "/home/travis/odoo-9.0/openerp/addons/base/res/res_users.py", line 428, in context_get
`     res = getattr(user, k) or False
`   File "/home/travis/odoo-9.0/openerp/fields.py", line 836, in __get__
`     return record._cache[self]
`   File "/home/travis/odoo-9.0/openerp/models.py", line 6141, in __getitem__
`     return value.get() if isinstance(value, SpecialValue) else value
`   File "/home/travis/odoo-9.0/openerp/fields.py", line 39, in get
`     raise self.exception
` MissingError: ('Record does not exist or has been deleted.', None)

So I opened odoo/odoo#14777 to see if in the future we can have the portal user everywhere, and falled back to changing permisions of demo user for now. Let's see if that works.

@rafaelbn
Copy link
Member

rafaelbn commented Jun 9, 2017

Please @yajo could you review travis?

@pedrobaeza
Copy link
Member

Closing this due to no continuation in the project. If somebody has interest on it, he/she can open another PR taking this work.

@pedrobaeza pedrobaeza closed this Feb 22, 2018
@yajo yajo deleted the 9.0-website_portal_purchase_product-migration branch April 1, 2019 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants