-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[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
base: 18.0
Are you sure you want to change the base?
Conversation
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..
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.
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?
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, | ||
}, | ||
) |
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.
Repetition of code. Function is also not scalable.
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.