diff options
| author | FIN-IT_AndriFP <andrifebriyadiputra@gmail.com> | 2025-11-24 13:35:20 +0700 |
|---|---|---|
| committer | FIN-IT_AndriFP <andrifebriyadiputra@gmail.com> | 2025-11-24 13:35:20 +0700 |
| commit | 25f4403de98f1494fb1d5952e9eb32bfe3bf061d (patch) | |
| tree | 8d295123e693fcaf92ef4f2e67a858a8c0a5f0cb | |
| parent | 5f4f209e9f04dfc196ef7a8cbc765fad219b15bd (diff) | |
| parent | cd10b3dece04b57bce454ba652dc1bb7662d6456 (diff) | |
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into odoo-backup
| -rw-r--r-- | indoteknik_custom/models/coretax_fatur.py | 10 | ||||
| -rw-r--r-- | indoteknik_custom/models/stock_picking_return.py | 15 | ||||
| -rw-r--r-- | indoteknik_custom/models/tukar_guling.py | 20 | ||||
| -rw-r--r-- | indoteknik_custom/report/purchase_report.xml | 17 | ||||
| -rw-r--r-- | indoteknik_custom/views/account_move_line.xml | 3 |
5 files changed, 45 insertions, 20 deletions
diff --git a/indoteknik_custom/models/coretax_fatur.py b/indoteknik_custom/models/coretax_fatur.py index cabcd5d6..755c5cc3 100644 --- a/indoteknik_custom/models/coretax_fatur.py +++ b/indoteknik_custom/models/coretax_fatur.py @@ -147,7 +147,15 @@ class CoretaxFaktur(models.Model): subtotal = line_price_subtotal quantity = line_quantity total_discount = round(line_discount, 2) - coretax_id = line.product_uom_id.coretax_id + if isinstance(line, dict): + product = line.get('product_id') + uom = product.uom_id if product else False + else: + uom = line.product_uom_id + + coretax_id = uom.coretax_id if uom else '' + + # coretax_id = line.product_uom_id.coretax_id # Calculate other tax values otherTaxBase = round(subtotal * (11 / 12), 2) if subtotal else 0 vat_amount = round(otherTaxBase * 0.12, 2) diff --git a/indoteknik_custom/models/stock_picking_return.py b/indoteknik_custom/models/stock_picking_return.py index 53a85f67..9cf017f9 100644 --- a/indoteknik_custom/models/stock_picking_return.py +++ b/indoteknik_custom/models/stock_picking_return.py @@ -120,8 +120,19 @@ class ReturnPicking(models.TransientModel): 'target': 'current', 'context': context, } - if picking.sale_id or 'SO' in (picking.origin or ''): - _logger.info("This picking is NOT from a PO, fallback to SO.") + # if picking.sale_id or 'SO' in (picking.origin or ''): + # _logger.info("This picking is NOT from a PO, fallback to SO.") + # return { + # 'name': _('Tukar Guling SO'), + # 'type': 'ir.actions.act_window', + # 'res_model': 'tukar.guling', + # 'view_mode': 'form', + # 'target': 'current', + # 'context': context, + # } + + if picking.name and any(k in picking.name.upper() for k in ('PICK', 'OUT')): + _logger.info("Redirect ke Tukar Guling SO via sale_id / origin") return { 'name': _('Tukar Guling SO'), 'type': 'ir.actions.act_window', diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py index aa116ce3..99a74505 100644 --- a/indoteknik_custom/models/tukar_guling.py +++ b/indoteknik_custom/models/tukar_guling.py @@ -737,18 +737,14 @@ class TukarGuling(models.Model): if mapping_koli and record.operations.picking_type_id.id == 29: for prod in mapping_koli.mapped('product_id'): qty_total = sum(mk.qty_return for mk in mapping_koli.filtered(lambda m: m.product_id == prod)) - - move_lines = bu_out.move_line_ids.filtered( - lambda ml: ml.product_id == prod and ml.qty_done > 0 and not ml.package_id - ) - - for ml in move_lines: - srt_return_lines.append((0, 0, { - 'product_id': ml.product_id.id, - 'quantity': ml.qty_done, - 'move_id': ml.move_id.id, - })) - + move = bu_out.move_lines.filtered(lambda m: m.product_id == prod) + if not move: + raise UserError(f"Move BU/OUT tidak ditemukan untuk produk {prod.display_name}") + srt_return_lines.append((0, 0, { + 'product_id': prod.id, + 'quantity': qty_total, + 'move_id': move.id, + })) _logger.info(f"📟 SRT line: {prod.display_name} | qty={qty_total}") elif not mapping_koli and record.operations.picking_type_id.id == 29: diff --git a/indoteknik_custom/report/purchase_report.xml b/indoteknik_custom/report/purchase_report.xml index 208e6472..c51ddc96 100644 --- a/indoteknik_custom/report/purchase_report.xml +++ b/indoteknik_custom/report/purchase_report.xml @@ -61,9 +61,10 @@ <td style="width:50%; border:1px solid #ccc; border-radius:8px; padding:10px; background:#fcfcfc; vertical-align:top;"> <strong style="color:#d32f2f;">Alamat Pengiriman</strong><br/> PT. Indoteknik Dotcom Gemilang<br/> - Jl. Bandengan Utara Komp A 8 B - RT. Penjaringan, Kec. Penjaringan, Jakarta - (BELAKANG INDOMARET)<br/> + Jl. Bandengan Utara Komp A 8 B RT. + Penjaringan, Kec. Penjaringan, Jakarta + (BELAKANG INDOMARET) + <br/> Daerah Khusus Ibukota Jakarta 14440 </td> <td style="width:50%; border:1px solid #ccc; border-radius:8px; padding:10px; background:#fcfcfc; vertical-align:top;"> @@ -97,10 +98,16 @@ <!-- TEKS --> <div style="display:flex; flex-direction:column; flex:1;"> <span style="font-weight:bold; margin-bottom:2px;"> - <t t-esc="line_index + 1"/>. <t t-esc="line.name"/> - <!-- <t t-esc="line_index + 1"/>. <t t-esc="line.product_id.display_name"/> --> + <t t-esc="line_index + 1"/>. + <t t-if="line.product_id.id == 114360"> + <t t-esc="line.name"/> + </t> + <t t-else=""> + <t t-esc="line.product_id.display_name"/> + </t> </span> </div> + </td> <td style="border:1px solid #ccc; padding:6px; text-align:center;"> diff --git a/indoteknik_custom/views/account_move_line.xml b/indoteknik_custom/views/account_move_line.xml index 3a20388e..cb24a0f0 100644 --- a/indoteknik_custom/views/account_move_line.xml +++ b/indoteknik_custom/views/account_move_line.xml @@ -16,6 +16,9 @@ <attribute name="groups"/> <attribute name="options">{'no_create': True}</attribute> </xpath> + <xpath expr="//field[@name='line_ids']/tree/field[@name='partner_id']" position="attributes"> + <attribute name="options">{'no_create': True, 'no_open': True}</attribute> + </xpath> </field> </record> </data> |
