-
Notifications
You must be signed in to change notification settings - Fork 23k
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
[FW][FIX] product: allow products to be used by branches #165307
Closed
fw-bot
wants to merge
1
commit into
odoo:master
from
odoo-dev:master-17.0-opw-3815736-stock_product_branch-taqu-x7nO-fw
Closed
[FW][FIX] product: allow products to be used by branches #165307
fw-bot
wants to merge
1
commit into
odoo:master
from
odoo-dev:master-17.0-opw-3815736-stock_product_branch-taqu-x7nO-fw
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Steps ----- 1. Have inventory installed. 2. Have a product belonging to a company with a branch. 3. Create a SO with this branch and add the product to it. 4. Confirm the SO. ** Invalid Operation : incompatible companies on records ** Issue ----- While it is possible to add a product from a parent company to a SO, we get an error when confirming the SO and creating the move because of https://github.com/odoo/odoo/blob/1b0dbb3645ad8b52c5260f1cbbc4f6bdee48461e/addons/stock/models/stock_move.py#L1358 As the product_id field of stock.move has check_company=True, we have an inconsistency because we are using the default domain of _check_company_domain which is just the company itself. https://github.com/odoo/odoo/blob/3c7db87ade7e99eafb44228bd038fa39429fdabc/odoo/models.py#L3999-L4007 Fix ----- We provide a new _check_company_domain to product.product and product.template 0479b2b made changes to allow products to be used by branches, in particular this security rule: https://github.com/odoo/odoo/blob/5a801bc60209713a3ba5313debb4daa05c4e2405/addons/product/security/product_security.xml#L34-L38 opw-3815736 X-original-commit: 70bf644
@taqu-odoo @william-andre this PR targets master and is the last of the forward-port chain. To merge the full chain, use
More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
@fw-bot r+ |
robodoo
pushed a commit
that referenced
this pull request
May 13, 2024
Steps ----- 1. Have inventory installed. 2. Have a product belonging to a company with a branch. 3. Create a SO with this branch and add the product to it. 4. Confirm the SO. ** Invalid Operation : incompatible companies on records ** Issue ----- While it is possible to add a product from a parent company to a SO, we get an error when confirming the SO and creating the move because of https://github.com/odoo/odoo/blob/1b0dbb3645ad8b52c5260f1cbbc4f6bdee48461e/addons/stock/models/stock_move.py#L1358 As the product_id field of stock.move has check_company=True, we have an inconsistency because we are using the default domain of _check_company_domain which is just the company itself. https://github.com/odoo/odoo/blob/3c7db87ade7e99eafb44228bd038fa39429fdabc/odoo/models.py#L3999-L4007 Fix ----- We provide a new _check_company_domain to product.product and product.template 0479b2b made changes to allow products to be used by branches, in particular this security rule: https://github.com/odoo/odoo/blob/5a801bc60209713a3ba5313debb4daa05c4e2405/addons/product/security/product_security.xml#L34-L38 opw-3815736 closes #165307 X-original-commit: 70bf644 Signed-off-by: William André (wan) <wan@odoo.com>
robodoo
pushed a commit
that referenced
this pull request
May 13, 2024
Steps ----- 1. Have inventory installed. 2. Have a product belonging to a company with a branch. 3. Create a SO with this branch and add the product to it. 4. Confirm the SO. ** Invalid Operation : incompatible companies on records ** Issue ----- While it is possible to add a product from a parent company to a SO, we get an error when confirming the SO and creating the move because of https://github.com/odoo/odoo/blob/1b0dbb3645ad8b52c5260f1cbbc4f6bdee48461e/addons/stock/models/stock_move.py#L1358 As the product_id field of stock.move has check_company=True, we have an inconsistency because we are using the default domain of _check_company_domain which is just the company itself. https://github.com/odoo/odoo/blob/3c7db87ade7e99eafb44228bd038fa39429fdabc/odoo/models.py#L3999-L4007 Fix ----- We provide a new _check_company_domain to product.product and product.template 0479b2b made changes to allow products to be used by branches, in particular this security rule: https://github.com/odoo/odoo/blob/5a801bc60209713a3ba5313debb4daa05c4e2405/addons/product/security/product_security.xml#L34-L38 opw-3815736 closes #165307 X-original-commit: 70bf644 Signed-off-by: William André (wan) <wan@odoo.com>
robodoo
pushed a commit
that referenced
this pull request
May 14, 2024
Steps ----- 1. Have inventory installed. 2. Have a product belonging to a company with a branch. 3. Create a SO with this branch and add the product to it. 4. Confirm the SO. ** Invalid Operation : incompatible companies on records ** Issue ----- While it is possible to add a product from a parent company to a SO, we get an error when confirming the SO and creating the move because of https://github.com/odoo/odoo/blob/1b0dbb3645ad8b52c5260f1cbbc4f6bdee48461e/addons/stock/models/stock_move.py#L1358 As the product_id field of stock.move has check_company=True, we have an inconsistency because we are using the default domain of _check_company_domain which is just the company itself. https://github.com/odoo/odoo/blob/3c7db87ade7e99eafb44228bd038fa39429fdabc/odoo/models.py#L3999-L4007 Fix ----- We provide a new _check_company_domain to product.product and product.template 0479b2b made changes to allow products to be used by branches, in particular this security rule: https://github.com/odoo/odoo/blob/5a801bc60209713a3ba5313debb4daa05c4e2405/addons/product/security/product_security.xml#L34-L38 opw-3815736 closes #165307 X-original-commit: 70bf644 Signed-off-by: William André (wan) <wan@odoo.com>
zel-odoo
pushed a commit
to odoo-dev/odoo
that referenced
this pull request
May 24, 2024
Steps ----- 1. Have inventory installed. 2. Have a product belonging to a company with a branch. 3. Create a SO with this branch and add the product to it. 4. Confirm the SO. ** Invalid Operation : incompatible companies on records ** Issue ----- While it is possible to add a product from a parent company to a SO, we get an error when confirming the SO and creating the move because of https://github.com/odoo/odoo/blob/1b0dbb3645ad8b52c5260f1cbbc4f6bdee48461e/addons/stock/models/stock_move.py#L1358 As the product_id field of stock.move has check_company=True, we have an inconsistency because we are using the default domain of _check_company_domain which is just the company itself. https://github.com/odoo/odoo/blob/3c7db87ade7e99eafb44228bd038fa39429fdabc/odoo/models.py#L3999-L4007 Fix ----- We provide a new _check_company_domain to product.product and product.template 0479b2b made changes to allow products to be used by branches, in particular this security rule: https://github.com/odoo/odoo/blob/5a801bc60209713a3ba5313debb4daa05c4e2405/addons/product/security/product_security.xml#L34-L38 opw-3815736 closes odoo#165307 X-original-commit: 70bf644 Signed-off-by: William André (wan) <wan@odoo.com>
fw-bot
deleted the
master-17.0-opw-3815736-stock_product_branch-taqu-x7nO-fw
branch
May 28, 2024 02:46
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
17.3
forwardport
This PR was created by @fw-bot
OE
the report is linked to a support ticket (opw-...)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Steps
** Invalid Operation : incompatible companies on records **
Issue
While it is possible to add a product from a parent company to
a SO, we get an error when confirming the SO and creating the move because
of
odoo/addons/stock/models/stock_move.py
Line 1358 in 1b0dbb3
As the product_id field of stock.move has check_company=True, we have
an inconsistency because we are using the default domain of
_check_company_domain which is just the company itself.
odoo/odoo/models.py
Lines 3999 to 4007 in 3c7db87
Fix
We provide a new _check_company_domain to product.product.
0479b2b made changes to allow products
to be used by branches, in particular this security rule:
odoo/addons/product/security/product_security.xml
Lines 34 to 38 in 5a801bc
opw-3815736
Forward-Port-Of: #165228
Forward-Port-Of: #160899