diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-28 16:26:16 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-28 16:26:16 +0700 |
| commit | f704fbd43aac910fb5b2023ad2d61eac918acebc (patch) | |
| tree | 2a78ed4af3874965e721b22e323896ba612c9fc7 | |
| parent | 5eddde4da5740afa752ce997d5c95b43b4131218 (diff) | |
| parent | 0eba3c4c50ecda45e90ba5e8199afd30fe4a6214 (diff) | |
Merge branch 'release' of bitbucket.org:altafixco/indoteknik-addons into release
| -rw-r--r-- | indoteknik_api/controllers/api_v1/flash_sale.py | 1 | ||||
| -rw-r--r-- | indoteknik_api/controllers/api_v1/sale_order.py | 4 | ||||
| -rwxr-xr-x | indoteknik_custom/__manifest__.py | 1 | ||||
| -rw-r--r-- | indoteknik_custom/models/apache_solr.py | 1 | ||||
| -rw-r--r-- | indoteknik_custom/models/product_pricelist.py | 1 | ||||
| -rw-r--r-- | indoteknik_custom/models/uangmuka_pembelian.py | 12 | ||||
| -rw-r--r-- | indoteknik_custom/models/uangmuka_penjualan.py | 12 | ||||
| -rw-r--r-- | indoteknik_custom/views/product_pricelist.xml | 3 | ||||
| -rw-r--r-- | indoteknik_custom/views/product_product.xml | 16 |
9 files changed, 41 insertions, 10 deletions
diff --git a/indoteknik_api/controllers/api_v1/flash_sale.py b/indoteknik_api/controllers/api_v1/flash_sale.py index a0aaa44e..dc7c3928 100644 --- a/indoteknik_api/controllers/api_v1/flash_sale.py +++ b/indoteknik_api/controllers/api_v1/flash_sale.py @@ -27,6 +27,7 @@ class FlashSale(controller.Controller): '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), + 'banner_top': request.env['ir.attachment'].api_image('product.pricelist', 'banner_top', pricelist.id), 'duration': round((pricelist.end_date - datetime.now()).total_seconds()), 'product_total': request.env['product.pricelist.item'].search_count(query), }) diff --git a/indoteknik_api/controllers/api_v1/sale_order.py b/indoteknik_api/controllers/api_v1/sale_order.py index 425dd296..18004175 100644 --- a/indoteknik_api/controllers/api_v1/sale_order.py +++ b/indoteknik_api/controllers/api_v1/sale_order.py @@ -65,9 +65,9 @@ class SaleOrder(controller.Controller): context = params['value']['context'] if context == 'quotation': - domain += [('approval_status', '=', False)] + domain += ["|","|",("state","=","draft"),("state","=","sent"),("state","=","cancel")] if not context: - domain += [('approval_status', '!=', False)] + domain += ["|",("state","=","sale"),("state","=","done")] if params['value']['name']: name = params['value']['name'].replace(' ', '%') diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py index df74375f..c6b20e38 100755 --- a/indoteknik_custom/__manifest__.py +++ b/indoteknik_custom/__manifest__.py @@ -72,6 +72,7 @@ 'views/automatic_purchase.xml', 'views/raja_ongkir.xml', 'views/procurement_monitoring_detail.xml', + 'views/product_product.xml', 'report/report.xml', 'report/report_banner_banner.xml', 'report/report_banner_banner2.xml', diff --git a/indoteknik_custom/models/apache_solr.py b/indoteknik_custom/models/apache_solr.py index 4f30d6f6..ebe516a0 100644 --- a/indoteknik_custom/models/apache_solr.py +++ b/indoteknik_custom/models/apache_solr.py @@ -52,6 +52,7 @@ class ApacheSolr(models.Model): variants_name += variant.display_name or ''+', ' variants_code += variant.default_code or ''+', ' else: + variants_name = template.display_name price_excl = template.product_variant_id._get_website_price_exclude_tax() discount = template.product_variant_id._get_website_disc(0) price_excl_after_disc = template.product_variant_id._get_website_price_after_disc_and_tax() diff --git a/indoteknik_custom/models/product_pricelist.py b/indoteknik_custom/models/product_pricelist.py index a309945d..2edaeb80 100644 --- a/indoteknik_custom/models/product_pricelist.py +++ b/indoteknik_custom/models/product_pricelist.py @@ -14,6 +14,7 @@ class ProductPricelist(models.Model): ('all', 'For All User'), ('registered_user', 'Only for Registered User') ], string='Flashsale Option') + banner_top = fields.Binary(string='Banner Top') class ProductPricelistItem(models.Model): diff --git a/indoteknik_custom/models/uangmuka_pembelian.py b/indoteknik_custom/models/uangmuka_pembelian.py index 797d7a01..26a003fd 100644 --- a/indoteknik_custom/models/uangmuka_pembelian.py +++ b/indoteknik_custom/models/uangmuka_pembelian.py @@ -50,11 +50,15 @@ class UangmukaPembelian(models.TransientModel): account_move = request.env['account.move'].create([param_header]) _logger.info('Success Create Uang Muka Pembelian %s' % account_move.name) + if order.partner_id.parent_id: + partner_id = order.partner_id.parent_id.id + else: + partner_id = order.partner_id.id param_debit = { 'move_id': account_move.id, 'account_id': 401, # uang muka persediaan barang dagang - 'partner_id': order.partner_id.id, + 'partner_id': partner_id, 'currency_id': 12, 'debit': self.pay_amt, 'credit': 0, @@ -63,7 +67,7 @@ class UangmukaPembelian(models.TransientModel): param_debit_ongkir = { 'move_id': account_move.id, 'account_id': 536, # biaya ongkos kirim - 'partner_id': order.partner_id.id, + 'partner_id': partner_id, 'currency_id': 12, 'debit': self.ongkir_amt, 'credit': 0, @@ -72,7 +76,7 @@ class UangmukaPembelian(models.TransientModel): param_debit_selisih = { 'move_id': account_move.id, 'account_id': 561, # selisih pembayaran - 'partner_id': order.partner_id.id, + 'partner_id': partner_id, 'currency_id': 12, 'debit': self.selisih_amt, 'credit': 0, @@ -82,7 +86,7 @@ class UangmukaPembelian(models.TransientModel): param_credit = { 'move_id': account_move.id, 'account_id': self.account_id.id, # bank in transit - 'partner_id': order.partner_id.id, + 'partner_id': partner_id, 'currency_id': 12, 'debit': 0, 'credit': self.pay_amt + self.ongkir_amt + self.selisih_amt, diff --git a/indoteknik_custom/models/uangmuka_penjualan.py b/indoteknik_custom/models/uangmuka_penjualan.py index ef0e9196..93a33b52 100644 --- a/indoteknik_custom/models/uangmuka_penjualan.py +++ b/indoteknik_custom/models/uangmuka_penjualan.py @@ -53,11 +53,15 @@ class UangmukaPenjualan(models.TransientModel): account_move = request.env['account.move'].create([param_header]) _logger.info('Success Create Uang Muka Penjualan %s' % account_move.name) + if order.partner_id.parent_id: + partner_id = order.partner_id.parent_id.id + else: + partner_id = order.partner_id.id param_debit = { 'move_id': account_move.id, 'account_id': self.account_id.id, # intransit - 'partner_id': order.partner_id.id, + 'partner_id': partner_id, 'currency_id': 12, 'debit': self.pay_amt + self.ongkir_amt + self.selisih_amt, 'credit': 0, @@ -67,7 +71,7 @@ class UangmukaPenjualan(models.TransientModel): param_credit = { 'move_id': account_move.id, 'account_id': 449, # uang muka penjualan - 'partner_id': order.partner_id.id, + 'partner_id': partner_id, 'currency_id': 12, 'debit': 0, 'credit': self.pay_amt, @@ -76,7 +80,7 @@ class UangmukaPenjualan(models.TransientModel): param_ongkir_credit = { 'move_id': account_move.id, 'account_id': 550, # pendapatan ongkos kirim - 'partner_id': order.partner_id.id, + 'partner_id': partner_id, 'currency_id': 12, 'debit': 0, 'credit': self.ongkir_amt, @@ -85,7 +89,7 @@ class UangmukaPenjualan(models.TransientModel): param_selisih_credit = { 'move_id': account_move.id, 'account_id': 561, # selisih pembayaran - 'partner_id': order.partner_id.id, + 'partner_id': partner_id, 'currency_id': 12, 'debit': 0, 'credit': self.selisih_amt, diff --git a/indoteknik_custom/views/product_pricelist.xml b/indoteknik_custom/views/product_pricelist.xml index 4cf06e18..0ad9e200 100644 --- a/indoteknik_custom/views/product_pricelist.xml +++ b/indoteknik_custom/views/product_pricelist.xml @@ -17,6 +17,9 @@ <field name="banner_mobile" widget="image" attrs="{ 'invisible': [('is_flash_sale', '=', False)] }" /> + <field name="banner_top" widget="image" attrs="{ + 'invisible': [('is_flash_sale', '=', False)] + }" /> <field name="start_date" attrs="{ 'invisible': [('is_flash_sale', '=', False)], 'required': [('is_flash_sale', '=', True)] diff --git a/indoteknik_custom/views/product_product.xml b/indoteknik_custom/views/product_product.xml new file mode 100644 index 00000000..d3ef3e15 --- /dev/null +++ b/indoteknik_custom/views/product_product.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<odoo> + <data> + <record id="product_product_tree_inherit" model="ir.ui.view"> + <field name="name">Product Product</field> + <field name="model">product.product</field> + <field name="inherit_id" ref="product.product_product_tree_view"/> + <field name="arch" type="xml"> + <field name="qty_available" position="after"> + <field name="outgoing_qty"/> + <field name="incoming_qty"/> + </field> + </field> + </record> + </data> +</odoo>
\ No newline at end of file |
