From 06e0a005a3e96cd7708964498c996cbef358946c Mon Sep 17 00:00:00 2001 From: Joseph Caburnay Date: Tue, 9 Jan 2024 16:51:41 +0100 Subject: [PATCH] [FIX] pos_restaurant: US tipping should not be set by default In SaaS, the DB is pre-prepared with the generic chart of accounts before the new user finishes the form. Since the default country of the generic chart of accounts is the US, then `set_tip_after_payment` option in the pre-created pos.config is set to True. Now, when the form is submitted, the country is identified but the said option remains to be True. This is a problem because not all customers are creating an odoo instance for a US company. So customers from other countries will have the option activated by default which is not a good default for them. We introduced this behavior in aa1c5b53bf131c6df96ad621e00bd2ee3d44c6c0 and in this commit we won't set the option by default anymore. closes odoo/odoo#149542 Task-id: 3635635 Signed-off-by: Vlad Stroia (vlst) --- addons/pos_restaurant/models/pos_config.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/addons/pos_restaurant/models/pos_config.py b/addons/pos_restaurant/models/pos_config.py index d3522f6fb1a..dfbeea42df5 100644 --- a/addons/pos_restaurant/models/pos_config.py +++ b/addons/pos_restaurant/models/pos_config.py @@ -61,15 +61,6 @@ class PosConfig(models.Model): forbidden_keys.append('floor_ids') return forbidden_keys - def _set_tips_after_payment_if_country_custom(self): - self.ensure_one() - company = self.company_id or self.env.company or self.env['res.company']._get_main_company() - if company and company.country_id and company.country_id.code == 'US': - self.update({ - 'iface_tipproduct': True, - 'set_tip_after_payment': True, - }) - @api.model_create_multi def create(self, vals_list): for vals in vals_list: @@ -134,7 +125,6 @@ class PosConfig(models.Model): def _setup_main_restaurant_defaults(self): self.ensure_one() - self._set_tips_after_payment_if_country_custom() self._link_same_non_cash_payment_methods_if_exists('point_of_sale.pos_config_main') self._ensure_cash_payment_method('MRCSH', _('Cash Restaurant')) self._archive_shop()