summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-01-22 13:51:02 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-01-22 13:51:02 +0700
commit4f73c6225571608e0fed6ee94ae0d2c91eaefd1a (patch)
treef14b163f4793f1aee74d315557abc0cf27b83073
parent7e52c025439a8614a1ec6ae77dfdda934989a09b (diff)
parent230027f0bfedfedc27e5067d0b25d167f751688b (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into gudang-service
merge
-rw-r--r--indoteknik_custom/models/price_group.py4
-rwxr-xr-xindoteknik_custom/models/purchase_order.py5
-rw-r--r--indoteknik_custom/models/purchasing_job.py4
-rw-r--r--indoteknik_custom/models/purchasing_job_multi_update.py17
-rw-r--r--indoteknik_custom/models/purchasing_job_state.py3
-rwxr-xr-xindoteknik_custom/models/sale_order.py2
-rw-r--r--indoteknik_custom/views/advance_payment_request.xml4
-rw-r--r--indoteknik_custom/views/price_group.xml4
-rw-r--r--indoteknik_custom/views/purchasing_job.xml2
-rw-r--r--indoteknik_custom/views/purchasing_job_state.xml3
10 files changed, 36 insertions, 12 deletions
diff --git a/indoteknik_custom/models/price_group.py b/indoteknik_custom/models/price_group.py
index 1b1c817f..fce78fff 100644
--- a/indoteknik_custom/models/price_group.py
+++ b/indoteknik_custom/models/price_group.py
@@ -18,6 +18,8 @@ class PriceGroup(models.Model):
group6 = fields.Float(string='Kelompok 6 (%)')
group7 = fields.Float(string='Kelompok 7 (%)')
group8 = fields.Float(string='Kelompok 8 (%)')
+ group9 = fields.Float(string='Kelompok 9 (%)')
+ group10 = fields.Float(string='Kelompok 10 (%)')
def collect_price_group(self):
PRICE_GROUP_ID = {
@@ -47,4 +49,6 @@ class Manufacture(models.Model):
('group6', 'Kelompok 6'),
('group7', 'Kelompok 7'),
('group8', 'Kelompok 8'),
+ ('group9', 'Kelompok 9'),
+ ('group10', 'Kelompok 10'),
], string='Pricing Group', copy=False)
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index a114743f..35fa79a8 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -1083,8 +1083,9 @@ class PurchaseOrder(models.Model):
if '/PJ/' in self.name:
price_change_detected = any(line.price_unit_before for line in self.order_line)
if price_change_detected:
- if self.total_percent_margin <= 15.0:
- raise UserError("Approval Pimpinan diperlukan jika terdapat perubahan Unit Price pada PO Line dan Memiliki Margin <= 15%")
+ if self.order_sales_match_line:
+ if self.total_percent_margin <= 15.0:
+ raise UserError("Approval Pimpinan diperlukan jika terdapat perubahan Unit Price pada PO Line dan Memiliki Margin <= 15%")
else:
low_margin_match_so = self.order_sales_match_line.filtered(
lambda match: match.so_header_margin <= 15.0
diff --git a/indoteknik_custom/models/purchasing_job.py b/indoteknik_custom/models/purchasing_job.py
index 7a7e70b4..e457b86c 100644
--- a/indoteknik_custom/models/purchasing_job.py
+++ b/indoteknik_custom/models/purchasing_job.py
@@ -24,7 +24,8 @@ class PurchasingJob(models.Model):
('apo', 'APO')
], string='APO?')
purchase_representative_id = fields.Many2one('res.users', string="Purchase Representative", readonly=True)
- note = fields.Char(string="Note Detail")
+ note = fields.Char(string="Note")
+ note_detail = fields.Text(string="Note Detail")
date_po = fields.Datetime(string='Date PO', copy=False)
so_number = fields.Text(string='SO Number', copy=False)
check_pj = fields.Boolean(compute='_get_check_pj', string='Linked')
@@ -126,6 +127,7 @@ class PurchasingJob(models.Model):
pmp.action,
max(pjs.status_apo::text) AS status_apo,
max(pjs.note::text) AS note,
+ max(pjs.note_detail::text) AS note_detail,
max(pjs.date_po::text) AS date_po,
pmp.so_number,
CASE
diff --git a/indoteknik_custom/models/purchasing_job_multi_update.py b/indoteknik_custom/models/purchasing_job_multi_update.py
index 80a43e45..0eca499f 100644
--- a/indoteknik_custom/models/purchasing_job_multi_update.py
+++ b/indoteknik_custom/models/purchasing_job_multi_update.py
@@ -20,10 +20,19 @@ class PurchasingJobMultiUpdate(models.TransientModel):
# purchasing_job_state.unlink()
- purchasing_job_state.create({
- 'purchasing_job_id': product.id,
- 'status_apo': 'apo',
- })
+ vals = {
+ 'purchasing_job_id': product.id, # Pastikan ID ini benar mapping ke ID produk
+ 'status_apo': 'apo',
+ }
+
+ if purchasing_job_state:
+ purchasing_job_state.write(vals)
+ else:
+ purchasing_job_state.create(vals)
+ # purchasing_job_state.create({
+ # 'purchasing_job_id': product.id,
+ # 'status_apo': 'apo',
+ # })
apo = self.env['automatic.purchase'].generate_regular_purchase(products)
return {
diff --git a/indoteknik_custom/models/purchasing_job_state.py b/indoteknik_custom/models/purchasing_job_state.py
index d014edfe..ca557de1 100644
--- a/indoteknik_custom/models/purchasing_job_state.py
+++ b/indoteknik_custom/models/purchasing_job_state.py
@@ -14,5 +14,6 @@ class PurchasingJobState(models.Model):
('not_apo', 'Belum APO'),
('apo', 'APO')
], string='APO?', copy=False)
- note = fields.Char(string="Note Detail", copy=False)
+ note = fields.Char(string="Note", copy=False)
+ note_detail = fields.Text(string="Note Detail", copy=False)
date_po = fields.Datetime(string='Date PO', copy=False)
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 17691798..9eed236f 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -2305,7 +2305,7 @@ class SaleOrder(models.Model):
search_bom = self.env['mrp.production'].search([('product_id', '=', line.product_id.id), ('sale_order', '=', order.id), ('state', '!=', 'cancel')],
order='name desc')
if search_bom:
- confirmed_bom = search_bom.filtered(lambda x: x.state == 'confirmed' or x.state == 'done')
+ confirmed_bom = search_bom.filtered(lambda x: x.state in ['confirmed', 'to_close', 'progress', 'done'])
if not confirmed_bom:
raise UserError(
"Product BOM belum dikonfirmasi di Manufacturing Orders. Silakan hubungi Purchasing.")
diff --git a/indoteknik_custom/views/advance_payment_request.xml b/indoteknik_custom/views/advance_payment_request.xml
index 8bbe6f82..7f422aa9 100644
--- a/indoteknik_custom/views/advance_payment_request.xml
+++ b/indoteknik_custom/views/advance_payment_request.xml
@@ -18,7 +18,7 @@
type="object"
string="Checking/Approval"
class="btn-success"
- attrs="{'invisible': [('status', 'in', ['approved','reject','draft'])]}"/>
+ attrs="{'invisible': [('status', 'in', ['approved','cancel','draft'])]}"/>
<button name="action_confirm_payment"
type="object"
string="Konfirmasi Pembayaran"
@@ -48,7 +48,7 @@
string="Cancel"
type="object"
class="btn-danger"
- attrs="{'invisible': [('status', 'in', ['draft', 'cancel'])]}"/>
+ attrs="{'invisible': ['|',('status', 'in', ['draft', 'cancel']), ('status_pay_down_payment', '=', 'payment')]}"/>
<field name="status" widget="statusbar"
statusbar_visible="draft,pengajuan1,pengajuan2,pengajuan3,approved"
statusbar_colors='{"reject":"red"}'
diff --git a/indoteknik_custom/views/price_group.xml b/indoteknik_custom/views/price_group.xml
index 5db8756e..7fad8d8d 100644
--- a/indoteknik_custom/views/price_group.xml
+++ b/indoteknik_custom/views/price_group.xml
@@ -26,6 +26,8 @@
<field name="group6"/>
<field name="group7"/>
<field name="group8"/>
+ <field name="group9"/>
+ <field name="group10"/>
</tree>
</field>
</record>
@@ -48,6 +50,8 @@
<field name="group6"/>
<field name="group7"/>
<field name="group8"/>
+ <field name="group9"/>
+ <field name="group10"/>
</group>
</group>
</sheet>
diff --git a/indoteknik_custom/views/purchasing_job.xml b/indoteknik_custom/views/purchasing_job.xml
index 6b8baa53..d303e5ea 100644
--- a/indoteknik_custom/views/purchasing_job.xml
+++ b/indoteknik_custom/views/purchasing_job.xml
@@ -17,6 +17,7 @@
<field name="status_apo" invisible="1"/>
<field name="action"/>
<field name="note"/>
+ <field name="note_detail"/>
<field name="date_po" optional="hide"/>
<field name="so_number"/>
<field name="check_pj" invisible="1"/>
@@ -59,6 +60,7 @@
<field name="purchase_representative_id"/>
<field name="vendor_id"/>
<field name="note"/>
+ <field name="note_detail"/>
</group>
</group>
</sheet>
diff --git a/indoteknik_custom/views/purchasing_job_state.xml b/indoteknik_custom/views/purchasing_job_state.xml
index c7c40020..ca08e44c 100644
--- a/indoteknik_custom/views/purchasing_job_state.xml
+++ b/indoteknik_custom/views/purchasing_job_state.xml
@@ -8,7 +8,8 @@
<sheet>
<group>
<field name="status_apo" readonly="1"/>
- <field name="note"/>
+ <field name="note" invisible="1"/>
+ <field name="note_detail"/>
</group>
</sheet>
</form>