Tryton - Issues

 

Issue8058

Title Can't create productions from request because exceeds digits limit
Priority bug Status chatting
Superseder Nosy List pokoli, resteve
Type crash Components stock_supply_production
Assigned To Keywords
Reviews

Created on 2019-01-29.16:47:49 by resteve, last changed by pokoli.

Messages
msg46650 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-01-30.17:10:04
I do not see any patch on msg46573
A patch contains at least the file and the line number which is being modified.
msg46649 (view) Author: [hidden] (resteve) Date: 2019-01-30.16:52:48
> So if you have a patch why you don't propose it?

See msg46573 (...and I read how to contribute). Thanks
msg46647 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-01-30.16:18:09
So if you have a patch why you don't propose it?
msg46646 (view) Author: [hidden] (resteve) Date: 2019-01-30.16:16:45
> and how do you solve it?

convert decimals according to decimals uom?
msg46645 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-01-30.15:04:39
and how do you solve it?
msg46643 (view) Author: [hidden] (resteve) Date: 2019-01-30.15:01:47
> But to produce this limits excess you need to perform the division between two numbers. For example: 2.0 / 1.0 does not exceed the limit. 

Exact! You could do a scenario with these division to reproduce it.

> So please provide the values that you are using and a simple scenario to reproduce the issue.

Sorry ,we detected in production env and we solved it.
msg46642 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-01-30.14:58:41
But to produce this limits excess you need to perform the division between two numbers. For example: 2.0 / 1.0 does not exceed the limit. 

So please provide the values that you are using and a simple scenario to reproduce the issue.
msg46640 (view) Author: [hidden] (resteve) Date: 2019-01-30.14:24:29
You could reproduce when qty decimals exceeds the limit domain.
msg46634 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-01-30.13:10:25
I still do not see any simple step by step scenario to reproduce it.

How much quantities do you have on the inputs and outputs?
msg46633 (view) Author: [hidden] (resteve) Date: 2019-01-30.12:59:53
- Uom Product: grams
- Uom inputs: kilograms
- Uom outputs: grams

The problem is that qty decimals and uom production request [1] exceeds the limit domain [2].

[1] https://bitbucket.org/tryton/stock_supply_production/src/a3e099be638515203589e22ae8bd9298d17d7db5/production.py?at=default&fileviewer=file-view-default#production.py-146

[2] https://bitbucket.org/tryton/production/src/ff98aa7a5be23337aea356546b3ddd630ac63068/production.py?at=default&fileviewer=file-view-default#production.py-114
msg46574 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-01-29.18:23:46
Could you please explain the full scenario? 

There should be something between creating a product with grams and creating request products as by default tryton will not create any production for producible products. 

Do you use a BOM? How much quantity are you producing? 

It will be great if you can provide a simple step by step scenario to reproduce it.

Thank you!
msg46573 (view) Author: [hidden] (resteve) Date: 2019-01-29.16:47:48
Scenario:

1- Create a product with default uom: gram
2- Create Request Productions:


The number of digits "2" of field "Quantity" on "6328.44000000006" exceeds its limit.

Detected all versions in compute_request() method:

POC:

-            quantity=quantity,
+            quantity=float(Decimal(quantity).quantize(Decimal(str(10 ** -product.default_uom.digits)))),
History
Date User Action Args
2019-01-30 17:10:05pokolisetmessages: + msg46650
2019-01-30 16:52:48restevesetmessages: + msg46649
2019-01-30 16:18:10pokolisetmessages: + msg46647
2019-01-30 16:16:45restevesetmessages: + msg46646
2019-01-30 15:04:39pokolisetmessages: + msg46645
2019-01-30 15:01:47restevesetmessages: + msg46643
2019-01-30 14:58:41pokolisetmessages: + msg46642
2019-01-30 14:24:29restevesetmessages: + msg46640
2019-01-30 13:10:26pokolisetmessages: + msg46634
2019-01-30 12:59:54restevesetmessages: + msg46633

Showing 10 items. Show all history (warning: this could be VERY long)