diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-08-04 07:32:55 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-08-04 07:32:55 +0000 |
| commit | e183c3662edc0ac493228c780b42c07eea00cc74 (patch) | |
| tree | 70e396dc08c26e77a94fbbe22edf07e96df88927 | |
| parent | ae7bed568731a6fda0156f2b170ba1bad84624be (diff) | |
| parent | 2421dad6c88900949bc2891bc25006ffa838dd78 (diff) | |
Merged in production (pull request #86)
Production
| -rw-r--r-- | indoteknik_api/controllers/api_v1/sale_order.py | 5 | ||||
| -rw-r--r-- | indoteknik_api/models/product_product.py | 3 | ||||
| -rw-r--r-- | indoteknik_custom/models/apache_solr.py | 1 | ||||
| -rwxr-xr-x | indoteknik_custom/models/crm_lead.py | 17 | ||||
| -rw-r--r-- | indoteknik_custom/views/product_attribute_value.xml | 3 |
5 files changed, 19 insertions, 10 deletions
diff --git a/indoteknik_api/controllers/api_v1/sale_order.py b/indoteknik_api/controllers/api_v1/sale_order.py index cc7fd48f..1ad1ff51 100644 --- a/indoteknik_api/controllers/api_v1/sale_order.py +++ b/indoteknik_api/controllers/api_v1/sale_order.py @@ -276,6 +276,7 @@ class SaleOrder(controller.Controller): 'team_id': 2, 'company_id': 1, 'currency_id': 12, + 'source_id': 59, 'state': 'draft', 'picking_policy': 'direct', 'partner_id': params['value']['partner_id'], @@ -362,9 +363,9 @@ class SaleOrder(controller.Controller): line.amount_voucher_disc = voucher_disc_line voucher_disc_item = voucher_disc_line / line.product_uom_qty - voucher_disc_subtotal = line.price_subtotal - voucher_disc_item + voucher_disc_unit = line.price_unit - voucher_disc_item - line.discount = (line.price_unit - voucher_disc_subtotal) / line.price_unit * 100 + line.discount += (line.price_unit - voucher_disc_unit) / line.price_unit * 100 cart_ids = [x['cart_id'] for x in products] user_cart.browse(cart_ids).unlink() diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py index fb485bae..ff7c6498 100644 --- a/indoteknik_api/models/product_product.py +++ b/indoteknik_api/models/product_product.py @@ -250,6 +250,7 @@ class ProductProduct(models.Model): active_flash_sale = self.env['product.pricelist'].get_active_flash_sale() flashsale_id = 0 flashsale_name = '' + flashsale_tag = '' # loop pricelist items base_price = discount = price_flashsale = 0 for pricelist in active_flash_sale: @@ -261,6 +262,7 @@ class ProductProduct(models.Model): for item in pricelist_items: flashsale_id = pricelist.id flashsale_name = pricelist.name + flashsale_tag = pricelist.flashsale_tag base_price = self._get_website_price_exclude_tax() if item.price_discount > 0: discount = item.price_discount @@ -272,6 +274,7 @@ class ProductProduct(models.Model): data = { 'flashsale_id': flashsale_id, 'flashsale_name': flashsale_name, + 'flashsale_tag': flashsale_tag, 'flashsale_base_price': base_price, 'flashsale_discount': discount, 'flashsale_price': price_flashsale diff --git a/indoteknik_custom/models/apache_solr.py b/indoteknik_custom/models/apache_solr.py index 6211dfc4..086fb6d0 100644 --- a/indoteknik_custom/models/apache_solr.py +++ b/indoteknik_custom/models/apache_solr.py @@ -150,6 +150,7 @@ class ApacheSolr(models.Model): 'search_rank_i': template.search_rank, 'search_rank_weekly_i': template.search_rank_weekly, 'flashsale_id_i': flashsale_data['flashsale_id'] or 0, + 'flashsale_tag_s': flashsale_data['flashsale_tag'] or '', '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, diff --git a/indoteknik_custom/models/crm_lead.py b/indoteknik_custom/models/crm_lead.py index 0cea878a..4efe23c5 100755 --- a/indoteknik_custom/models/crm_lead.py +++ b/indoteknik_custom/models/crm_lead.py @@ -80,12 +80,15 @@ class CrmLead(models.Model): lead.tag_ids = input_tags if not lead.partner_id: - continue - if not lead.user_id or lead.user_id.id == 2 or lead.user_id.id == 25: - if lead.partner_id.parent_id.user_id: - salesperson_id = lead.partner_id.parent_id.user_id.id - elif lead.partner_id.user_id: - salesperson_id = lead.partner_id.user_id.id + salesperson_id = 20 + + if not lead.user_id or lead.user_id.id in [2, 25]: + partner = lead.partner_id.parent_id or lead.partner_id + if partner.user_id and partner.user_id.id not in [2, 25]: + salesperson_id = partner.user_id.id else: salesperson_id = 20 - lead.user_id = salesperson_id + + lead.user_id = salesperson_id + + diff --git a/indoteknik_custom/views/product_attribute_value.xml b/indoteknik_custom/views/product_attribute_value.xml index 7c33ba7b..1e84c21a 100644 --- a/indoteknik_custom/views/product_attribute_value.xml +++ b/indoteknik_custom/views/product_attribute_value.xml @@ -50,6 +50,7 @@ id="menu_product_attribute_value" name="Attribute Values" action="product_attribute_value_action_custom" - parent="sale.prod_config_main" sequence="6" groups="uom.group_uom" + parent="sale.product_menu_catalog" + sequence="8"/> /> </odoo> |
