Skip to content

[FIX] purchase_stock: vendor choice in multi-company#51596

Closed
jpp-odoo wants to merge 1 commit intoodoo:13.0from
odoo-dev:13.0-opw-2255989-wrong_company_supplier-jpp
Closed

[FIX] purchase_stock: vendor choice in multi-company#51596
jpp-odoo wants to merge 1 commit intoodoo:13.0from
odoo-dev:13.0-opw-2255989-wrong_company_supplier-jpp

Conversation

@jpp-odoo
Copy link
Contributor

  • 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'.

Now, the purchase order will be created with vendor as 'External Vendor'.

opw-2255989

@jpp-odoo jpp-odoo requested a review from nim-odoo May 20, 2020 09:43
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label May 20, 2020
@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label May 20, 2020
Copy link
Contributor

@nim-odoo nim-odoo left a comment

Choose a reason for hiding this comment

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

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
@jpp-odoo jpp-odoo force-pushed the 13.0-opw-2255989-wrong_company_supplier-jpp branch from bb112e3 to 7dee21a Compare May 20, 2020 12:09
@robodoo robodoo removed the CI 🤖 Robodoo has seen passing statuses label May 20, 2020
@jpp-odoo
Copy link
Contributor Author

robodoo r+

@robodoo robodoo added r+ 👌 CI 🤖 Robodoo has seen passing statuses labels May 20, 2020
@robodoo robodoo closed this in 71fb2a5 May 20, 2020
@robodoo robodoo temporarily deployed to merge May 20, 2020 13:59 Inactive
@jpp-odoo jpp-odoo deleted the 13.0-opw-2255989-wrong_company_supplier-jpp branch May 20, 2020 14:14
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI 🤖 Robodoo has seen passing statuses OE the report is linked to a support ticket (opw-...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants