summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-11-11 17:23:05 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-11-11 17:23:05 +0700
commitc9068210e2ff7981594e698ed7a69734e38e1182 (patch)
treebb40da5603d30b9856149c48e8ddb75b25aee47f
parent4c69c892f7b8ef7ec0877023f3f9544c8e9eb42c (diff)
parent704f27afd94787260543a2b6fed2ecfa13e786cb (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into cr_delivery_sj
merge
-rw-r--r--indoteknik_custom/models/coretax_fatur.py4
-rwxr-xr-xindoteknik_custom/models/sale_order.py14
-rw-r--r--indoteknik_custom/views/advance_payment_request.xml2
-rw-r--r--indoteknik_custom/views/advance_payment_settlement.xml2
4 files changed, 13 insertions, 9 deletions
diff --git a/indoteknik_custom/models/coretax_fatur.py b/indoteknik_custom/models/coretax_fatur.py
index 7e0de919..cabcd5d6 100644
--- a/indoteknik_custom/models/coretax_fatur.py
+++ b/indoteknik_custom/models/coretax_fatur.py
@@ -148,8 +148,6 @@ class CoretaxFaktur(models.Model):
quantity = line_quantity
total_discount = round(line_discount, 2)
coretax_id = line.product_uom_id.coretax_id
- uom_name = line.product_uom_id.name
-
# Calculate other tax values
otherTaxBase = round(subtotal * (11 / 12), 2) if subtotal else 0
vat_amount = round(otherTaxBase * 0.12, 2)
@@ -161,7 +159,7 @@ class CoretaxFaktur(models.Model):
ET.SubElement(good_service, 'Opt').text = 'A'
ET.SubElement(good_service, 'Code').text = '000000'
ET.SubElement(good_service, 'Name').text = line_name
- ET.SubElement(good_service, uom_name).text = coretax_id
+ ET.SubElement(good_service, 'Unit').text = coretax_id
# ET.SubElement(good_service, 'Price').text = str(round(line_price_unit, 2)) if line_price_unit else '0'
ET.SubElement(good_service, 'Price').text = str(price_per_unit)
ET.SubElement(good_service, 'Qty').text = str(quantity)
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 357d2395..6b1057dd 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -2404,6 +2404,13 @@ class SaleOrder(models.Model):
'Hanya bisa konfirmasi SO tim Anda.'
)
+ user = self.env.user
+ is_sales_admin = user.id in (3401, 20, 3988, 17340)
+ if is_sales_admin:
+ order.approval_status = 'pengajuan1'
+ order.message_post(body="Mengajukan approval ke Team Sales")
+ return self._create_approval_notification('Team Sales')
+
raise UserError("Bisa langsung Confirm")
def send_notif_to_salesperson(self, cancel=False):
@@ -2759,12 +2766,11 @@ class SaleOrder(models.Model):
if user.is_leader or user.is_sales_manager:
return True
- if self.env.context.get("ask_approval") and user.id in (3401, 20, 3988):
+ if self.env.context.get("ask_approval") and user.id in (3401, 20, 3988, 17340):
return True
- if not self.env.context.get("ask_approval") and user.id in (3401, 20, 3988, 17340): # admin (fida, nabila, ninda)
- raise UserError("Yahaha gabisa confirm so, minta ke sales nya ajah")
-
+ if not self.env.context.get("ask_approval") and user.id in (3401, 20, 3988, 17340): # admin (fida, nabila, ninda, feby)
+ raise UserError("Sales Admin tidak bisa confirm SO, silahkan hubungi Salesperson yang bersangkutan.")
salesperson_id = self.user_id.id
approver_id = user.id
diff --git a/indoteknik_custom/views/advance_payment_request.xml b/indoteknik_custom/views/advance_payment_request.xml
index f8217150..b498b8a8 100644
--- a/indoteknik_custom/views/advance_payment_request.xml
+++ b/indoteknik_custom/views/advance_payment_request.xml
@@ -4,7 +4,7 @@
<field name="name">advance.payment.request.form</field>
<field name="model">advance.payment.request</field>
<field name="arch" type="xml">
- <form string="Advance Payment Request &amp; Reimburse">
+ <form string="Advance Payment Request &amp; Reimburse" duplicate="0">
<header>
<button name="action_realisasi_pum"
type="object"
diff --git a/indoteknik_custom/views/advance_payment_settlement.xml b/indoteknik_custom/views/advance_payment_settlement.xml
index 188f09d0..050e3933 100644
--- a/indoteknik_custom/views/advance_payment_settlement.xml
+++ b/indoteknik_custom/views/advance_payment_settlement.xml
@@ -3,7 +3,7 @@
<field name="name">advance.payment.settlement.form</field>
<field name="model">advance.payment.settlement</field>
<field name="arch" type="xml">
- <form string="Advance Payment Settlement">
+ <form string="Advance Payment Settlement" duplicate="0">
<header>
<button name="action_cab"
type="object"