Skip to content
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][MIG] stock_inventory_valuation_report #292

Closed

Conversation

solo4games
Copy link

No description provided.

Copy link
Contributor

@francesco-ooops francesco-ooops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional ok!

This migration was done in order to make use of module report_async to generate report in case system takes a long time to provide inventory valuation

Copy link

@geomer198 geomer198 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

self.ensure_one()
action = (
report_type == "xlsx"
and self.env.ref(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add raise_if_not_found=False for ref function.

products = (
self.env["product.product"]
.with_context(
dict(to_date=self.date, company_owned=True, create=False, edit=False)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do without dict.
with_context(to_date=self.date, company_owned=True, create=False, edit=False)

@solo4games solo4games force-pushed the 14.0-MIG-stock_inventory_valuation_report branch 2 times, most recently from 734f7a2 to 26b2d15 Compare October 22, 2023 22:19
@francesco-ooops
Copy link
Contributor

@OCA/logistics-maintainers good for merge?

@francesco-ooops
Copy link
Contributor

@rafaelbn looks good to you? :)

@rafaelbn
Copy link
Member

/ocabot migration stock_inventory_valuation_report

@rafaelbn
Copy link
Member

@ps-tubtim could you please review o ping a colleage? this is a Ecosoft original module 😄 Thank you!

@francesco-ooops
Copy link
Contributor

@ps-tubtim gentle reminder :)

@francesco-ooops
Copy link
Contributor

@simahawk could we go? :)

@francesco-ooops
Copy link
Contributor

@sebalix could you take a look at this? thank you!

@francesco-ooops
Copy link
Contributor

@OCA/logistics-maintainers gentle reminder

@@ -1 +1,3 @@
* Pimolnat Suntian <[email protected]>
* Ooops404 <https://ooops404.com>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put contributors' names. You can add a company as title.

"cost_method": product.cost_method,
}
if product.qty_at_date != 0:
if product.qty_available != 0:
Copy link
Contributor

@rousseldenis rousseldenis Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@solo4games Shouldn't it be 'quantity_svl' field instead ? See stock_account/models/product.py

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about that, because, when I did it, one of the tests were failed because it did not pass that if condition, so I can not said that I am right

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition should be dropped as it is already part of the search on products

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@solo4games solo4games force-pushed the 14.0-MIG-stock_inventory_valuation_report branch from 26b2d15 to 22c87ba Compare November 22, 2023 18:59
Copy link
Contributor

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugs are not related to migration but sill the report seems wrong

)
ReportLine = self.env["stock.inventory.valuation.view"]
for product in products:
standard_price = product.standard_price
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks wrong. This is not the price at date. It should be value_svl

"name": product.name,
"reference": product.default_code,
"barcode": product.barcode,
"qty_at_date": product.qty_available,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also likely be quantity_svl

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your feedback
You are right
I fix it, please check again

"cost_method": product.cost_method,
}
if product.qty_at_date != 0:
if product.qty_available != 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition should be dropped as it is already part of the search on products

@dessanhemrayev dessanhemrayev force-pushed the 14.0-MIG-stock_inventory_valuation_report branch from a617a3b to baafd54 Compare November 24, 2023 01:10
@francesco-ooops
Copy link
Contributor

@jbaudoux good for you?

@dessanhemrayev dessanhemrayev force-pushed the 14.0-MIG-stock_inventory_valuation_report branch 4 times, most recently from d3c3736 to 2203fb2 Compare November 28, 2023 09:54
@dessanhemrayev dessanhemrayev force-pushed the 14.0-MIG-stock_inventory_valuation_report branch 13 times, most recently from a01bcb7 to acc4e99 Compare December 14, 2023 20:09
Copy link

@aleuffre aleuffre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial code review, Still some issues IMO

Comment on lines 2 to 4
access_report_stock_inventory_valuation_report,report.stock.inventory.valuation.report,model_report_stock_inventory_valuation_report,base.group_user,1,1,1,1
access_stock_inventory_valuation_view,stock_inventory_valuation_view,model_stock_inventory_valuation_view,base.group_user,1,1,1,1
access_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx,report.s_i_v_r.report_stock_inventory_valuation_report_xlsx,model_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx,base.group_user,1,1,1,1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: IMO base.group_user is too broad. At the very least, we should restrict access to stock.group_stock_user

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I'll fix it

Comment on lines 11 to 21
compute_at_date = fields.Selection(
[("0", "Current Inventory"), ("1", "At a Specific Date")],
string="Compute",
help="Choose to analyze the current inventory or from a specific date in the past.",
default="0",
)
inventory_datetime = fields.Datetime(
"Inventory at Date",
help="Choose a date to get the inventory at that date",
default=fields.Datetime.now,
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: I still don't understand why there's a need to re-declare these fields instead of using the fields that already exist.

Cf. the module on v12 that we are porting to v14: https://github.com/OCA/stock-logistics-reporting/blob/12.0/stock_inventory_valuation_report/wizard/stock_quantity_history.py

default=fields.Datetime.now,
)

def open_table(self):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: same as above - why is this function being declared again (from Odoo v12) instead of using open_at_date which is available in Odoo v14?

Please look at the module on v12 https://github.com/OCA/stock-logistics-reporting/blob/12.0/stock_inventory_valuation_report/wizard/stock_quantity_history.py
and the base wizard in stock and stock_account
https://github.com/OCA/OCB/blob/14.0/addons/stock/wizard/stock_quantity_history.py#L8
https://github.com/OCA/OCB/blob/14.0/addons/stock_account/wizard/stock_quantity_history.py

@dessanhemrayev dessanhemrayev force-pushed the 14.0-MIG-stock_inventory_valuation_report branch from acc4e99 to 6b19bc7 Compare December 18, 2023 19:35
@dessanhemrayev
Copy link

dessanhemrayev commented Dec 18, 2023

@francesco-ooops , please do a functional review)

@francesco-ooops
Copy link
Contributor

@francesco-ooops , please do a functional review)

@dessanhemrayev PDF report don't seem to work on runboat

@dessanhemrayev dessanhemrayev force-pushed the 14.0-MIG-stock_inventory_valuation_report branch from fd55d02 to ec7f098 Compare December 20, 2023 19:31
@dessanhemrayev
Copy link

dessanhemrayev commented Dec 20, 2023

@francesco-ooops , please do a functional review)

@dessanhemrayev PDF report don't seem to work on runboat

@francesco-ooops, I fixed it

@dessanhemrayev
Copy link

@aleuffre, please check)

@francesco-ooops
Copy link
Contributor

@dessanhemrayev if that's ok for you we can take over this task, thanks for the work done so far!

@francesco-ooops
Copy link
Contributor

@rousseldenis this can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.