-
-
Notifications
You must be signed in to change notification settings - Fork 716
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
[11.0] [MIG] stock orderpoint uom #386
Conversation
39fd1d8
to
6803e25
Compare
@bodedra I wanted to try out the module and do a review, but I keep having a weird behaviour.
Although the value here is 9 : https://github.com/OCA/stock-logistics-warehouse/pull/386/files#diff-ace9f064ade2bd0ba24d6a8148f9c701R16 Any idea ? |
Bugs are tracked on `GitHub Issues | ||
<https://github.com/OCA/stock-logistics-warehouse/issues>`_. In case of trouble, please | ||
check there if your issue has already been reported. If you spotted it first, | ||
help us smashing it by providing a detailed and welcomed feedback. |
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.
s/smashing/smash
[('orderpoint_id', '=', orderpoint.id), | ||
('order_id', '=', purchase.id)]) | ||
self.assertEquals(len(purchase_line), 1) | ||
self.assertEqual(purchase_line.product_qty, 2.0) |
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.
use assertAlmostEqual
for float comparsions
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 changed from 2.0 to 2
stock_orderpoint_uom/__manifest__.py
Outdated
"version": "11.0.1.0.0", | ||
"author": "Eficent, " | ||
"Odoo Community Association (OCA)", | ||
"website": "https://www.odoo-community.org", |
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.
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.
Corresponded. Thank you.
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.
Well it took me a while to figure it out, so please cherry-pick this commit grindtildeath@e520445 (as I can't open a PR on your repo) to go faster.
product_qty = orderpoint.product_uom._compute_quantity( | ||
product_qty, orderpoint.procure_uom_id) | ||
return super(ProcurementGroup, self).run(product_id, product_qty, | ||
product_uom, location_id, |
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.
This should be orderpoint.procure_uom_id
Because product_qty
here is updated to the new UOM while product_uom stays the same...
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.
Corresponded. Thank you.
sched = self.env['procurement.order'] | ||
sched.run_scheduler() | ||
proc = sched.search([('product_id', '=', self.productA.id)]) | ||
self.assertEqual(proc.product_uom, self.uom_dozen) |
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.
Well, had you kept this replacing proc
with purchase_line
, the test would have failed because of the uom of the purchase is not the procure_uom of the orderpoint. 👎
b36b739
to
bb2056f
Compare
bb2056f
to
ba59b52
Compare
stock_orderpoint_uom/__manifest__.py
Outdated
"version": "11.0.1.0.0", | ||
"author": "Eficent, " | ||
"Odoo Community Association (OCA)", | ||
"website": "https://www.odoo-community.org", |
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.
No description provided.