-
-
Notifications
You must be signed in to change notification settings - Fork 177
[18.0][MIG] sale_margin_delivered_dropshipping: Migration to 18.0 #235
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
base: 18.0
Are you sure you want to change the base?
[18.0][MIG] sale_margin_delivered_dropshipping: Migration to 18.0 #235
Conversation
6e30aac to
7e67989
Compare
6abedd7 to
0759841
Compare
04d5fe1 to
41bfc44
Compare
|
@BhaveshHeliconia could you rebase for run tests and runboat again to check the PR? Thank you. |
…ion of 1 As it's done into the sale_margin addon from odoo
Currently translated at 100.0% (1 of 1 strings) Translation: margin-analysis-16.0/margin-analysis-16.0-sale_margin_delivered_dropshipping Translate-URL: https://translation.odoo-community.org/projects/margin-analysis-16-0/margin-analysis-16-0-sale_margin_delivered_dropshipping/it/
41bfc44 to
51fe6d8
Compare
51fe6d8 to
419026e
Compare
|
@EmilioPascual : CI is green and Runboat is up now — ready for review. Thanks! |
EmilioPascual
left a comment
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.
Gelojr
left a comment
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.
I have executed the basic functional tests for this module.
Tests performed:
- Test 1: Correct delivered margin calculation in a simple dropshipping scenario with full delivery.
Result: OK.
- Test 2: Dropshipping with partial return.
Result: Not OK.
The value shown in Margin dlvd. does not match the expected calculation based on the net delivered quantity.
Reproduction steps for the incorrect test (Test 2):
- Create a Sales Order with a dropshipping-configured product (cost 10 €, price 25 €) and a quantity of 6 units.
- Confirm the order and validate the dropshipping delivery of the 6 units.
- Create a dropshipping return for 2 units using the To Refund option.
- Open the sales order line and review the Margin dlvd. field.
Observed behavior:
The delivered margin shown is 100 €, while the expected value should be 60 € (4 net delivered units × 15 € margin per unit).
@BhaveshHeliconia Please review the delivered margin calculation for dropshipping scenarios with returns, as the current result is not correct.
|
@Gelojr I recreate the test case that you mentioned is wrong, but I have obteined different result. Can you review the test case or perhaps provide more information about the data used? Thank you. |
Gelojr
left a comment
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.
I have continued the functional testing of the module.
Test 1 and Test 2 are now both OK.
However, Test 3 reveals an issue that must be reviewed, specifically in a mixed scenario where part of the delivery comes from on-hand stock and part from dropshipping.
Below are the full reproduction steps and the behavior observed.
Test 3 (Mixed: stock delivery + dropshipping) — NOT OK
Reproduction steps:
-
Create product. In this case I have assigned it to a product category configured with AVCO as the cost method. Configure the product with the Dropship route enabled. Price: 25$ Purchase price: 10$/unit
-
Simulate a situation where 2 units are already available in the warehouse:
- Purchase 2 units of this product. 10$/unit
- Receive them into stock.
- Create a Sales Order for 5 units of this product.
- The system generates a Purchase Order for dropshipping to buy 5 units ; since 2 units are already in stock, change quantity and purchase only 3 units.
- Validate the dropshipping picking for those 3 units.
- The Sales Order correctly shows Delivered = 3 units, and both Odoo’s margin and the module’s delivered margin are correct at this point.
- From the Sales Order, open the Pickings smart button.
8 Manually create a new picking of type Delivery Order and deliver the 2 units available in stock.
9. After validating this picking, a new line is added to the Sales Order.
In standard Odoo I have performed the same flow, and that line is not added to the sales order, and the delivery note is not linked to the sales order.
Observed issue:
- The margins for this new line are not calculated correctly.
- The standard Odoo margin, and margings calculated by this module are incorrect for the stock-based delivery line created after the dropshipping delivery.
This indicates that the mixed scenario (dropshipping first, stock delivery afterwards) is not being handled properly, and the delivered margin calculation needs to be reviewed for these cases.
Request
Please review the behavior of the margin and delivered margin computation when a Sales Order contains multiple delivery flows (dropshipping + standard delivery), especially when the stock delivery is created manually after the dropshipping picking has already been processed.
chienandalu
left a comment
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.
- From the Sales Order, open the Pickings smart button.
- Manually create a new picking of type Delivery Order and deliver the 2 units available in stock.
- After validating this picking, a new line is added to the Sales Order.
That's quite an strange workflow, don't you think?
In standard Odoo I have performed the same flow, and that line is not added to the sales order, and the delivery note is not linked to the sales order.
I don't think that behavior has anything to do with this module...
Gelojr
left a comment
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.
Congratulations on the work done on this module.
The following functional tests have been executed and reviewed.
- Test 1: Simple dropshipping scenario with full delivery. The delivered margin and delivered margin percentage are calculated correctly. Result OK.
- Test 2: Dropshipping with partial return. The delivered margin is correctly recalculated based on the net delivered quantity after the return. Result OK.
- Test 3: Mixed delivery scenario (dropshipping first, stock delivery afterwards). The test was executed and the behavior was reported. This scenario has been confirmed as out of scope and therefore is not covered by the module design.
- Test 4: Partial dropshipping delivery without completing the full quantity. The delivered margin reflects only the delivered units. Result OK.
- Test 5: Not performed. This test involves mixed delivery scenarios, which are explicitly not contemplated by this module.
Note: Mixed delivery scenarios combining dropshipping and standard stock deliveries for the same product are not supported by this module, as clarified during the review.
|
This PR has the |

No description provided.