diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-27 10:40:40 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-27 10:40:40 +0700 |
| commit | df7bbe715bb49d9986d68046127410340b617713 (patch) | |
| tree | 6a2e633b3b8ef681cee84d228134b2427434472b | |
| parent | 690c4951fde01ae5108e75f4093eef0f00e25bdd (diff) | |
| parent | 091d3159526442a41cc1026a7d54fbf5c2f951f8 (diff) | |
Merge branch 'production' of https://bitbucket.org/altafixco/indoteknik-addons into production
| -rw-r--r-- | indoteknik_api/controllers/api_v1/product.py | 21 | ||||
| -rwxr-xr-x | indoteknik_custom/models/user_activity_log.py | 1 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 6 |
3 files changed, 19 insertions, 9 deletions
diff --git a/indoteknik_api/controllers/api_v1/product.py b/indoteknik_api/controllers/api_v1/product.py index 7ec6459b..e08ec97b 100644 --- a/indoteknik_api/controllers/api_v1/product.py +++ b/indoteknik_api/controllers/api_v1/product.py @@ -29,6 +29,12 @@ class Product(controller.Controller): qty = 0 sla_date = '-' + # Qty Stock Vendor + qty_vendor = stock_vendor.quantity + qty_vendor -= int(qty_vendor * 0.1) + qty_vendor = math.ceil(float(qty_vendor)) + total_excell = qty_vendor + is_altama_product = product.x_manufacture.id in [10,122,89] if is_altama_product: try: @@ -37,11 +43,7 @@ class Product(controller.Controller): qty_altama -= int(qty_altama * 0.1) qty_altama = math.ceil(float(qty_altama)) total_adem = qty_altama - # Qty Stock Vendor - qty_vendor = stock_vendor.quantity - qty_vendor -= int(qty_vendor * 0.1) - qty_vendor = math.ceil(float(qty_vendor)) - total_excell = qty_vendor + if qty_available > 0: qty = qty_available + total_adem + total_excell sla_date = '1 Hari' @@ -53,8 +55,13 @@ class Product(controller.Controller): except: print('error') else: - qty = qty_available - sla_date = product_sla.sla or '-' + if qty_available > 0: + qty = qty_available + sla_date = product_sla.sla or '-' + elif qty_vendor > 0: + qty = total_excell + sla_date = '2-4 Hari' + data = { 'qty': qty, diff --git a/indoteknik_custom/models/user_activity_log.py b/indoteknik_custom/models/user_activity_log.py index cf40258f..9630e3ab 100755 --- a/indoteknik_custom/models/user_activity_log.py +++ b/indoteknik_custom/models/user_activity_log.py @@ -162,7 +162,6 @@ class UserActivityLog(models.Model): activity_logs = self.env['user.activity.log'].search([ ('url', 'ilike', '%/shop/product/%'), ('update_product', '!=', True), - ('url', 'not ilike', 'shopping'), ], limit=1000, order='create_date DESC') for activity_log in activity_logs: diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 4570f43b..ae16f649 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -41,7 +41,7 @@ <field name="carrier_id" required="1"/> <field name="delivery_service_type" readonly="1"/> </field> - <field name="source_id" position="after"> + <field name="medium_id" position="after"> <field name="date_doc_kirim" readonly="1"/> <field name="notification" readonly="1"/> </field> @@ -56,6 +56,10 @@ } </attribute> </xpath> + <field name="source_id" position="attributes"> + <attribute name="domain">[('id', 'in', [32, 59, 60, 61])]</attribute> + <attribute name="required">1</attribute> + </field> <xpath expr="//form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='price_total']" position="after"> <field name="vendor_id" attrs="{'readonly': [('parent.approval_status', '=', 'approved')]}"/> <field name="purchase_price" attrs=" |
