-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
[FIX][10.0][multi_company_abstract] Fix company_id computation issue (+ add unit test) #91
Conversation
42a00e8
to
82da91d
Compare
This seems similar to #86, isn't it? |
82da91d
to
e212e7e
Compare
@pedrobaeza Ah yes exactly same issue (so quite similar fix). Sorry, I didn't see it before |
No problem. Let's keep this one as better documented and with tests. |
base_multi_company/__manifest__.py
Outdated
@@ -1,12 +1,13 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't remove this in v10.
base_multi_company/__manifest__.py
Outdated
# Copyright 2017 LasLabs Inc. | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
{ | ||
'name': 'Multi Company Base', | ||
'summary': 'Provides a base for adding multi-company support to models.', | ||
'version': '10.0.1.0.1', | ||
'author': "LasLabs, Tecnativa, Odoo Community Association (OCA)", | ||
'author': "LasLabs, Tecnativa," | ||
"ACSONE SA/NV," |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch is not enough for granting you co-authorship. Put you in contributors in README instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok no problem. My internal check becomes red due to the coding utf-8 and because I didn't add my company into the module. I'll correct this in few minutes
867cc4b
to
e06a3e3
Compare
@pedrobaeza The test is red due to another module. Seems ok for you now? |
No, @acsonefho , Travis is failing due to this flake8 error in your changes:
|
[FIX] Fix issue based on the computation of company_id for multi_company_abstract models [FIX] Fix issue based on the computation of company_id for multi_company_abstract models [FIX] Fix issue based on the computation of company_id for multi_company_abstract models [FIX] Bad branch version pushed before [FIX] Bad branch version pushed before [FIX] manifest Fix flake Flake8 on OCA tests
e06a3e3
to
8c3f843
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review, very nice with tests too!
BSSBG-2615: Complete mrp.production labels
Steps to reproduce (actual) error:
product.template
inheritmulti.company.abstract
company_ids
company_ids
company_id
of the productcompany_id
of the product is the same than the current company, stay on the same product but switch your current company (top right button)company_id
of the product is not your actual company: you will have some issue (for example to use pricelist (price list set towithout_discount
asdiscount_policy
) onsale.order
because this model use theproduct.company_id.currency_id
=> BOOM,AccessError
exception because you don't have rights to read another company than the current one).Fix (this MR):
company_id
field of amulti.company.abstract
, give the priority to the company of the current user. If this company is not intocompany_ids
of the targeted model, pick the first company (actual behaviour)