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

[16.0][IMP]stock_report_quantity_by_location: Included report generation #345

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

anusriNPS
Copy link

@anusriNPS anusriNPS commented Oct 4, 2024

Included pdf report generation functionality for module  "stock_report_quantity_by_location"

Reports uses different html tags for view and print report functionality:
        - View report uses div tags with classes defined in css file
        - Printing report uses table related tags such as thead, tr, td etc based on web.internal layout used in template

@anusriNPS anusriNPS force-pushed the 16.0-report-qty-by-location branch 3 times, most recently from c45c8f7 to 814074a Compare October 4, 2024 08:55
@anusriNPS anusriNPS marked this pull request as draft October 4, 2024 08:58
@anusriNPS anusriNPS force-pushed the 16.0-report-qty-by-location branch 4 times, most recently from 5229804 to 573e62a Compare October 4, 2024 11:41
@anusriNPS
Copy link
Author

View report and export pdf report:

Screenshot from 2024-10-04 13-25-09
Screenshot from 2024-10-04 13-24-12

@anusriNPS anusriNPS marked this pull request as ready for review October 4, 2024 11:46
@anusriNPS anusriNPS force-pushed the 16.0-report-qty-by-location branch 2 times, most recently from 0c9481d to 4633d3d Compare October 7, 2024 12:56
@rousseldenis rousseldenis added this to the 16.0 milestone Oct 7, 2024
@anusriNPS anusriNPS force-pushed the 16.0-report-qty-by-location branch from 4633d3d to b0558ec Compare October 7, 2024 12:58
Copy link

@PicchiSeba PicchiSeba left a comment

Choose a reason for hiding this comment

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

Code review: minor fixes

new_context = safe_eval(new_context)
except (TypeError, SyntaxError, NameError, ValueError):
_logger.warning(
_("Failed context evaluation: %(context)s", context=new_context)

Choose a reason for hiding this comment

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

suggestion: let's maintain the same string translation/formatting structure as the other modules

Suggested change
_("Failed context evaluation: %(context)s", context=new_context)
_("Failed context evaluation: %(context)s") % {"context": new_context}

Copy link
Author

Choose a reason for hiding this comment

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

Modified as suggested

Comment on lines 90 to 94
action = self.env.ref(
"stock_report_quantity_by_location."
"action_stock_report_quantity_by_location_html"
)
vals = action.read()[0]

Choose a reason for hiding this comment

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

issue: we should use the proper way to open an action

Suggested change
action = self.env.ref(
"stock_report_quantity_by_location."
"action_stock_report_quantity_by_location_html"
)
vals = action.read()[0]
action = self.env["ir.actions.act_window"]._for_xml_id(
"stock_report_quantity_by_location."
"action_stock_report_quantity_by_location_html"
)

Following this change, rename the following instances of vals with action

Copy link
Author

Choose a reason for hiding this comment

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

Used "ir.actions.actions" to get an action

    Included pdf report generation functionality for module
stock_report_quantity_by_location
@anusriNPS anusriNPS force-pushed the 16.0-report-qty-by-location branch from b0558ec to 1b1bb34 Compare October 24, 2024 13:22
Copy link

@PicchiSeba PicchiSeba left a comment

Choose a reason for hiding this comment

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

Code review: LGTM

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.

3 participants