diff options
| -rw-r--r-- | indoteknik_api/controllers/api_v1/cart.py | 35 | ||||
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 19 | ||||
| -rw-r--r-- | indoteknik_custom/models/commision.py | 4 | ||||
| -rw-r--r-- | indoteknik_custom/models/invoice_reklas.py | 112 | ||||
| -rw-r--r-- | indoteknik_custom/models/invoice_reklas_penjualan.py | 60 | ||||
| -rw-r--r-- | indoteknik_custom/models/mail_mail.py | 2 | ||||
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 24 | ||||
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 42 | ||||
| -rw-r--r-- | indoteknik_custom/models/shipment_group.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 10 | ||||
| -rw-r--r-- | indoteknik_custom/models/uangmuka_pembelian.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/views/account_move.xml | 8 | ||||
| -rwxr-xr-x | indoteknik_custom/views/purchase_order.xml | 15 | ||||
| -rwxr-xr-x | indoteknik_custom/views/x_manufactures.xml | 40 |
14 files changed, 298 insertions, 77 deletions
diff --git a/indoteknik_api/controllers/api_v1/cart.py b/indoteknik_api/controllers/api_v1/cart.py index 7a40b1e2..fdc237cf 100644 --- a/indoteknik_api/controllers/api_v1/cart.py +++ b/indoteknik_api/controllers/api_v1/cart.py @@ -16,24 +16,31 @@ class Cart(controller.Controller): offset = int(kw.get('offset', 0)) query = [('user_id', '=', user_id)] carts = user_cart.search(query, limit=limit, offset=offset, order='create_date desc') - # carts.write({'source': 'add_to_cart'}) + products = [] products_inactive = [] + for cart in carts: - if cart.product_id: - price = cart.product_id._v2_get_website_price_include_tax() - if cart.product_id.active and price > 0: - product = cart.with_context(price_for="web").get_products() - for product_active in product: - products.append(product_active) + try: + if cart.product_id: + price = cart.product_id._v2_get_website_price_include_tax() + + if cart.product_id.active and price > 0: + product = cart.with_context(price_for="web").get_products() + for product_active in product: + products.append(product_active) + else: + product_inactives = cart.with_context(price_for="web").get_products() + for inactives in product_inactives: + products_inactive.append(inactives) else: - product_inactives = cart.with_context(price_for="web").get_products() - for inactives in product_inactives: - products_inactive.append(inactives) - else: - program = cart.with_context(price_for="web").get_products() - for programs in program: - products.append(programs) + program = cart.with_context(price_for="web").get_products() + for programs in program: + products.append(programs) + + except Exception as e: + continue + data = { 'product_total': user_cart.search_count(query), 'products': products, diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 30de67be..54eaabcf 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -67,6 +67,25 @@ class AccountMove(models.Model): is_hr = fields.Boolean(string="Is HR?", default=False) purchase_order_id = fields.Many2one('purchase.order', string='Purchase Order') length_of_payment = fields.Integer(string="Length of Payment", compute='compute_length_of_payment') + reklas_misc_id = fields.Many2one('account.move', string='Journal Entries Reklas') + # Di model account.move + bill_id = fields.Many2one('account.move', string='Vendor Bill', domain=[('move_type', '=', 'in_invoice')], help='Bill asal dari proses reklas ini') + + + # def name_get(self): + # result = [] + # for move in self: + # if move.move_type == 'entry': + # # Jika masih draft, tampilkan 'Draft CAB' + # if move.state == 'draft': + # label = 'Draft CAB' + # else: + # label = move.name + # result.append((move.id, label)) + # else: + # # Untuk invoice dan lainnya, pakai default + # result.append((move.id, move.display_name)) + # return result def compute_length_of_payment(self): for rec in self: diff --git a/indoteknik_custom/models/commision.py b/indoteknik_custom/models/commision.py index eeaa8efc..842e64bf 100644 --- a/indoteknik_custom/models/commision.py +++ b/indoteknik_custom/models/commision.py @@ -354,12 +354,12 @@ class CustomerCommision(models.Model): if not self.status or self.status == 'draft': self.status = 'pengajuan1' - elif self.status == 'pengajuan1' and self.env.user.is_sales_manager: + elif self.status == 'pengajuan1' and self.env.user.id == 19: self.status = 'pengajuan2' self.approved_by = (self.approved_by + ', ' if self.approved_by else '') + self.env.user.name self.date_approved_sales = now_naive self.position_sales = 'Sales Manager' - elif self.status == 'pengajuan2' and self.env.user.id == 19: + elif self.status == 'pengajuan2' and self.env.user.id == 216: self.status = 'pengajuan3' self.approved_by = (self.approved_by + ', ' if self.approved_by else '') + self.env.user.name self.date_approved_marketing = now_naive diff --git a/indoteknik_custom/models/invoice_reklas.py b/indoteknik_custom/models/invoice_reklas.py index d10d4c31..5145e098 100644 --- a/indoteknik_custom/models/invoice_reklas.py +++ b/indoteknik_custom/models/invoice_reklas.py @@ -11,7 +11,7 @@ _logger = logging.getLogger(__name__) class InvoiceReklas(models.TransientModel): _name = 'invoice.reklas' _description = "digunakan untuk reklas Uang Muka Penjualan" - reklas_id = fields.Many2one('account.move', string='Nomor CAB') + reklas_id = fields.Many2one('account.move', string='Nomor CAB', domain="[('move_type','=','entry')]") pay_amt = fields.Float(string='Yang dibayarkan') reklas_type = fields.Selection([ ('penjualan', 'Penjualan'), @@ -20,42 +20,105 @@ class InvoiceReklas(models.TransientModel): @api.onchange('reklas_type') def _onchange_reklas_type(self): - if self.reklas_type == 'penjualan': - invoices = self.env['account.move'].browse(self._context.get('active_ids', [])) - self.pay_amt = invoices.amount_total + active_ids = self._context.get('active_ids', []) + if not active_ids: + return + + move = self.env['account.move'].browse(active_ids[0]) + cab = False + + # Deteksi dari mana asal CAB + if move.move_type == 'entry': + cab = move + elif move.move_type == 'in_invoice': + if move.reklas_misc_id: + cab = move.reklas_misc_id + elif move.purchase_order_id and move.purchase_order_id.move_id: + cab = move.purchase_order_id.move_id + + # Isi field Nomor CAB jika ditemukan + if cab: + self.reklas_id = cab.id + + # Nilai yang dibayarkan harus tetap ambil dari invoice/bill + self.pay_amt = move.amount_total + + + @api.model + def default_get(self, fields): + res = super().default_get(fields) + active_ids = self._context.get('active_ids', []) + if active_ids: + move = self.env['account.move'].browse(active_ids[0]) + cab = False + + if move.move_type == 'entry': + cab = move + elif move.move_type == 'in_invoice': + if move.reklas_misc_id: + cab = move.reklas_misc_id + elif move.purchase_order_id and move.purchase_order_id.move_id: + cab = move.purchase_order_id.move_id + + if cab: + res['reklas_id'] = cab.id + + res['pay_amt'] = move.amount_total + return res + + + # @api.onchange('reklas_type') + # def _onchange_reklas_type(self): + # if self.reklas_type == 'penjualan': + # invoices = self.env['account.move'].browse(self._context.get('active_ids', [])) + # self.pay_amt = invoices.amount_total def create_reklas(self): if not self.reklas_type: raise UserError('Reklas Tipe harus diisi') if not self.reklas_id: raise UserError('Nomor CAB harus diisi') + invoices = self.env['account.move'].browse(self._context.get('active_ids', [])) current_time = datetime.now() + for invoice in invoices: - if self.reklas_type == 'penjualan': - ref_name = 'REKLAS '+self.reklas_id.name+" UANG MUKA PENJUALAN "+invoice.name+" "+invoice.partner_id.name - else: - ref_name = 'REKLAS '+self.reklas_id.name+" UANG MUKA PEMBELIAN "+invoice.name+" "+invoice.partner_id.name - if self.reklas_type == 'penjualan': - parameters_header = { - 'ref': ref_name, - 'date': current_time, - 'journal_id': 13 - } - else: - parameters_header = { - 'ref': ref_name, - 'date': current_time, - 'journal_id': 13 - } + # Ambil nama PO jika ada + po_name = invoice.purchase_order_id.name if invoice.purchase_order_id else '' + + # Susun nama referensi dengan aman + ref_name = 'REKLAS {} UANG MUKA {} {}{} {}'.format( + self.reklas_id.name or '', + 'PENJUALAN' if self.reklas_type == 'penjualan' else 'PEMBELIAN', + invoice.name or '', + f" - {po_name}" if po_name else '', + invoice.partner_id.name or '' + ) + + # Header jurnal reklas + parameters_header = { + 'ref': ref_name, + 'date': current_time, + 'journal_id': 13 + } account_move = request.env['account.move'].create([parameters_header]) _logger.info('Success Reklas with %s' % account_move.name) + # ✅ Set Bill asal sebagai source document + account_move.bill_id = invoice.id + + # Tambahkan info asal invoice ke jurnal (opsional) + account_move.invoice_origin = invoice.name + + # Simpan hubungan balik ke invoice + invoice.reklas_misc_id = account_move.id + + # Buat line debit dan kredit if self.reklas_type == 'penjualan': parameter_debit = { 'move_id': account_move.id, - 'account_id': 668, # penerimaan belum alokasi + 'account_id': 668, # penerimaan belum alokasi 'partner_id': invoice.partner_id.id, 'currency_id': 12, 'debit': self.pay_amt, @@ -71,7 +134,7 @@ class InvoiceReklas(models.TransientModel): 'credit': self.pay_amt, 'name': ref_name } - else: + else: # pembelian parameter_debit = { 'move_id': account_move.id, 'account_id': 438, @@ -90,7 +153,11 @@ class InvoiceReklas(models.TransientModel): 'credit': self.pay_amt, 'name': ref_name } + + # Simpan journal lines request.env['account.move.line'].create([parameter_debit, parameter_credit]) + + # Tampilkan hasil jurnal reklas return { 'name': _('Journal Entries'), 'view_mode': 'form', @@ -100,4 +167,3 @@ class InvoiceReklas(models.TransientModel): 'type': 'ir.actions.act_window', 'res_id': account_move.id } -
\ No newline at end of file diff --git a/indoteknik_custom/models/invoice_reklas_penjualan.py b/indoteknik_custom/models/invoice_reklas_penjualan.py index 80c3ed43..2f5ee160 100644 --- a/indoteknik_custom/models/invoice_reklas_penjualan.py +++ b/indoteknik_custom/models/invoice_reklas_penjualan.py @@ -17,43 +17,70 @@ class InvoiceReklasPenjualan(models.TransientModel): def create_reklas_penjualan(self): invoices = self.invoice_reklas_line - current_time = datetime.now() account_move_ids = [] - for invoice in invoices: - ref_name = 'REKLAS ' + invoice.reklas_id.name + " UANG MUKA PENJUALAN " + invoice.name + " " + invoice.partner_id.name + + for line in invoices: + # Ambil nama SO jika ada + so_name = line.sale_id.name if line.sale_id else '' + + # Susun referensi nama jurnal + ref_name = 'REKLAS {} UANG MUKA PENJUALAN {}{} {}'.format( + line.reklas_id.name or '', + line.name or '', + f" - {so_name}" if so_name else '', + line.partner_id.name or '' + ) + + # Header jurnal parameters_header = { 'ref': ref_name, 'date': current_time, - 'journal_id': 13 + 'journal_id': 13, + # ⬇️ Tambahkan jika tahu invoice asal (name = ID Bill) + 'bill_id': int(line.name) if line.name and line.name.isdigit() else False, } account_move = self.env['account.move'].create([parameters_header]) _logger.info('Success Reklas with %s' % account_move.name) - parameter_debit = { + # Simpan info asal (optional) + account_move.invoice_origin = line.name + + # Simpan juga ke `reklas_misc_id` jika ditemukan invoice valid + if line.name and line.name.isdigit(): + invoice_id = self.env['account.move'].browse(int(line.name)) + if invoice_id.exists(): + invoice_id.reklas_misc_id = account_move.id + + # Buat debit kredit line + debit_line = { 'move_id': account_move.id, - 'account_id': 668, # uang muka penjualan - 'partner_id': invoice.partner_id.id, + 'account_id': 668, # akun penerimaan belum alokasi + 'partner_id': line.partner_id.id, 'currency_id': 12, - 'debit': invoice.pay_amt, + 'debit': line.pay_amt, 'credit': 0, 'name': ref_name } - parameter_credit = { + credit_line = { 'move_id': account_move.id, - 'account_id': 395, - 'partner_id': invoice.partner_id.id, + 'account_id': 395, # akun pengurang + 'partner_id': line.partner_id.id, 'currency_id': 12, 'debit': 0, - 'credit': invoice.pay_amt, + 'credit': line.pay_amt, 'name': ref_name } - self.env['account.move.line'].create([parameter_debit, parameter_credit]) + + self.env['account.move.line'].create([debit_line, credit_line]) account_move_ids.append(account_move.id) - invoice.unlink() - - self.unlink() + + line.unlink() # bersihkan line setelah selesai + + self.unlink() # hapus wizard utama setelah selesai + + # Tampilkan hasil jurnal reklas return { 'name': _('Journal Entries'), 'view_mode': 'tree,form', @@ -63,6 +90,7 @@ class InvoiceReklasPenjualan(models.TransientModel): 'domain': [('id', 'in', account_move_ids)], } + class InvoiceReklasPenjualanLine(models.TransientModel): _name = 'invoice.reklas.penjualan.line' _description = "digunakan untuk reklas Uang Muka Penjualan" diff --git a/indoteknik_custom/models/mail_mail.py b/indoteknik_custom/models/mail_mail.py index cbcd883a..792b97b7 100644 --- a/indoteknik_custom/models/mail_mail.py +++ b/indoteknik_custom/models/mail_mail.py @@ -14,7 +14,7 @@ class MailMail(models.Model): # Filter hanya email gagal dalam 7 hari terakhir mails = self.search([ - ('state', 'in', 'exception'), + ('state', 'in', ['exception']), ('create_date', '>=', seven_days_ago), ('create_date', '<=', now), ], limit=250) diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 240289bf..004a1fa4 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -65,7 +65,7 @@ class PurchaseOrder(models.Model): sale_order = fields.Char(string='Sale Order') matches_so = fields.Many2many('sale.order', string='Matches SO', compute='_compute_matches_so') is_create_uangmuka = fields.Boolean(string='Uang Muka?') - move_id = fields.Many2one('account.move', string='Account Move') + move_id = fields.Many2one('account.move', string='Journal Entries Uang Muka', domain=[('move_type', '=', 'entry')]) logbook_bill_id = fields.Many2one('report.logbook.bill', string='Logbook Bill') status_printed = fields.Selection([ ('not_printed', 'Belum Print'), @@ -89,6 +89,28 @@ class PurchaseOrder(models.Model): store_name = fields.Char(string='Nama Toko') purchase_order_count = fields.Integer('Purchase Order Count', related='partner_id.purchase_order_count') + is_cab_visible = fields.Boolean(string='Tampilkan Tombol CAB', compute='_compute_is_cab_visible') + + @api.depends('move_id.state') + def _compute_is_cab_visible(self): + for order in self: + move = order.move_id + order.is_cab_visible = bool(move and move.state == 'posted') + + def action_view_journal_uangmuka(self): + self.ensure_one() + if not self.move_id: + raise UserError("Journal Uang Muka belum tersedia.") + + return { + 'type': 'ir.actions.act_window', + 'name': 'Journal Entry', + 'res_model': 'account.move', + 'res_id': self.move_id.id, + 'view_mode': 'form', + 'target': 'current', + } + # cek payment term def _check_payment_term(self): _logger.info("Check Payment Term Terpanggil") diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index d0017115..7c3f8952 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -2872,11 +2872,22 @@ class SaleOrder(models.Model): # @api.depends('commitment_date') def _compute_ready_to_ship_status_detail(self): + def is_empty(val): + """Helper untuk cek data kosong yang umum di Odoo.""" + return val is None or val == "" or val == [] or val == {} + for order in self: + order.ready_to_ship_status_detail = 'On Track' # Default value + + # Skip if no commitment date + if is_empty(order.commitment_date): + continue + eta = order.commitment_date match_lines = self.env['purchase.order.sales.match'].search([ ('sale_id', '=', order.id) ]) + if match_lines: for match in match_lines: po = match.purchase_order_id @@ -2885,20 +2896,31 @@ class SaleOrder(models.Model): ('order_id', '=', po.id), ('product_id', '=', product.id) ], limit=1) + + if is_empty(po_line): + continue + stock_move = self.env['stock.move'].search([ ('purchase_line_id', '=', po_line.id) ], limit=1) + + if is_empty(stock_move) or is_empty(stock_move.picking_id): + continue + picking_in = stock_move.picking_id - result_date = picking_in.date_done if picking_in else None - if result_date: - status = "Early" if result_date < eta else "Delay" - result_date_str = result_date.strftime('%m/%d/%Y') - eta_str = eta.strftime('%m/%d/%Y') - order.ready_to_ship_status_detail = f"Expected: {eta_str} | Realtime: {result_date_str} | {status}" - else: - order.ready_to_ship_status_detail = "On Track" - else: - order.ready_to_ship_status_detail = 'On Track' + result_date = picking_in.date_done + + if is_empty(result_date): + continue + + try: + if result_date < eta: + order.ready_to_ship_status_detail = f"Early (Actual: {result_date.strftime('%m/%d/%Y')})" + else: + order.ready_to_ship_status_detail = f"Delay (Actual: {result_date.strftime('%m/%d/%Y')})" + except Exception as e: + _logger.error(f"Error computing ready to ship status: {str(e)}") + continue def write(self, vals): diff --git a/indoteknik_custom/models/shipment_group.py b/indoteknik_custom/models/shipment_group.py index fcde39c9..4969c35a 100644 --- a/indoteknik_custom/models/shipment_group.py +++ b/indoteknik_custom/models/shipment_group.py @@ -22,7 +22,7 @@ class ShipmentGroup(models.Model): picking_names = [lines.picking_id.name for lines in self.shipment_line] if rec.shipment_id.carrier_id.id == 173: rec.picking_id.action_get_kgx_pod( - shipment=f"{self.number}, {', '.join(picking_names)}" + shipment=f"{self.number}" ) elif rec.shipment_id.carrier_id.id == 151: rec.picking_id.track_envio_shipment(shipment=f"{self.number}") diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 7775e991..6eac857c 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -287,7 +287,7 @@ class StockPicking(models.Model): self.ensure_one() if not self.name or not self.origin: return False - return f"{self.name} {self.origin}" + return f"{self.name}" def _download_pod_photo(self, url): """Mengunduh foto POD dari URL""" @@ -528,13 +528,7 @@ class StockPicking(models.Model): record.kgx_pod_photo = "No image available." def action_fetch_lalamove_order(self): - pickings = self.env['stock.picking'].search([ - ('picking_type_code', '=', 'outgoing'), - ('state', '=', 'done'), - ('carrier_id', '=', 9), - ('lalamove_order_id', '!=', False) - ]) - for picking in pickings: + for picking in self: try: order_id = picking.lalamove_order_id apikey = self.env['ir.config_parameter'].sudo().get_param('lalamove.apikey') diff --git a/indoteknik_custom/models/uangmuka_pembelian.py b/indoteknik_custom/models/uangmuka_pembelian.py index ba41f814..13d51dcf 100644 --- a/indoteknik_custom/models/uangmuka_pembelian.py +++ b/indoteknik_custom/models/uangmuka_pembelian.py @@ -57,6 +57,8 @@ class UangmukaPembelian(models.TransientModel): account_move = request.env['account.move'].create([param_header]) _logger.info('Success Create Uang Muka Pembelian %s' % account_move.name) + account_move.purchase_order_id = order.id # isi field purchase_order_id + if order.partner_id.parent_id: partner_id = order.partner_id.parent_id.id else: diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index 46737a40..0c2f9a68 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -6,6 +6,12 @@ <field name="model">account.move</field> <field name="inherit_id" ref="account.view_move_form"/> <field name="arch" type="xml"> + <xpath expr="//div[@name='journal_div']" position="after"> + <field name="reklas_misc_id" + string="Journal Entries Reklas" + attrs="{'invisible': [('move_type', '!=', 'in_invoice')]}" + readonly="1"/> + </xpath> <button name="action_register_payment" position="after"> <button name="indoteknik_custom.action_view_invoice_reklas" string="Reklas" type="action" class="btn-primary" attrs="{'invisible': [('state', '!=', 'posted')]}"/> @@ -31,6 +37,8 @@ </field> <field name="ref" position="after"> <field name="sale_id" readonly="1" attrs="{'invisible': [('move_type', '!=', 'entry')]}"/> + <!-- <field name="purchase_order_id" context="{'form_view_ref': 'purchase.purchase_order_form'}" options="{'no_create': True}"/> --> + <field name="bill_id" readonly="1" attrs="{'invisible': ['|', ('move_type', '!=', 'entry'), ('purchase_order_id', '!=', False)]}"/> </field> <field name="partner_shipping_id" position="before"> <field name="real_invoice_id" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/> diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml index 0fbbb5e7..9084bcbb 100755 --- a/indoteknik_custom/views/purchase_order.xml +++ b/indoteknik_custom/views/purchase_order.xml @@ -14,6 +14,20 @@ attrs="{'invisible': ['|', ('sale_order_id', '=', False), ('state', 'not in', ['draft'])]}" /> </div> + <xpath expr="//button[@name='action_view_invoice']" position="before"> + <field name="is_cab_visible" invisible="1"/> + <button type="object" + name="action_view_journal_uangmuka" + class="oe_stat_button" + icon="fa-book" + attrs="{'invisible': [('is_cab_visible', '=', False)]}" + style="width: 200px;"> + <field name="move_id" widget="statinfo" string="Journal Uang Muka"/> + <span class="o_stat_text"> + <t t-esc="record.move_id.name"/> + </span> + </button> + </xpath> <button id="draft_confirm" position="after"> <button name="po_approve" string="Ask Approval" @@ -65,6 +79,7 @@ <field name="total_cost_service" attrs="{'required': [('partner_id', 'in', [9688, 29712])]}"/> <field name="total_delivery_amt" attrs="{'required': [('partner_id', 'in', [9688, 29712])]}"/> <field name="product_bom_id"/> + <!-- <field name="move_id" domain="[('move_type','=','entry')]" context="{'form_view_ref': 'account.view_move_form'}" options="{'no_create': True}"/> --> </field> <field name="amount_total" position="after"> <field name="total_margin"/> diff --git a/indoteknik_custom/views/x_manufactures.xml b/indoteknik_custom/views/x_manufactures.xml index 01e90a1e..02061251 100755 --- a/indoteknik_custom/views/x_manufactures.xml +++ b/indoteknik_custom/views/x_manufactures.xml @@ -3,7 +3,7 @@ <record id="x_manufactures_action" model="ir.actions.act_window"> <field name="name">Manufacture</field> <field name="res_model">x_manufactures</field> - <field name="view_mode">tree,form</field> + <field name="view_mode">kanban,tree,form</field> <!-- Tambahkan kanban di sini --> <field name="help" type="html"> <p class="o_view_nocontent_smiling_face"> Add Manufactures! @@ -11,6 +11,44 @@ </field> </record> + <record id="x_manufactures_kanban" model="ir.ui.view"> + <field name="name">Manufactures Kanban</field> + <field name="model">x_manufactures</field> + <field name="arch" type="xml"> + <kanban default_group_by="x_manufacture_level"> + <field name="id"/> <!-- Tambahkan ini --> + <field name="x_name"/> + <field name="x_logo_manufacture"/> + <field name="x_manufacture_level"/> + <templates> + <t t-name="kanban-box"> + <div class="oe_kanban_global_click"> + <div class="o_kanban_image"> + <img t-if="record.x_logo_manufacture.raw_value" + t-att-src="kanban_image('x_manufactures', 'x_logo_manufacture', record.id.raw_value)" + alt="Logo" class="img-fluid" width="64" height="64"/> + <img t-else="" + src="/web/static/src/img/placeholder.png" + alt="No Logo" class="img-fluid" width="64" height="64"/> + </div> + <div class="o_kanban_details"> + <strong><field name="x_name"/></strong> + <div> + <span class="badge badge-secondary"> + <field name="x_manufacture_level"/> + </span> + </div> + <div t-if="record.x_short_desc.raw_value"> + <small><field name="x_short_desc"/></small> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + <record id="x_manufactures_tree" model="ir.ui.view"> <field name="name">Manufactures</field> <field name="model">x_manufactures</field> |
