summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-04-17 11:52:04 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-04-17 11:52:04 +0700
commit015ca8f0ae8ecdaaf388ee08420af54a84fb2d0c (patch)
tree6e95bf27732dc9958ab161363a121bd46d68b717
parent719dc824379bff729a97007432ef6871954b0980 (diff)
parent4eb477f655231e39eaacb4453f216692a8355bac (diff)
Merge branch 'release' into staging
-rw-r--r--indoteknik_api/controllers/api_v1/flash_sale.py51
-rw-r--r--indoteknik_api/models/product_pricelist.py26
-rw-r--r--indoteknik_api/models/product_product.py95
-rwxr-xr-xindoteknik_custom/__manifest__.py4
-rw-r--r--indoteknik_custom/models/apache_solr.py39
-rw-r--r--indoteknik_custom/models/automatic_purchase.py6
-rwxr-xr-xindoteknik_custom/models/crm_lead.py7
-rw-r--r--indoteknik_custom/models/ip_lookup.py39
-rwxr-xr-xindoteknik_custom/models/purchase_order.py6
-rwxr-xr-xindoteknik_custom/models/purchase_order_line.py2
-rw-r--r--indoteknik_custom/models/res_partner.py6
-rwxr-xr-xindoteknik_custom/models/sale_monitoring_detail.py1
-rw-r--r--indoteknik_custom/report/report_picking.xml14
-rwxr-xr-xindoteknik_custom/security/ir.model.access.csv3
-rw-r--r--indoteknik_custom/views/group_partner.xml55
-rwxr-xr-xindoteknik_custom/views/purchase_order.xml6
-rw-r--r--indoteknik_custom/views/res_partner.xml1
17 files changed, 334 insertions, 27 deletions
diff --git a/indoteknik_api/controllers/api_v1/flash_sale.py b/indoteknik_api/controllers/api_v1/flash_sale.py
index ea73ab1b..cad2cb61 100644
--- a/indoteknik_api/controllers/api_v1/flash_sale.py
+++ b/indoteknik_api/controllers/api_v1/flash_sale.py
@@ -10,6 +10,55 @@ _logger = logging.getLogger(__name__)
class FlashSale(controller.Controller):
prefix = '/api/v1/'
+ @http.route(prefix + 'flashsale/header', auth='public', methods=['GET'])
+ @controller.Controller.must_authorized()
+ def _get_flash_sale_header(self, **kw):
+ try:
+ # base_url = request.env['ir.config_parameter'].get_param('web.base.url')
+ active_flash_sale = request.env['product.pricelist'].get_active_flash_sale()
+ data = []
+ for pricelist in active_flash_sale:
+ query = [
+ ('pricelist_id', '=', pricelist.id)
+ ]
+ data.append({
+ 'pricelist_id': pricelist.id,
+ 'option': pricelist.flashsale_option,
+ 'name': pricelist.name,
+ 'banner': request.env['ir.attachment'].api_image('product.pricelist', 'banner', pricelist.id),
+ 'banner_mobile': request.env['ir.attachment'].api_image('product.pricelist', 'banner_mobile', pricelist.id),
+ 'duration': round((pricelist.end_date - datetime.now()).total_seconds()),
+ 'product_total': request.env['product.pricelist.item'].search_count(query),
+ })
+ return self.response(data)
+ except Exception as e:
+ _logger.info(self.prefix + '/flashsale/header: ' + str(e))
+ return self.response(code=500, description='Internal server error')
+
+ @http.route(prefix + 'flashsale/line', auth='public', methods=['GET'])
+ @controller.Controller.must_authorized()
+ def _get_flash_sale_line(self, **kw):
+ try:
+ # base_url = request.env['ir.config_parameter'].get_param('web.base.url')
+ pricelist_id = int(kw.get('pricelist_id'),0)
+ limit = int(kw.get('limit'),0)
+ offset = int(kw.get('offset'),0)
+
+ if pricelist_id == 0 or limit == 0:
+ return self.response(code=500, description='Internal Server error')
+
+ pricelist_items = request.env['product.pricelist.item'].search([('pricelist_id', '=', pricelist_id)], limit=limit, offset=offset)
+ data = {
+ 'total': request.env['product.pricelist.item'].search_count([('pricelist_id', '=', pricelist_id)]),
+ 'products': [request.env['product.pricelist.item'].api_single_response(x) for x in pricelist_items]
+ }
+ return self.response(data)
+
+ except Exception as e:
+ _logger.info(self.prefix + '/flashsale/line: ' + str(e))
+ return self.response(code=500, description='Internal Server error')
+
+
@http.route(prefix + 'flash_sale', auth='public', methods=['GET'])
@controller.Controller.must_authorized()
def get_flash_sale(self, **kw):
@@ -54,6 +103,6 @@ class FlashSale(controller.Controller):
else:
return self.response(code=404, description='Data not found')
except Exception as e:
- _logger.info(self.prefix_url + '/flash_sale: ' + str(e))
+ _logger.info(self.prefix + '/flash_sale: ' + str(e))
return self.response(code=500, description='Internal server error')
\ No newline at end of file
diff --git a/indoteknik_api/models/product_pricelist.py b/indoteknik_api/models/product_pricelist.py
index 4e5c9501..f05fa82d 100644
--- a/indoteknik_api/models/product_pricelist.py
+++ b/indoteknik_api/models/product_pricelist.py
@@ -107,3 +107,29 @@ class ProductPricelist(models.Model):
if product_id in pricelist_product_ids:
return pricelist.id
return False
+
+
+class ProductPricelistItem(models.Model):
+ _inherit = 'product.pricelist.item'
+
+ def api_single_response(self, item):
+ data = {
+ 'id': item.product_id.id,
+ 'parent': {
+ 'id': item.product_id.product_tmpl_id.id,
+ 'name': item.product_id.product_tmpl_id.name,
+ 'image': self.env['ir.attachment'].api_image('product.template', 'image_256', item.product_id.product_tmpl_id.id)
+ },
+ 'code': item.product_id.default_code or item.product_tmpl_id.default_code or '',
+ 'name': item.product_id.display_name,
+ 'price':{
+ 'price': item.product_id._get_website_price_exclude_tax(),
+ 'discount': item.product_id._get_website_disc(0),
+ 'price_discount': item.product_id._get_website_price_after_disc_and_tax()
+ },
+ 'stock': item.product_id.qty_stock_vendor,
+ 'weight': item.product_id.weight,
+ 'attributes': [x.name for x in item.product_id.product_template_attribute_value_ids],
+ 'manufacture': item.product_id.api_manufacture(item.product_id)
+ }
+ return data \ No newline at end of file
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py
index c867eaa0..32bd7c21 100644
--- a/indoteknik_api/models/product_product.py
+++ b/indoteknik_api/models/product_product.py
@@ -62,6 +62,14 @@ class ProductProduct(models.Model):
}
return {}
+ def _is_have_flashsale(self):
+ active_flashsale = self.env['product.pricelist'].get_active_flash_sale()
+ for pricelist in active_flashsale:
+ found_product = self.env['product.pricelist.item'].search([('pricelist_id', '=', pricelist.id), ('product_id', '=', self.id)])
+ if found_product:
+ return True
+ return False
+
def _get_website_price_include_tax(self):
default_pricelist_id = int(1)
@@ -124,3 +132,90 @@ class ProductProduct(models.Model):
price_after_disc = self._get_website_price_after_disc_and_tax()
res = price_after_disc * default_percent_tax / 100
return math.floor(res)
+
+ def _get_pricelist_tier1(self):
+ default_divide_tax = float(1.11)
+ base_price = discount = price = 0
+ pricelist_item = self.env['product.pricelist.item'].search([('pricelist_id', '=', 15037), ('product_id', '=', self.id)], limit=1)
+ if pricelist_item:
+ # base_price = self._get_website_price_exclude_tax()
+ base_price_incl = self._get_website_price_include_tax()
+ discount = pricelist_item.price_discount
+ price = base_price_incl - (base_price_incl * discount / 100)
+ price = price / default_divide_tax
+ price = math.floor(price)
+ data = {
+ # 'base_price_tier1': base_price or 0,
+ 'discount_tier1': discount or 0,
+ 'price_tier1': price or 0
+ }
+ return data
+
+ def _get_pricelist_tier2(self):
+ default_divide_tax = float(1.11)
+ base_price = discount = price = 0
+ pricelist_item = self.env['product.pricelist.item'].search([('pricelist_id', '=', 15038), ('product_id', '=', self.id)], limit=1)
+ if pricelist_item:
+ # base_price = self._get_website_price_exclude_tax()
+ base_price_incl = self._get_website_price_include_tax()
+ discount = pricelist_item.price_discount
+ price = base_price_incl - (base_price_incl * discount / 100)
+ price = price / default_divide_tax
+ price = math.floor(price)
+ data = {
+ # 'base_price_tier2': base_price or 0,
+ 'discount_tier2': discount or 0,
+ 'price_tier2': price or 0
+ }
+ return data
+
+ def _get_pricelist_tier3(self):
+ default_divide_tax = float(1.11)
+ base_price = discount = price = 0
+ pricelist_item = self.env['product.pricelist.item'].search([('pricelist_id', '=', 15039), ('product_id', '=', self.id)], limit=1)
+ if pricelist_item:
+ # base_price = self._get_website_price_exclude_tax()
+ base_price_incl = self._get_website_price_include_tax()
+ discount = pricelist_item.price_discount
+ price = base_price_incl - (base_price_incl * discount / 100)
+ price = price / default_divide_tax
+ price = math.floor(price)
+ data = {
+ # 'base_price_tier3': base_price or 0,
+ 'discount_tier3': discount or 0,
+ 'price_tier3': price or 0
+ }
+ return data
+
+ def _get_flashsale_price(self):
+ # must get active pricelist
+ active_flash_sale = self.env['product.pricelist'].get_active_flash_sale()
+ flashsale_id = 0
+ flashsale_name = ''
+ # loop pricelist items
+ base_price = discount = price_flashsale = 0
+ for pricelist in active_flash_sale:
+ query = [
+ ('pricelist_id', '=', pricelist.id),
+ ('product_id', '=', self.id),
+ ]
+ pricelist_items = self.env['product.pricelist.item'].search(query, limit=1)
+ for item in pricelist_items:
+ flashsale_id = pricelist.id
+ flashsale_name = pricelist.name
+ base_price = self._get_website_price_exclude_tax()
+ if item.price_discount > 0:
+ discount = item.price_discount
+ # base_item = self.env['product.pricelist.item'].search([('pricelist_id', '=', item.base_pricelist_id.id), ('product_id', '=', self.id)], limit=1)
+ price_flashsale = base_price - (base_price * discount // 100)
+ elif item.fixed_price > 0:
+ price_flashsale = item.fixed_price # ask darren for include or exclude
+ discount = (base_price - price_flashsale) // base_price * 100
+ data = {
+ 'flashsale_id': flashsale_id,
+ 'flashsale_name': flashsale_name,
+ 'flashsale_base_price': base_price,
+ 'flashsale_discount': discount,
+ 'flashsale_price': price_flashsale
+ }
+ return data
diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py
index 5873d73a..e2c6eedd 100755
--- a/indoteknik_custom/__manifest__.py
+++ b/indoteknik_custom/__manifest__.py
@@ -11,6 +11,7 @@
'depends': ['base', 'coupon', 'delivery', 'sale', 'sale_management', 'vit_kelurahan'],
'data': [
'security/ir.model.access.csv',
+ 'views/group_partner.xml',
'views/blog_post.xml',
'views/coupon_program.xml',
'views/delivery_order.xml',
@@ -73,7 +74,8 @@
'report/report_banner_banner.xml',
'report/report_banner_banner2.xml',
'report/purchase_order.xml',
- 'report/report_invoice.xml'
+ 'report/report_invoice.xml',
+ 'report/report_picking.xml'
],
'demo': [],
'css': [],
diff --git a/indoteknik_custom/models/apache_solr.py b/indoteknik_custom/models/apache_solr.py
index 3ed431ef..ee166002 100644
--- a/indoteknik_custom/models/apache_solr.py
+++ b/indoteknik_custom/models/apache_solr.py
@@ -13,9 +13,10 @@ class ApacheSolr(models.Model):
_order = 'id desc'
def _sync_product_to_solr(self, limit = 500):
+ # _solr = pysolr.Solr('http://10.148.0.5:8983/solr/product/', always_commit=True, timeout=30)
+ _solr = pysolr.Solr('http://192.168.23.5:8983/solr/product/', always_commit=True, timeout=30)
start_time = time.time()
_logger.info('run sync to solr...')
- solr = pysolr.Solr('http://10.148.0.5:8983/solr/product/', always_commit=True, timeout=30)
query = ["&","&",("type","=","product"),("active","=",True),"|",("solr_flag","=",0),("solr_flag","=",2)]
templates = self.env['product.template'].search(query, limit=limit)
@@ -25,23 +26,28 @@ class ApacheSolr(models.Model):
counter += 1
price_excl_after_disc = price_excl = discount = tax = 0
variants_name = variants_code = ''
+ flashsale_data = tier1 = tier2 = tier3 = {}
if template.product_variant_count > 1:
for variant in template.product_variant_ids:
- if price_excl_after_disc == 0:
+ if price_excl_after_disc == 0 or variant._get_website_price_after_disc_and_tax() < price_excl_after_disc:
price_excl = variant._get_website_price_exclude_tax()
price_excl_after_disc = variant._get_website_price_after_disc_and_tax()
discount = variant._get_website_disc(0)
tax = variant._get_website_tax()
- elif variant._get_website_price_after_disc_and_tax() < price_excl_after_disc:
- price_excl_after_disc = variant._get_website_price_after_disc_and_tax()
- price_excl = variant._get_website_price_exclude_tax()
- discount = variant._get_website_disc(0)
- tax = variant._get_website_tax()
+ flashsale_data = variant._get_flashsale_price()
+ # add price tiering for base price, discount, and price after discount (tier 1 - 3)
+ tier1 = variant._get_pricelist_tier1()
+ tier2 = variant._get_pricelist_tier2()
+ tier3 = variant._get_pricelist_tier3()
else:
price_excl_after_disc = price_excl_after_disc
price_excl = price_excl
discount = discount
tax = tax
+ flashsale_data = flashsale_data
+ tier1 = tier1
+ tier2 = tier2
+ tier3 = tier3
variants_name += variant.display_name or ''+', '
variants_code += variant.default_code or ''+', '
else:
@@ -49,6 +55,10 @@ class ApacheSolr(models.Model):
discount = template.product_variant_id._get_website_disc(0)
price_excl_after_disc = template.product_variant_id._get_website_price_after_disc_and_tax()
tax = template.product_variant_id._get_website_tax()
+ flashsale_data = template.product_variant_id._get_flashsale_price()
+ tier1 = template.product_variant_id._get_pricelist_tier1()
+ tier2 = template.product_variant_id._get_pricelist_tier2()
+ tier3 = template.product_variant_id._get_pricelist_tier3()
category_id = ''
category_name = ''
@@ -82,13 +92,24 @@ class ApacheSolr(models.Model):
'variants_name_t': variants_name,
'variants_code_t': variants_code,
'search_rank_i': template.search_rank,
- 'search_rank_weekly_i': template.search_rank_weekly
+ 'search_rank_weekly_i': template.search_rank_weekly,
+ 'flashsale_id_i': flashsale_data['flashsale_id'] or 0,
+ 'flashsale_name_s': flashsale_data['flashsale_name'] or '',
+ 'flashsale_base_price_f': flashsale_data['flashsale_base_price'] or 0,
+ 'flashsale_discount_f': flashsale_data['flashsale_discount'] or 0,
+ 'flashsale_price_f': flashsale_data['flashsale_price'] or 0,
+ 'discount_tier1_f': tier1['discount_tier1'] or 0,
+ 'price_tier1_f': tier1['price_tier1'] or 0,
+ 'discount_tier2_f': tier2['discount_tier2'] or 0,
+ 'price_tier2_f': tier2['price_tier2'] or 0,
+ 'discount_tier3_f': tier3['discount_tier3'] or 0,
+ 'price_tier3_f': tier3['price_tier3'] or 0
}
documents.append(document)
template.solr_flag = 1
# add counter for monitoring
_logger.info('[SYNC_PRODUCT_TO_SOLR] %s/%i' % (counter, limit))
_logger.info('[SYNC_PRODUCT_TO_SOLR] Success add to solr product %s' % template.id)
- solr.add(documents)
+ _solr.add(documents)
end_time = time.time()
_logger.info("[SYNC_PRODUCT_TO_SOLR] Finish task add to solr. Time taken: {:.6f} seconds".format(end_time - start_time))
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py
index 60444b6a..eea66b99 100644
--- a/indoteknik_custom/models/automatic_purchase.py
+++ b/indoteknik_custom/models/automatic_purchase.py
@@ -45,7 +45,7 @@ class AutomaticPurchase(models.Model):
], order='brand_id')
count = brand_id = 0
for product in products_vendors:
- if vendor.id == 5571 and (count == 200 or brand_id != product.brand_id.id):
+ if count == 200 or brand_id != product.brand_id.id:
count = 0
counter_po_number += 1
new_po = self.env['purchase.order'].create([param_header])
@@ -55,8 +55,8 @@ class AutomaticPurchase(models.Model):
'order_id': new_po.id
}])
self.env.cr.commit()
- else:
- new_po = self.env['purchase.order'].create([param_header])
+ # else:
+ # new_po = self.env['purchase.order'].create([param_header])
brand_id = product.brand_id.id
count += 10
param_line = {
diff --git a/indoteknik_custom/models/crm_lead.py b/indoteknik_custom/models/crm_lead.py
index b34183d8..1f37005d 100755
--- a/indoteknik_custom/models/crm_lead.py
+++ b/indoteknik_custom/models/crm_lead.py
@@ -46,6 +46,7 @@ class CrmLead(models.Model):
('active', '=', True),
('type', '=', 'lead'),
('tag_ids', '=', False),
+ # ('id', '=', 12523)
], limit=1000)
for lead in leads:
tags = self.env['crm.tag'].search([('id', '>', 0)])
@@ -57,9 +58,9 @@ class CrmLead(models.Model):
if not lead.partner_id:
continue
- if not lead.user_id or lead.user_id == 2:
+ if not lead.user_id or lead.user_id.id == 2:
if lead.partner_id.parent_id:
- salesperson_id = lead.partner_id.parent_id.user_id
+ salesperson_id = lead.partner_id.parent_id.user_id.id
else:
- salesperson_id = lead.partner_id.user_id
+ salesperson_id = lead.partner_id.user_id.id
lead.user_id = salesperson_id
diff --git a/indoteknik_custom/models/ip_lookup.py b/indoteknik_custom/models/ip_lookup.py
index 0fbb03ea..a708cd94 100644
--- a/indoteknik_custom/models/ip_lookup.py
+++ b/indoteknik_custom/models/ip_lookup.py
@@ -41,12 +41,40 @@ class IpLookup(models.Model):
logs = self.env['ip.lookup.line'].search(domain, limit=45, order='create_date asc')
for log in logs:
try:
- ipinfo = requests.get('http://ip-api.com/json/%s' % log.ip_address).json()
- del ipinfo['status']
- log.lookup = json.dumps(ipinfo, indent=4, sort_keys=True)
+ query = [
+ ('ip_address', '=', log.ip_address),
+ ('lookup', '!=', False)
+ ]
+ last_data = self.env['ip.lookup.line'].search(query, limit=1)
+ if last_data:
+ log.lookup = last_data.lookup
+ country = json.loads(last_data.lookup)['country']
+ timezone = json.loads(last_data.lookup)['timezone']
+ _logger.info('Parsing IP using last data %s' % log.id)
+ else:
+ ipinfo = requests.get('http://ip-api.com/json/%s' % log.ip_address).json()
+ del ipinfo['status']
+ lookup_json = json.dumps(ipinfo, indent=4, sort_keys=True)
+ log.lookup = lookup_json
+ country = json.loads(lookup_json)['country']
+ timezone = json.loads(lookup_json)['timezone']
+ _logger.info('Parsing IP using API JSON %s' % log.id)
+ log.country = country
+ log.timezone = timezone
+ log.continent = timezone.split('/')[0]
except:
- log.lookup = ''
+ # log.lookup = ''
+ _logger.info('Failed parsing IP Lookup Line %s' % log.id)
+ def _load_info_address_lookup(self):
+ lines = self.env['ip.lookup.line'].search([('country', '=', False), ('lookup', '!=', False)], limit=500)
+ for line in lines:
+ line.country = json.loads(line.lookup)['country']
+ timezone = json.loads(line.lookup)['timezone']
+ continent = timezone.split('/')[0]
+ line.timezone = timezone
+ line.continent = continent
+ _logger.info('Success parsing ip lookup line id %s' % line.id)
class IpLookupLine(models.Model):
_name = 'ip.lookup.line'
@@ -56,4 +84,5 @@ class IpLookupLine(models.Model):
ip_address = fields.Char(string='IP Address')
lookup = fields.Char(string='Lookup')
country = fields.Char(string='Country')
-
+ timezone = fields.Char(string='Timezone')
+ continent = fields.Char(string='Continent', help='diparsing dari field timezone')
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 0ef6a9f2..8809d048 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -139,11 +139,17 @@ class PurchaseOrder(models.Model):
self.order_line.unlink()
for order_line in self.sale_order_id.order_line:
if order_line.product_id.id and order_line.product_id.id not in products_exception:
+ qty_available = order_line.product_id.virtual_available
+ suggest = 'harus beli'
+ if order_line.product_id.virtual_available > order_line.product_qty:
+ suggest = 'masih cukup'
values = {
'order_id': self.id,
'product_id': order_line.product_id.id,
'name': order_line.product_id.display_name,
'product_qty': order_line.product_qty,
+ 'qty_available_store': qty_available,
+ 'suggest': suggest,
}
self.env['purchase.order.line'].sudo().create(values)
diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py
index 8439df5d..f255095f 100755
--- a/indoteknik_custom/models/purchase_order_line.py
+++ b/indoteknik_custom/models/purchase_order_line.py
@@ -26,6 +26,8 @@ class PurchaseOrderLine(models.Model):
qty_onhand = fields.Float('Qty On Hand', compute='compute_qty_stock')
qty_incoming = fields.Float('Qty Incoming', compute='compute_qty_stock')
qty_outgoing = fields.Float('Qty Outgoing', compute='compute_qty_stock')
+ qty_available_store = fields.Float(string='Available')
+ suggest = fields.Char(string='Suggest')
def compute_qty_stock(self):
for line in self:
diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py
index ad88957f..eaf93717 100644
--- a/indoteknik_custom/models/res_partner.py
+++ b/indoteknik_custom/models/res_partner.py
@@ -1,5 +1,9 @@
from odoo import models, fields
+class GroupPartner(models.Model):
+ _name = 'group.partner'
+
+ name = fields.Char(string='Name')
class ResPartner(models.Model):
_inherit = 'res.partner'
@@ -7,3 +11,5 @@ class ResPartner(models.Model):
reference_number = fields.Char(string="Reference Number")
company_type_id = fields.Many2one('res.partner.company_type', string='Company Type')
custom_pricelist_id = fields.Many2one('product.pricelist', string='Price Matrix')
+ group_partner_id = fields.Many2one('group.partner', string='Group Partner')
+
diff --git a/indoteknik_custom/models/sale_monitoring_detail.py b/indoteknik_custom/models/sale_monitoring_detail.py
index 553ec21f..82bd5c48 100755
--- a/indoteknik_custom/models/sale_monitoring_detail.py
+++ b/indoteknik_custom/models/sale_monitoring_detail.py
@@ -76,6 +76,7 @@ class SaleMonitoringDetail(models.Model):
WHERE pt.type IN ('consu','product')
AND so.state IN ('sale','done')
AND so.create_date >= '2022-08-10'
+ and sol.product_uom_qty > get_qty_available(sol.product_id)
) a
WHERE
a.qty_so_delivered > a.qty_so_invoiced
diff --git a/indoteknik_custom/report/report_picking.xml b/indoteknik_custom/report/report_picking.xml
new file mode 100644
index 00000000..86cad03f
--- /dev/null
+++ b/indoteknik_custom/report/report_picking.xml
@@ -0,0 +1,14 @@
+<odoo>
+ <template id="report_picking_inherit" inherit_id="stock.report_picking">
+ <xpath expr="t/t/t/div/table/thead/tr/th[@name='th_from']" position="before">
+ <th name="th_from" align="left">
+ <strong>OnHand</strong>
+ </th>
+ </xpath>
+ <xpath expr="t/t/t/div/table/tbody/t/t/tr/td[2]" position="after">
+ <td>
+ <span t-field="ml.product_id.qty_available"/>
+ </td>
+ </xpath>
+ </template>
+</odoo>
diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv
index 1788c77f..f7de6d3f 100755
--- a/indoteknik_custom/security/ir.model.access.csv
+++ b/indoteknik_custom/security/ir.model.access.csv
@@ -44,4 +44,5 @@ access_uangmuka_pembelian,access.uangmuka.pembelian,model_uangmuka_pembelian,,1,
access_automatic_purchase,access.automatic.purchase,model_automatic_purchase,,1,1,1,1
access_automatic_purchase_line,access.automatic.purchase.line,model_automatic_purchase_line,,1,1,1,1
access_automatic_purchase_match,access.automatic.purchase.match,model_automatic_purchase_match,,1,1,1,1
-access_apache_solr,access.apache.solr,model_apache_solr,,1,1,1,1 \ No newline at end of file
+access_apache_solr,access.apache.solr,model_apache_solr,,1,1,1,1
+access_group_partner,access.group.partner,model_group_partner,,1,1,1,1 \ No newline at end of file
diff --git a/indoteknik_custom/views/group_partner.xml b/indoteknik_custom/views/group_partner.xml
new file mode 100644
index 00000000..4d5fd923
--- /dev/null
+++ b/indoteknik_custom/views/group_partner.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<odoo>
+ <record id="group_partner_tree" model="ir.ui.view">
+ <field name="name">group.partner.tree</field>
+ <field name="model">group.partner</field>
+ <field name="arch" type="xml">
+ <tree>
+ <field name="name"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="group_partner_form" model="ir.ui.view">
+ <field name="name">group.partner.form</field>
+ <field name="model">group.partner</field>
+ <field name="arch" type="xml">
+ <form>
+ <sheet>
+ <group>
+ <group>
+ <field name="name"/>
+ </group>
+ </group>
+ </sheet>
+ </form>
+ </field>
+ </record>
+
+ <record id="view_group_partner_filter" model="ir.ui.view">
+ <field name="name">group.partner.list.select</field>
+ <field name="model">group.partner</field>
+ <field name="priority" eval="15"/>
+ <field name="arch" type="xml">
+ <search string="Search Name">
+ <field name="name"/>
+ </search>
+ </field>
+ </record>
+
+ <record id="group_partner_action" model="ir.actions.act_window">
+ <field name="name">Group Partner</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">group.partner</field>
+ <field name="search_view_id" ref="view_group_partner_filter"/>
+ <field name="view_mode">tree,form</field>
+ </record>
+
+ <menuitem
+ id="menu_group_partner"
+ name="Group Partner"
+ parent="contacts.res_partner_menu_config"
+ sequence="5"
+ action="group_partner_action"
+ />
+</odoo> \ No newline at end of file
diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml
index fb85f4c1..eb5267e0 100755
--- a/indoteknik_custom/views/purchase_order.xml
+++ b/indoteknik_custom/views/purchase_order.xml
@@ -46,10 +46,8 @@
<field name="line_no" attrs="{'readonly': 1}"/>
</field>
<field name="product_qty" position="before">
- <field name="qty_onhand"/>
- <field name="qty_incoming"/>
- <field name="qty_outgoing"/>
- <field name="qty_available"/>
+ <field name="qty_available_store"/>
+ <field name="suggest"/>
</field>
<page name="purchase_delivery_invoice" position="after">
<page name="purchase_vendor_bills" string="Vendor Bills" groups="indoteknik_custom.technical_administrator">
diff --git a/indoteknik_custom/views/res_partner.xml b/indoteknik_custom/views/res_partner.xml
index 47f41ab2..a9372da0 100644
--- a/indoteknik_custom/views/res_partner.xml
+++ b/indoteknik_custom/views/res_partner.xml
@@ -11,6 +11,7 @@
</field>
<field name="industry_id" position="after">
<field name="company_type_id"/>
+ <field name="group_partner_id"/>
</field>
</field>
</record>