[FIX] purchase_stock: vendor choice in multi-company#51596
Closed
[FIX] purchase_stock: vendor choice in multi-company#51596
Conversation
nim-odoo
approved these changes
May 20, 2020
Contributor
nim-odoo
left a comment
There was a problem hiding this comment.
robodoo delegate+
ok but add a bit more info on the cause of the issue.
- Set two companies (A and B); - Set intercompany flows enabled between company A and B with synchronization of PO/SO; - create a product X is configured as follows in company B: - Storable product; - Routes “Buy” and “Dropship”; - Vendors price list set with vendor = company A. - Product X is configured as follows in company A: - Storable product; - Reordering rule Min 0 / Max 0; - Route “Buy”; - Vendors price list set with vendor = 'External Vendor'. - Create and validate a sale order for product X to final customer within company B; Odoo will automatically create a purchase order for product X to company A within company B; - Validate the purchase order in company B; Odoo will automatically create a sale order for product X to company B within company A; - If there is no available stock in warehouse A; Odoo will automatically create a purchase order for product X within company A. Before this commit, the purchase order is created with vendor as 'Company A'. As '_select_seller' is run in sudo mode (see: https://github.com/odoo/odoo/blob/a16c4a0dabe58ab2cfade353c113387ae5bcd572/addons/stock/models/stock_rule.py#L458), so is not company-aware, therefore the first matching supplier is chosen. Now, the purchase order will be created with vendor as 'External Vendor'. opw-2255989
bb112e3 to
7dee21a
Compare
Contributor
Author
|
robodoo r+ |
jpp-odoo
added a commit
to odoo-dev/odoo
that referenced
this pull request
May 26, 2020
- Set two companies (A and B); - Set intercompany flows enabled between company A and B with synchronization of PO/SO; - create a product X is configured as follows in company B: - Storable product; - Routes “Buy” and “Dropship”; - Vendors price list set with vendor = company A. - Product X is configured as follows in company A: - Storable product; - Reordering rule Min 0 / Max 0; - Route “Buy”; - Vendors price list set with vendor = 'External Vendor'. - Create and validate a sale order for product X to final customer within company B; Odoo will automatically create a purchase order for product X to company A within company B; - Validate the purchase order in company B; Odoo will automatically create a sale order for product X to company B within company A; - If there is no available stock in warehouse A; Odoo will automatically create a purchase order for product X within company A. Before this commit, the purchase order is created with vendor as 'Company A'. As '_select_seller' is run in sudo mode (see: https://github.com/odoo/odoo/blob/a16c4a0dabe58ab2cfade353c113387ae5bcd572/addons/stock/models/stock_rule.py#L458), so is not company-aware, therefore the first matching supplier is chosen. Now, the purchase order will be created with vendor as 'External Vendor'. opw-2255989 closes odoo#51596 Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
robodoo
pushed a commit
that referenced
this pull request
May 26, 2020
- Set two companies (A and B); - Set intercompany flows enabled between company A and B with synchronization of PO/SO; - create a product X is configured as follows in company B: - Storable product; - Routes “Buy” and “Dropship”; - Vendors price list set with vendor = company A. - Product X is configured as follows in company A: - Storable product; - Reordering rule Min 0 / Max 0; - Route “Buy”; - Vendors price list set with vendor = 'External Vendor'. - Create and validate a sale order for product X to final customer within company B; Odoo will automatically create a purchase order for product X to company A within company B; - Validate the purchase order in company B; Odoo will automatically create a sale order for product X to company B within company A; - If there is no available stock in warehouse A; Odoo will automatically create a purchase order for product X within company A. Before this commit, the purchase order is created with vendor as 'Company A'. As '_select_seller' is run in sudo mode (see: https://github.com/odoo/odoo/blob/a16c4a0dabe58ab2cfade353c113387ae5bcd572/addons/stock/models/stock_rule.py#L458), so is not company-aware, therefore the first matching supplier is chosen. Now, the purchase order will be created with vendor as 'External Vendor'. opw-2255989 closes #51596 closes #51866 Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
jpp-odoo
added a commit
to odoo-dev/odoo
that referenced
this pull request
May 26, 2020
- Set two companies (A and B); - Set intercompany flows enabled between company A and B with synchronization of PO/SO; - create a product X is configured as follows in company B: - Storable product; - Routes “Buy” and “Dropship”; - Vendors price list set with vendor = company A. - Product X is configured as follows in company A: - Storable product; - Reordering rule Min 0 / Max 0; - Route “Buy”; - Vendors price list set with vendor = 'External Vendor'. - Create and validate a sale order for product X to final customer within company B; Odoo will automatically create a purchase order for product X to company A within company B; - Validate the purchase order in company B; Odoo will automatically create a sale order for product X to company B within company A; - If there is no available stock in warehouse A; Odoo will automatically create a purchase order for product X within company A. Before this commit, the purchase order is created with vendor as 'Company A'. As '_select_seller' is run in sudo mode (see: https://github.com/odoo/odoo/blob/a16c4a0dabe58ab2cfade353c113387ae5bcd572/addons/stock/models/stock_rule.py#L458), so is not company-aware, therefore the first matching supplier is chosen. Now, the purchase order will be created with vendor as 'External Vendor'. opw-2255989 closes odoo#51596 Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com> X-original-commit: 6df1e0e
robodoo
pushed a commit
that referenced
this pull request
May 26, 2020
- Set two companies (A and B); - Set intercompany flows enabled between company A and B with synchronization of PO/SO; - create a product X is configured as follows in company B: - Storable product; - Routes “Buy” and “Dropship”; - Vendors price list set with vendor = company A. - Product X is configured as follows in company A: - Storable product; - Reordering rule Min 0 / Max 0; - Route “Buy”; - Vendors price list set with vendor = 'External Vendor'. - Create and validate a sale order for product X to final customer within company B; Odoo will automatically create a purchase order for product X to company A within company B; - Validate the purchase order in company B; Odoo will automatically create a sale order for product X to company B within company A; - If there is no available stock in warehouse A; Odoo will automatically create a purchase order for product X within company A. Before this commit, the purchase order is created with vendor as 'Company A'. As '_select_seller' is run in sudo mode (see: https://github.com/odoo/odoo/blob/a16c4a0dabe58ab2cfade353c113387ae5bcd572/addons/stock/models/stock_rule.py#L458), so is not company-aware, therefore the first matching supplier is chosen. Now, the purchase order will be created with vendor as 'External Vendor'. opw-2255989 closes #51596 closes #51886 X-original-commit: 6df1e0e Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
fw-bot
pushed a commit
to odoo-dev/odoo
that referenced
this pull request
May 26, 2020
- Set two companies (A and B); - Set intercompany flows enabled between company A and B with synchronization of PO/SO; - create a product X is configured as follows in company B: - Storable product; - Routes “Buy” and “Dropship”; - Vendors price list set with vendor = company A. - Product X is configured as follows in company A: - Storable product; - Reordering rule Min 0 / Max 0; - Route “Buy”; - Vendors price list set with vendor = 'External Vendor'. - Create and validate a sale order for product X to final customer within company B; Odoo will automatically create a purchase order for product X to company A within company B; - Validate the purchase order in company B; Odoo will automatically create a sale order for product X to company B within company A; - If there is no available stock in warehouse A; Odoo will automatically create a purchase order for product X within company A. Before this commit, the purchase order is created with vendor as 'Company A'. As '_select_seller' is run in sudo mode (see: https://github.com/odoo/odoo/blob/a16c4a0dabe58ab2cfade353c113387ae5bcd572/addons/stock/models/stock_rule.py#L458), so is not company-aware, therefore the first matching supplier is chosen. Now, the purchase order will be created with vendor as 'External Vendor'. opw-2255989 closes odoo#51596 Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com> X-original-commit: e2dd8ea
robodoo
pushed a commit
that referenced
this pull request
May 27, 2020
- Set two companies (A and B); - Set intercompany flows enabled between company A and B with synchronization of PO/SO; - create a product X is configured as follows in company B: - Storable product; - Routes “Buy” and “Dropship”; - Vendors price list set with vendor = company A. - Product X is configured as follows in company A: - Storable product; - Reordering rule Min 0 / Max 0; - Route “Buy”; - Vendors price list set with vendor = 'External Vendor'. - Create and validate a sale order for product X to final customer within company B; Odoo will automatically create a purchase order for product X to company A within company B; - Validate the purchase order in company B; Odoo will automatically create a sale order for product X to company B within company A; - If there is no available stock in warehouse A; Odoo will automatically create a purchase order for product X within company A. Before this commit, the purchase order is created with vendor as 'Company A'. As '_select_seller' is run in sudo mode (see: https://github.com/odoo/odoo/blob/a16c4a0dabe58ab2cfade353c113387ae5bcd572/addons/stock/models/stock_rule.py#L458), so is not company-aware, therefore the first matching supplier is chosen. Now, the purchase order will be created with vendor as 'External Vendor'. opw-2255989 closes #51596 closes #51903 X-original-commit: e2dd8ea Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
jpp-odoo
added a commit
to odoo-dev/odoo
that referenced
this pull request
May 27, 2020
- Set two companies (A and B); - Set intercompany flows enabled between company A and B with synchronization of PO/SO; - create a product X is configured as follows in company B: - Storable product; - Routes “Buy” and “Dropship”; - Vendors price list set with vendor = company A. - Product X is configured as follows in company A: - Storable product; - Reordering rule Min 0 / Max 0; - Route “Buy”; - Vendors price list set with vendor = 'External Vendor'. - Create and validate a sale order for product X to final customer within company B; Odoo will automatically create a purchase order for product X to company A within company B; - Validate the purchase order in company B; Odoo will automatically create a sale order for product X to company B within company A; - If there is no available stock in warehouse A; Odoo will automatically create a purchase order for product X within company A. Before this commit, the purchase order is created with vendor as 'Company A'. As '_select_seller' is run in sudo mode (see: https://github.com/odoo/odoo/blob/a16c4a0dabe58ab2cfade353c113387ae5bcd572/addons/stock/models/stock_rule.py#L458), so is not company-aware, therefore the first matching supplier is chosen. Now, the purchase order will be created with vendor as 'External Vendor'. opw-2255989 closes odoo#51596 Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com> X-original-commit: e2dd8ea
robodoo
pushed a commit
that referenced
this pull request
May 27, 2020
- Set two companies (A and B); - Set intercompany flows enabled between company A and B with synchronization of PO/SO; - create a product X is configured as follows in company B: - Storable product; - Routes “Buy” and “Dropship”; - Vendors price list set with vendor = company A. - Product X is configured as follows in company A: - Storable product; - Reordering rule Min 0 / Max 0; - Route “Buy”; - Vendors price list set with vendor = 'External Vendor'. - Create and validate a sale order for product X to final customer within company B; Odoo will automatically create a purchase order for product X to company A within company B; - Validate the purchase order in company B; Odoo will automatically create a sale order for product X to company B within company A; - If there is no available stock in warehouse A; Odoo will automatically create a purchase order for product X within company A. Before this commit, the purchase order is created with vendor as 'Company A'. As '_select_seller' is run in sudo mode (see: https://github.com/odoo/odoo/blob/a16c4a0dabe58ab2cfade353c113387ae5bcd572/addons/stock/models/stock_rule.py#L458), so is not company-aware, therefore the first matching supplier is chosen. Now, the purchase order will be created with vendor as 'External Vendor'. opw-2255989 closes #51596 closes #51908 X-original-commit: e2dd8ea Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
synchronization of PO/SO;
within company B; Odoo will automatically create a purchase order for
product X to company A within company B;
create a sale order for product X to company B within company A;
create a purchase order for product X within company A.
Before this commit, the purchase order is created with vendor as 'Company A'.
Now, the purchase order will be created with vendor as 'External Vendor'.
opw-2255989