-
-
Notifications
You must be signed in to change notification settings - Fork 628
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
stock_batch_picking #241
stock_batch_picking #241
Conversation
3ded5ae
to
663ce5d
Compare
663ce5d
to
574e48d
Compare
574e48d
to
e935a04
Compare
|
||
class ResCompany(models.Model): | ||
_inherit = 'res.company' | ||
default_picker_id = fields.Many2one( |
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.
Can we have this at the warehouse level instead? Having this at the company level will be an issue when multiple warehouse at separate locations come into play.
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.
IMO this is a blocking detail as it does not play nicely with multiple warehouses that would have default pickers.
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 agree. I'll label this as "Needs fixing" until then
Thanks for the submission @cyrilgdn - comments inline. IMO there is a lot of critical logic being introduced here without test coverage. An example would be the @pedrobaeza - Any idea why there is no coverage.io for this repo? Travis config looks fine, is it maybe just not configured in coveralls? It would definitely help us in identifying the test coverage gaps in this PR. |
@lasley In Python, {'done', 'cancel'} is a set, not a dictionary. It's similar to set(['done', 'cancel']). The coverage is 100% except for report logic. It was copied and adapt from picking_dispatch, I don't really know how to test it. |
Whoah TIL on the set shorthand - Neat - Thanks! Understood, I won't force the testing then - although I would also be more than happy to assist if you had some specific questions on it. |
<odoo> | ||
<!-- stock.batch.picking form view --> | ||
<record model="ir.ui.view" id="stock_bacth_picking_form"> | ||
<field name="name">stock.bacth.picking.form</field> |
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/bacth/batch/
Can't we retrieve part of the translations ? |
Updated with remarks taking in account. (typo, some doc, translations, ...) |
Please @carlosdauden review, thanks! |
else: | ||
warehouse = False | ||
|
||
return warehouse.default_picker_id if warehouse else False |
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.
After changes return warehouse.default_picker_id directly
carrier = {} | ||
operations = self.operations_by_loc[locations] | ||
for operation in operations: | ||
p_code = operation.product_id.default_code |
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.
Seems to me to done on purpose, but, why it is not grouped by product id?
If several products have not established default_code, total quantity (all products) is printed in only one line with the description of the first product.
You can sort by default_code anyway.
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.
You still need to fix this point
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, I will try to fix this as soon as I can...
It's True that, as I'm still not comfortable with reports, I've just migrated the picking_dispatch report file and made the little adaptations :)
I did not pay attention to existing bugs, my bad.
@@ -43,14 +43,9 @@ def _default_picker_id(self): | |||
else: | |||
warehouse = self.env['stock.warehouse'].search([ | |||
('company_id', '=', self.env.user.company_id.id) | |||
], limit=1) | |||
], limit=1)[:1] |
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.
Aren't we achieving the desired result already with the limit=1
? The result of this should be either a singleton or an empty recordset which would eval to False.
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.
yep, [:1]
is useless
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.
@lasley Right! And I changed it (again...)
As it was a very very little change, can we merge this PR ?
65ffdfc
to
60bf001
Compare
('company_id', '=', self.env.user.company_id.id) | ||
], limit=1) | ||
|
||
if warehouse: |
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 removed
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.
@pedrobaeza Already removed as you commented an outdated diff ;)
@lasley @pedrobaeza @carlosdauden Fixes are done. But can someone tell me how to fix the new pylint-odoo error (old-api7-method-defined) in this case? |
I'm as stumped as you on that one @cyrilgdn - I see no examples of an api decorated |
FYI the red of travis is because pylint show: stock_batch_picking/report/batch_report.py:7: [W0403(relative-import), ] Relative import 'print_batch', should be 'stock_batch_picking.report.print_batch'
stock_batch_picking/report/print_batch.py:9: [W0403(relative-import), ] Relative import 'batch_aggregation', should be 'stock_batch_picking.report.batch_aggregation' The line stock_batch_picking/report/batch_report.py:7 The line stock_batch_picking/report/print_batch.py:9 It because you have this library in the same path and avoid errors with libraries named with the same "virtual path" the dot use in the "virtual path" and |
Maybe we could use the new api for reporting using Good examples: |
Checks green! @moylop260 With the new api reporting system, we have to override render_html and redefine the entire docargs dict (with docs, doc_ids, etc....) ?? |
@@ -0,0 +1,395 @@ | |||
# Translation of Odoo Server. |
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.
Remove POT file
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.
If the guideline changed after OCA/maintainer-tools#97 could add it in our guidelines?
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.
My opinion on this have changed since that issue, because I found somebody translating from an outdated POT file.
@pedrobaeza @moylop260 POT file removed. |
Can we merge this PR? |
Thanks @cyrilgdn |
Reworked of picking_dispatch (in V8 or less) to match Odoo 9 new picking with pack operations.