-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX After refund of 1 qty, POS qty display increased by 2 qty
- Loading branch information
1 parent
1b8714c
commit a0c18a3
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
from . import res_config_settings | ||
from . import stock_quant | ||
from . import stock_warehouse | ||
from . import pos_order |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from odoo import api, fields, models, _ | ||
|
||
|
||
class PosOrder(models.Model): | ||
_inherit = 'pos.order' | ||
|
||
@api.model | ||
def create_from_ui(self, orders, draft=False): | ||
order_ids = super(PosOrder, self).create_from_ui(orders, draft) | ||
for order in self.sudo().browse([o['id'] for o in order_ids]): | ||
config = order.config_id | ||
# send quantity notification after order | ||
if config and config.display_product_quantity: | ||
products = order.lines.mapped("product_id") | ||
warehouse_info = [] | ||
for product in products: | ||
# prepared first main warehouse info | ||
warehouse_info = [config.main_warehouse_id._prepare_vals_for_pos(product)] | ||
# prepared additional warehouses info | ||
for warehouse in config.additional_warehouse_ids: | ||
warehouse_info.append(warehouse._prepare_vals_for_pos(product)) | ||
if warehouse_info: | ||
config._notify_available_quantity(warehouse_info) | ||
return order_ids |