-
Notifications
You must be signed in to change notification settings - Fork 17
[10][FIX] Variability factor increase red zone #57
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: 10.0
Are you sure you want to change the base?
Changes from 1 commit
11bc3d3
adc0f56
138d9ff
457b92d
b5d3ca2
8c57f50
1a905bc
fd2c1cf
eb8fa91
976db42
a33d885
dc2f421
a3d3e31
6d1433c
f759d81
8d6bc32
14e1e48
8439601
6c3a8fb
3eccfe6
4d3a2d2
b421a3e
f33a83c
1126ef8
832992c
1718672
499e4d6
54f4b72
616c5c4
50b00aa
5d1c0c3
f19481f
e759332
0d413cc
9a7fc92
c1a76f6
3f3510d
0b9a21f
1f63dda
a9812bf
d52927f
d260742
ae5c1be
43244c2
c5e66d5
9ba52ba
4dda1b5
3126db8
cd8cb09
2698b8b
5c0b81a
3d9c473
aab7d68
fd29796
1d5e41f
54c2251
8049241
7969002
7c55cf5
1f8d0cf
fe6d8e9
bf1104e
394b673
c55c8e6
14826e4
fb24d3a
2a5e0c3
1e56a9b
1383609
535f6b6
9694fa8
e9ced2f
fdf2de4
5645fe9
94cc358
4c6511d
e58b170
a88a005
185bd9f
e640b45
d1b7c6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,14 +51,16 @@ class StockWarehouseOrderpoint(models.Model): | |
| "product_uom.rounding", "red_override") | ||
| def _compute_red_zone(self): | ||
| for rec in self: | ||
|
|
||
| if rec.replenish_method in ['replenish', 'min_max']: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You have to split this, for
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Here I meant the current code without the changes on this PR |
||
| factor = rec.buffer_profile_id.lead_time_id.factor | ||
| if rec.replenish_method == 'min_max': | ||
| factor = factor + 1 | ||
| rec.red_base_qty = float_round( | ||
| rec.dlt * rec.adu * | ||
| (1 + rec.buffer_profile_id.lead_time_id.factor), | ||
| rec.dlt * rec.adu * factor, | ||
| precision_rounding=rec.product_uom.rounding) | ||
| rec.red_safety_qty = float_round( | ||
| rec.red_base_qty * | ||
| (1 + rec.buffer_profile_id.variability_id.factor), | ||
| rec.red_base_qty * factor, | ||
| precision_rounding=rec.product_uom.rounding) | ||
| rec.red_zone_qty = rec.red_base_qty + rec.red_safety_qty | ||
| else: | ||
|
|
||
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.
@hparfr @lreficent Maybe a _get_lead_time_factor() method should be a good approach ?
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 don't think it will make sense now. It can be refactored later when some new buffers will be added. (like time buffer 👯♂️ )
Uh oh!
There was an error while loading. Please reload this page.
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, that's what I've in mind 😃
It was to 'decouple' a little bit code!