-
-
Notifications
You must be signed in to change notification settings - Fork 723
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
[14.0][IMP] stock_location_last_inventory_date: Make last_inventory_date storeable #2222
base: 14.0
Are you sure you want to change the base?
[14.0][IMP] stock_location_last_inventory_date: Make last_inventory_date storeable #2222
Conversation
f07a99c
to
dbe1f5b
Compare
@hailangvn @sebalix @simahawk |
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 can make an inventory of a location without making any inventory line. I would have not changed that concept.
In newer versions, it's updating the date when the inventory is posted. You could go that way and make a migration script of the initialization of the field.
last_inventory_dates = [ | ||
line.inventory_id.date | ||
for line in location.inventory_line_ids | ||
if line.state == "done" |
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 move to fields definition done_inventory_line_ids
as a domain
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.
The last_inventory_date will be now set on action_done.
But still i am using the locations set on stock.inventory.line
.
You can also create a stock.inventory
without setting location_ids.
The lines should be created by _action_start
(https://github.com/odoo/odoo/blob/cc0060e889603eb2e47fa44a8a22a70d7d784185/addons/stock/models/stock_inventory.py#L170).
If the lines aren't created, then they should be created manually.
This is then now the same as it is in newer versions. stock.inventory.line
is removed and just stock.quant
is used.
In v14 the method _get_inventory_lines_values
(https://github.com/odoo/odoo/blob/cc0060e889603eb2e47fa44a8a22a70d7d784185/addons/stock/models/stock_inventory.py#L297)
is getting the data from stock.quant
.
dbe1f5b
to
dcdb125
Compare
…oreable This allows to search this field
dcdb125
to
0e0121d
Compare
I wanted to make this field searchable. At first i tried to create a search method for it, but it was not nice to implement, since the location of
stock.inventory
is used. Storing the date is easier. Therefor i changed the computation to usestock.inventory.line
instead ofstock.inventory
, because this record contains a direct link to a location.