Skip to content
Snippets Groups Projects
Commit 3b12f989 authored by hungbui's avatar hungbui Committed by hungbui
Browse files

[FIX] pos_loyalty: Fix missing program's order count when fetching data


before this commit, POS order can add a reward from loyalty programs
which have already reached maximum usage by add the loyalty rule's code
and refresh the browser. It will clear 'total_order_count' in browser
cache.
step to remake:
1. create a promo code loyalty program with maximum usage
2. create orders (pos order or sale order) with this promo code and paid
them until the program reaching the limit usage.
3. create new POS order and add the promo code -> no reward line in POS
order, then refresh browser, it will add new reward line into order

after this commit, 'total_order_count' allways be fetching from database
so it is being clear no longer.

closes odoo/odoo#134077

Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
parent 47cdc122
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@ class PosSession(models.Model):
return {
'search_params': {
'domain': [('id', 'in', self.config_id._get_program_ids().ids)],
'fields': ['name', 'trigger', 'applies_on', 'program_type', 'date_to',
'fields': ['name', 'trigger', 'applies_on', 'program_type', 'date_to', 'total_order_count',
'limit_usage', 'max_usage', 'is_nominative', 'portal_visible', 'portal_point_name', 'trigger_product_ids'],
},
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment