summaryrefslogtreecommitdiff
path: root/indoteknik_custom
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-08-04 09:02:28 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-08-04 09:02:28 +0700
commit4aa9ca7105297079d109e20c793769476af91d02 (patch)
tree73f7067c6b868a73fb940db4cb38725d9fcd6953 /indoteknik_custom
parent145d15ceaf462f0b3533c441287a66410b7d12e6 (diff)
parent71c0324d483419d3b91078cf6efc2263f279362a (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into reminder-tempo-v2
Diffstat (limited to 'indoteknik_custom')
-rwxr-xr-xindoteknik_custom/models/sale_order.py18
-rw-r--r--indoteknik_custom/models/stock_picking.py5
-rw-r--r--indoteknik_custom/models/tukar_guling.py2
-rw-r--r--indoteknik_custom/models/tukar_guling_po.py2
-rw-r--r--indoteknik_custom/views/purchasing_job.xml2
-rw-r--r--indoteknik_custom/views/res_partner.xml2
-rwxr-xr-xindoteknik_custom/views/sale_order.xml5
-rw-r--r--indoteknik_custom/views/user_company_request.xml3
8 files changed, 30 insertions, 9 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 4e36a9fb..47018f52 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -3088,6 +3088,24 @@ class SaleOrder(models.Model):
except:
pass
+ #payment term vals
+ if 'payment_term_id' in vals and any(
+ order.approval_status in ['pengajuan1', 'pengajuan2', 'approved'] for order in self):
+ raise UserError(
+ "Payment Term tidak dapat diubah karena Sales Order sedang dalam proses approval atau sudah diapprove.")
+
+ if 'payment_term_id' in vals:
+ for order in self:
+ partner = order.partner_id.parent_id or order.partner_id
+ customer_payment_term = partner.property_payment_term_id
+ if vals['payment_term_id'] != customer_payment_term.id:
+ raise UserError(
+ f"Payment Term berbeda pada Master Data Customer. "
+ f"Harap ganti ke '{customer_payment_term.name}' "
+ f"sesuai dengan payment term yang terdaftar pada customer."
+ )
+
+
res = super(SaleOrder, self).write(vals)
# Update before margin setelah write
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 825368de..f2f5f52a 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -810,6 +810,7 @@ class StockPicking(models.Model):
self.biteship_tracking_id = data.get("courier", {}).get("tracking_id", "")
self.biteship_waybill_id = data.get("courier", {}).get("waybill_id", "")
self.delivery_tracking_no = self.biteship_waybill_id
+ self.biteship_shipping_price = data.get("price", 0.0)
waybill_id = self.biteship_waybill_id
@@ -1386,9 +1387,9 @@ class StockPicking(models.Model):
self.automatic_reserve_product()
if self.tukar_guling_id:
- self.tukar_guling_id.update_state()
+ self.tukar_guling_id.update_doc_state()
elif self.tukar_guling_po_id:
- self.tukar_guling_po_id.update_state()
+ self.tukar_guling_po_id.update_doc_state()
return res
diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py
index 5411b17c..3f81393a 100644
--- a/indoteknik_custom/models/tukar_guling.py
+++ b/indoteknik_custom/models/tukar_guling.py
@@ -462,7 +462,7 @@ class TukarGuling(models.Model):
raise UserError("Submit hanya bisa dilakukan dari Draft.")
self.state = 'approval_sales'
- def update_state(self):
+ def update_doc_state(self):
# OUT tukar guling
if self.operations.picking_type_id.id == 29 and self.return_type == 'tukar_guling':
total_out = self.env['stock.picking'].search_count([
diff --git a/indoteknik_custom/models/tukar_guling_po.py b/indoteknik_custom/models/tukar_guling_po.py
index 23ca1923..92d8c9a6 100644
--- a/indoteknik_custom/models/tukar_guling_po.py
+++ b/indoteknik_custom/models/tukar_guling_po.py
@@ -419,7 +419,7 @@ class TukarGulingPO(models.Model):
else:
raise UserError("Status ini tidak bisa di-approve.")
- def update_stae(self):
+ def update_doc_state(self):
# bu input rev po
if self.operations.picking_type_id.id == 28 and self.return_type == 'revisi_po':
prt = self.env['stock.picking'].search([
diff --git a/indoteknik_custom/views/purchasing_job.xml b/indoteknik_custom/views/purchasing_job.xml
index e3866d84..2466e7be 100644
--- a/indoteknik_custom/views/purchasing_job.xml
+++ b/indoteknik_custom/views/purchasing_job.xml
@@ -17,7 +17,7 @@
<field name="status_apo" invisible="1"/>
<field name="action"/>
<field name="note"/>
- <field name="date_po"/>
+ <field name="date_po" optional="hide"/>
<field name="so_number"/>
<field name="check_pj" invisible="1"/>
<button name="action_open_job_detail"
diff --git a/indoteknik_custom/views/res_partner.xml b/indoteknik_custom/views/res_partner.xml
index 08eca7ea..b081f6f2 100644
--- a/indoteknik_custom/views/res_partner.xml
+++ b/indoteknik_custom/views/res_partner.xml
@@ -220,7 +220,7 @@
<group string="Aging Info">
<field name="avg_aging" readonly="1"/>
<field name="payment_difficulty" attrs="{'readonly': [('parent_id', '!=', False)]}" />
- <field name="payment_history_url" readonly="1" />
+ <field name="payment_history_url" readonly="1" widget="url"/>
</group>
</page>
</notebook>
diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml
index e8f41ca3..868bce7b 100755
--- a/indoteknik_custom/views/sale_order.xml
+++ b/indoteknik_custom/views/sale_order.xml
@@ -355,8 +355,9 @@
</field>
<field name="payment_term_id" position="attributes">
<attribute name="attrs">
- {'readonly': [('approval_status', '=', 'approved'), ('state', 'not in',
- ['cancel', 'draft'])]}
+ {'readonly': ['|', ('approval_status', 'in', ['pengajuan1', 'pengajuan2', 'approved']),
+ ('state', 'not in',
+ ['cancel', 'draft'])]}
</attribute>
</field>
diff --git a/indoteknik_custom/views/user_company_request.xml b/indoteknik_custom/views/user_company_request.xml
index 88d04c64..5f296cb0 100644
--- a/indoteknik_custom/views/user_company_request.xml
+++ b/indoteknik_custom/views/user_company_request.xml
@@ -31,7 +31,8 @@
<group>
<field name="user_id" readonly="1"/>
<field name="similar_company_ids" invisible="1"/>
- <field name="user_company_id" domain="[('id', 'in', similar_company_ids)]"/>
+<!-- <field name="user_company_id" domain="[('id', 'in', similar_company_ids)]"/>-->
+ <field name="user_company_id" />
<field name="user_input" readonly="1"/>
<field
name="is_approve"