From 091038b12f8e1cf9b0668110405c385e90a97ad7 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 3 Oct 2023 12:44:54 +0700 Subject: nomor faktur pajak di invoice --- indoteknik_custom/models/account_move.py | 12 ++++++++++++ indoteknik_custom/views/account_move.xml | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 18025b32..c3cd7ef9 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -2,6 +2,10 @@ from odoo import models, api, fields from odoo.exceptions import AccessError, UserError, ValidationError from datetime import timedelta, date import logging +import base64 +import PyPDF2 +import os +import re _logger = logging.getLogger(__name__) @@ -23,6 +27,14 @@ class AccountMove(models.Model): cost_centre_id = fields.Many2one('cost.centre', string='Cost Centre') analytic_account_ids = fields.Many2many('account.analytic.account', string='Analytic Account') due_line = fields.One2many('due.extension.line', 'invoice_id', compute='_compute_due_line', string='Due Extension Lines') + no_faktur_pajak = fields.Char(string='No Faktur Pajak') + + @api.onchange('efaktur_id') + def change_efaktur_id(self): + for invoice in self: + if not invoice.efaktur_id: + return + invoice.no_faktur_pajak = invoice.efaktur_id.name def _compute_due_line(self): for invoice in self: diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index 11558bf4..c45dab25 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -13,6 +13,12 @@ + + + + + pdf_viewer + -- cgit v1.2.3 From d238f43442cc27db0d0c05bba99b42b41eaadf54 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 3 Oct 2023 13:48:03 +0700 Subject: fix compute display name --- indoteknik_custom/models/solr/apache_solr_queue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/models/solr/apache_solr_queue.py b/indoteknik_custom/models/solr/apache_solr_queue.py index f66d356d..8dd7c273 100644 --- a/indoteknik_custom/models/solr/apache_solr_queue.py +++ b/indoteknik_custom/models/solr/apache_solr_queue.py @@ -8,7 +8,7 @@ _logger = logging.getLogger(__name__) class ApacheSolrQueue(models.Model): _name = 'apache.solr.queue' - display_name = fields.Char('Display Name', compute="_compute_display_name", store=True) + display_name = fields.Char('Display Name', compute="_compute_display_name") res_model = fields.Char('Resource Model') res_id = fields.Integer('Resource ID') function_name = fields.Char('Function Name') -- cgit v1.2.3 From 5614f5f0fa0322089f17feeeeeb56af93bf76670 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 5 Oct 2023 11:08:16 +0700 Subject: mandatory email --- indoteknik_custom/models/sale_order.py | 8 +++++--- indoteknik_custom/views/sale_order.xml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index e201496a..93c63d56 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -392,9 +392,11 @@ class SaleOrder(models.Model): def _set_sppkp_npwp_contact(self): partner = self.partner_id.parent_id or self.partner_id - partner.customer_type = self.customer_type - partner.npwp = self.npwp - partner.sppkp = self.sppkp + if not partner.sppkp or not partner.npwp or not partner.email or partner.customer_type: + partner.customer_type = self.customer_type + partner.npwp = self.npwp + partner.sppkp = self.sppkp + partner.email = self.email def _compute_total_margin(self): for order in self: diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 0d972ec1..e0e9ac54 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -48,7 +48,7 @@ - + -- cgit v1.2.3 From c6c1e26d35327b61a88b247ef94cfff9257b492a Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 5 Oct 2023 16:48:43 +0700 Subject: Add computed_price field on product pricelist --- indoteknik_custom/models/product_pricelist.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indoteknik_custom/models/product_pricelist.py b/indoteknik_custom/models/product_pricelist.py index 026977f8..144b8689 100644 --- a/indoteknik_custom/models/product_pricelist.py +++ b/indoteknik_custom/models/product_pricelist.py @@ -40,5 +40,4 @@ class ProductPricelistItem(models.Model): _inherit = 'product.pricelist.item' manufacture_id = fields.Many2one('x_manufactures', string='Manufacture') - - \ No newline at end of file + computed_price = fields.Float(string='Computed Price') \ No newline at end of file -- cgit v1.2.3