diff options
| author | Joseph Caburnay <jcb@odoo.com> | 2020-07-31 09:36:39 +0000 |
|---|---|---|
| committer | Joseph Caburnay <jcb@odoo.com> | 2020-08-12 09:17:34 +0000 |
| commit | b0107e9230da5cb5c90819e5bee3e9cd323816ee (patch) | |
| tree | 110e65cd9a180fbf782a70c392b9378a1f662e89 /addons/point_of_sale/models | |
| parent | 96f7c5eda84d6b7a1eade31efb8c35aff4ce94c4 (diff) | |
[IMP] pos_restaurant,point_of_sale: set tip after payment
1. Introduce an option in restaurant config to allow setting tips after payment.
2. Tip form is shown in bills so the customers can choose/set their tips.
3. Validated orders are kept in TipScreen (access via TicketScreen) so that at the
end of the day, the user/cashier can set the tips for each validated order.
closes odoo/odoo#55488
Task-id: 2117029
Related: odoo/upgrade#1606
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons/point_of_sale/models')
| -rw-r--r-- | addons/point_of_sale/models/pos_order.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index ecdb7ae0e45..500890cf0fe 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -49,6 +49,8 @@ class PosOrder(models.Model): 'amount_return': ui_order['amount_return'], 'company_id': self.env['pos.session'].browse(ui_order['pos_session_id']).company_id.id, 'to_invoice': ui_order['to_invoice'] if "to_invoice" in ui_order else False, + 'is_tipped': ui_order.get('is_tipped', False), + 'tip_amount': ui_order.get('tip_amount', 0), } @api.model @@ -253,6 +255,8 @@ class PosOrder(models.Model): session_move_id = fields.Many2one('account.move', string='Session Journal Entry', related='session_id.move_id', readonly=True, copy=False) to_invoice = fields.Boolean('To invoice') is_invoiced = fields.Boolean('Is Invoiced', compute='_compute_is_invoiced') + is_tipped = fields.Boolean('Is this already tipped?', readonly=True) + tip_amount = fields.Float(string='Tip Amount', digits=0, readonly=True) @api.depends('account_move') def _compute_is_invoiced(self): @@ -615,6 +619,8 @@ class PosOrder(models.Model): 'state': order.state, 'account_move': order.account_move.id, 'id': order.id, + 'is_tipped': order.is_tipped, + 'tip_amount': order.tip_amount, } def export_for_ui(self): |
