summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-10-06 10:44:49 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-10-06 10:44:49 +0700
commit12b015dc599f3a3876b10171bcec95e8aba7683c (patch)
treec4f6b9b3510dca21a72d9454f7fcd4335347d5f9 /indoteknik_custom/models
parent7f9971a4c838b84fb1223845ccdb8256eb08b72d (diff)
parentc6c1e26d35327b61a88b247ef94cfff9257b492a (diff)
Merge branch 'production' into change/feature/pricelist
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/account_move.py12
-rw-r--r--indoteknik_custom/models/product_pricelist.py3
-rwxr-xr-xindoteknik_custom/models/sale_order.py8
-rw-r--r--indoteknik_custom/models/solr/apache_solr_queue.py2
4 files changed, 19 insertions, 6 deletions
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/models/product_pricelist.py b/indoteknik_custom/models/product_pricelist.py
index 384d1353..b7a6d77e 100644
--- a/indoteknik_custom/models/product_pricelist.py
+++ b/indoteknik_custom/models/product_pricelist.py
@@ -45,5 +45,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
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 728c0bba..9324930e 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/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')