-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
[18.0][MIG] stock_picking_line_sequence #1864
base: 18.0
Are you sure you want to change the base?
[18.0][MIG] stock_picking_line_sequence #1864
Conversation
47c4d60
to
1a3f7c4
Compare
OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex
Currently translated at 100.0% (7 of 7 strings) Translation: stock-logistics-workflow-12.0/stock-logistics-workflow-12.0-stock_picking_line_sequence Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-12-0/stock-logistics-workflow-12-0-stock_picking_line_sequence/pt_BR/
Currently translated at 100.0% (7 of 7 strings) Translation: stock-logistics-workflow-12.0/stock-logistics-workflow-12.0-stock_picking_line_sequence Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-12-0/stock-logistics-workflow-12-0-stock_picking_line_sequence/sl/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: stock-logistics-workflow-12.0/stock-logistics-workflow-12.0-stock_picking_line_sequence Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-12-0/stock-logistics-workflow-12-0-stock_picking_line_sequence/
Currently translated at 28.5% (2 of 7 strings) Translation: stock-logistics-workflow-15.0/stock-logistics-workflow-15.0-stock_picking_line_sequence Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-15-0/stock-logistics-workflow-15-0-stock_picking_line_sequence/it/
only update the sequence number when the line number is an integer.
Currently translated at 100.0% (7 of 7 strings) Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_picking_line_sequence Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_line_sequence/es/
Currently translated at 100.0% (7 of 7 strings) Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_picking_line_sequence Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_line_sequence/it/
1a3f7c4
to
59fe8d3
Compare
/ocabot migration stock_picking_line_sequence |
59fe8d3
to
61b2bd4
Compare
61b2bd4
to
f17537d
Compare
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.
Functional.
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.
Thanks, LG. Minor remarks
_inherit = "stock.move" | ||
|
||
# re-defines the field to change the default | ||
sequence = fields.Integer("HiddenSequence", default=9999) |
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.
sequence = fields.Integer("HiddenSequence", default=9999) | |
sequence = fields.Integer("Hidden sequence", default=9999) |
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.
Thanks. I removed the string label entirely analogous to sale_order_line_sequence.
|
||
@api.model_create_multi | ||
def create(self, vals_list): | ||
"""(re)initialize the sequences of the moves within a picking""" |
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.
Do not change create docstring
"""(re)initialize the sequences of the moves within a picking""" | |
# (re)initialize the sequences of the moves within a picking""" |
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.
Isn't a docstring the best way to document what a method (or an override) does?
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.
A method yes. An override no as it's overriding the docstring of what create does
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 must admit that it is out of intuition that I have been doing this, but I have been doing this for over a decade. Do you have a pointer to an Odoo or OCA guideline about this?
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 I don't. But you can check if my saying is right by opening a shell and running help(env["stock.move"].create)
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.
@rousseldenis Do you agree with the suggestion not to mask the original docstring? What would give the best usability in visual IDEs (that I don't use)?
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.
@StefanRijnhart yes, your suggestion is the good one.
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.
@rousseldenis you mean the one with docstring or comment?
By the way, it's not an override (where docstring would be right) but an extend (where it's debatable)
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.
@rousseldenis Indeed, I was talking about jbaudoux' suggestion to replace the docstring by 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.
OK, done.
</xpath> | ||
<xpath expr="//table[2]/thead/tr/th[1]" position="before"> | ||
<th> | ||
<strong>Seq.</strong> |
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.
<strong>Seq.</strong> | |
<strong>Line Number</strong> |
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.
Done
<template id="report_delivery_document" inherit_id="stock.report_delivery_document"> | ||
<xpath expr="//table[1]/thead/tr/th[1]" position="before"> | ||
<th> | ||
<strong>Seq.</strong> |
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.
<strong>Seq.</strong> | |
<strong>Line Number</strong> |
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.
Done
|
||
# displays sequence on the stock moves | ||
visible_sequence = fields.Integer( | ||
"Sequence", |
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.
"Sequence", | |
"Line Number", |
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.
Done
current_sequence = 1 | ||
for line in rec.move_ids_without_package: | ||
# Check if the record ID is an integer (real ID) | ||
# or a string (virtual 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.
virtual ID should be of NewId type, not string
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.
Comment updated.
Standard migration, based on unmerged #1552.
sequence2
is renamed tovisible_sequence
as in the other *_line_sequence models, incl. data migration