From 344e3262d856f668f40b26cde86acfd62bbb1194 Mon Sep 17 00:00:00 2001 From: "Loan (LSE)" Date: Fri, 29 Dec 2023 15:03:00 +0000 Subject: [PATCH] [FIX] pos_restaurant: don't show internal notes button on shops To reproduce (16.2 and >): 1. Install pos_restaurant 2. Open the Shop pos session -> "Kitchen Note" button display => Unintended as this button does only make sense in restaurant Before this commit: The button actually shows due to `iface_orderline_notes` value being set to `True` by default. After this commit: The setting value is unset (for shops) to prevent the button to render opw-3651750 closes odoo/odoo#148700 X-original-commit: afd9c9faaff9603eb1a11dc79ea3053a1eac98fb Signed-off-by: David Monnom (moda) Signed-off-by: Loan Sens (lse) --- addons/pos_restaurant/models/pos_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/pos_restaurant/models/pos_config.py b/addons/pos_restaurant/models/pos_config.py index e00101fdefb..d3522f6fb1a 100644 --- a/addons/pos_restaurant/models/pos_config.py +++ b/addons/pos_restaurant/models/pos_config.py @@ -11,7 +11,7 @@ class PosConfig(models.Model): iface_splitbill = fields.Boolean(string='Bill Splitting', help='Enables Bill Splitting in the Point of Sale.') iface_printbill = fields.Boolean(string='Bill Printing', help='Allows to print the Bill before payment.') - iface_orderline_notes = fields.Boolean(string='Internal Notes', help='Allow custom Internal notes on Orderlines.', default=True) + iface_orderline_notes = fields.Boolean(string='Internal Notes', help='Allow custom Internal notes on Orderlines.') floor_ids = fields.Many2many('restaurant.floor', string='Restaurant Floors', help='The restaurant floors served by this point of sale.') set_tip_after_payment = fields.Boolean('Set Tip After Payment', help="Adjust the amount authorized by payment terminals to add a tip after the customers left or at the end of the day.") module_pos_restaurant = fields.Boolean(default=True) @@ -78,6 +78,7 @@ class PosConfig(models.Model): vals['iface_splitbill'] = True if not is_restaurant or not vals.get('iface_tipproduct', False): vals['set_tip_after_payment'] = False + vals["iface_orderline_notes"] = is_restaurant pos_configs = super().create(vals_list) for config in pos_configs: if config.module_pos_restaurant: