summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-11-12 09:49:29 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-11-12 09:49:29 +0700
commit9110fb5d93fc7bf9513a0705a22764aca711be26 (patch)
treeaa51b069813001494dbd98bd7c98d444e820bd66 /indoteknik_custom/models
parent200d9ba97ba86f759b3d804c253430230c353fe0 (diff)
parent38c6551a94098370e060e45739dc4c8ae923c48e (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/requisition.py3
-rw-r--r--indoteknik_custom/models/sale_order_line.py1
-rw-r--r--indoteknik_custom/models/website_user_cart.py2
3 files changed, 4 insertions, 2 deletions
diff --git a/indoteknik_custom/models/requisition.py b/indoteknik_custom/models/requisition.py
index 8ebdd31b..d53fc796 100644
--- a/indoteknik_custom/models/requisition.py
+++ b/indoteknik_custom/models/requisition.py
@@ -47,8 +47,7 @@ class Requisition(models.Model):
notification = fields.Char(string='Notification')
is_po = fields.Boolean(string='Is PO')
requisition_match = fields.One2many('requisition.purchase.match', 'requisition_id', string='Matches', auto_join=True)
- sale_order_id = fields.Many2one('sale.order', string='SO', help='harus diisi nomor SO yang ingin digenerate',
- domain="[('state', '=', 'sale')]")
+ sale_order_id = fields.Many2one('sale.order', string='SO', help='harus diisi nomor SO yang ingin digenerate')
sales_approve = fields.Boolean(string='Sales Approve', tracking=3, copy=False)
merchandise_approve = fields.Boolean(string='Merchandise Approve', tracking=3, copy=False)
diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py
index 978b1f69..5a6640ec 100644
--- a/indoteknik_custom/models/sale_order_line.py
+++ b/indoteknik_custom/models/sale_order_line.py
@@ -31,6 +31,7 @@ class SaleOrderLine(models.Model):
vendor_subtotal = fields.Float(string='Vendor Subtotal', compute="_compute_vendor_subtotal")
amount_voucher_disc = fields.Float(string='Voucher Discount')
qty_reserved = fields.Float(string='Qty Reserved', compute='_compute_qty_reserved')
+ product_available_quantity = fields.Float(string='Qty pickup by user',)
reserved_from = fields.Char(string='Reserved From', copy=False)
item_percent_margin_without_deduction = fields.Float('%Margin', compute='_compute_item_margin_without_deduction')
weight = fields.Float(string='Weight')
diff --git a/indoteknik_custom/models/website_user_cart.py b/indoteknik_custom/models/website_user_cart.py
index 6cb282f8..494f32f3 100644
--- a/indoteknik_custom/models/website_user_cart.py
+++ b/indoteknik_custom/models/website_user_cart.py
@@ -65,9 +65,11 @@ class WebsiteUserCart(models.Model):
if stock_quant:
res['is_in_bu'] = True
res['on_hand_qty'] = sum(stock_quant.mapped('quantity'))
+ res['available_quantity'] = stock_quant.available_quantity
else:
res['is_in_bu'] = False
res['on_hand_qty'] = 0
+ res['available_quantity'] = 0
flashsales = self.product_id._get_active_flash_sale()
res['has_flashsale'] = True if len(flashsales) > 0 else False