Skip to content

[ADD] pos_receipt: created multiple layout styles for POS order receipts #851

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

Draft
wants to merge 4 commits into
base: 18.0
Choose a base branch
from

Conversation

arat-odoo
Copy link

In the POS application, multiple layout styles were created for the order
receipt. Based on the selected style, the corresponding format is displayed in
the order receipt PDF. The layout format can also be configured from the General
Settings.

arat-odoo added 4 commits July 9, 2025 10:06
In res.config.settings add the configure layout button in pos module.
Created a different receipt layout in pos config. and add a template for each
layout style and link receipt layout settings to pos config and
res.config.settings. Also updated security access for the new wizard model.
…ing in POS

Added functionality to display receipt previews for each layout option the POS
receipt layout wizard.user can to open and select their preferred receipt layout.
according selected style layout display the order receipt  to the chosen
style.
created boxed and lined layout in order receipt and according display the order
receipt pdf  file..
@robodoo
Copy link

robodoo commented Jul 11, 2025

Pull request status dashboard

Copy link

@bit-odoo bit-odoo left a comment

Choose a reason for hiding this comment

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

Hello,
Your commit message tag is different the PR tag.It should be the same.

Why have you created 3 different templates? Can't we make it in one?

Comment on lines +28 to +57
if self.receipt_layout == "light":
self.receipt_preview = self.env["ir.ui.view"]._render_template(
"pos_receipt.custom_receipt_light",
{
"header": self.receipt_header,
"footer": self.receipt_footer,
"logo": self.receipt_logo,
"is_restaurant": self.is_restaurant,
},
)
elif self.receipt_layout == "boxes":
self.receipt_preview = self.env["ir.ui.view"]._render_template(
"pos_receipt.custom_pos_receipt_boxed",
{
"header": self.receipt_header,
"footer": self.receipt_footer,
"logo": self.receipt_logo,
"is_restaurant": self.is_restaurant,
},
)
elif self.receipt_layout == "lined":
self.receipt_preview = self.env["ir.ui.view"]._render_template(
"pos_receipt.custom_receipt_lined",
{
"header": self.receipt_header,
"footer": self.receipt_footer,
"logo": self.receipt_logo,
"is_restaurant": self.is_restaurant,
},
)

Choose a reason for hiding this comment

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

Repetition of code. Function is also not scalable.

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

Successfully merging this pull request may close these issues.

3 participants