summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2025-08-04 10:42:28 +0000
committerIT Fixcomart <it@fixcomart.co.id>2025-08-04 10:42:28 +0000
commitfdfd9e478964b959b26ac2e38b2d0a37aa5e4edf (patch)
treea437c7ae6ef12efb5de5753011f852815ebf1876
parent03272a99674a92f7c95b9b95cc5788457e547731 (diff)
parent569fd1188a36aa97f0681bffe650dcbb9215f504 (diff)
Merged in tukar_guling (pull request #377)
<miqdad> remove vendor bill val
-rw-r--r--indoteknik_custom/models/tukar_guling_po.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/indoteknik_custom/models/tukar_guling_po.py b/indoteknik_custom/models/tukar_guling_po.py
index 92d8c9a6..467fff44 100644
--- a/indoteknik_custom/models/tukar_guling_po.py
+++ b/indoteknik_custom/models/tukar_guling_po.py
@@ -74,19 +74,19 @@ class TukarGulingPO(models.Model):
return res
- @api.constrains('return_type', 'operations')
- def _check_bill_on_revisi_po(self):
- for record in self:
- if record.return_type == 'revisi_po' and record.origin:
- bills = self.env['account.move'].search([
- ('invoice_origin', 'ilike', record.origin),
- ('move_type', '=', 'in_invoice'), # hanya vendor bill
- ('state', 'not in', ['draft', 'cancel'])
- ])
- if bills:
- raise ValidationError(
- _("Tidak bisa memilih Return Type 'Revisi PO' karena PO %s sudah dibuat vendor bill.") % record.origin
- )
+ # @api.constrains('return_type', 'operations')
+ # def _check_bill_on_revisi_po(self):
+ # for record in self:
+ # if record.return_type == 'revisi_po' and record.origin:
+ # bills = self.env['account.move'].search([
+ # ('invoice_origin', 'ilike', record.origin),
+ # ('move_type', '=', 'in_invoice'), # hanya vendor bill
+ # ('state', 'not in', ['draft', 'cancel'])
+ # ])
+ # if bills:
+ # raise ValidationError(
+ # _("Tidak bisa memilih Return Type 'Revisi PO' karena PO %s sudah dibuat vendor bill.") % record.origin
+ # )
@api.onchange('operations')
def _onchange_operations(self):
@@ -281,7 +281,7 @@ class TukarGulingPO(models.Model):
def write(self, vals):
if self.operations.picking_type_id.id not in [75, 28]:
raise UserError("❌ Tidak bisa retur bukan BU/INPUT atau BU/PUT!")
- self._check_bill_on_revisi_po()
+ # self._check_bill_on_revisi_po()
tipe = vals.get('return_type', self.return_type)
if self.operations and self.operations.picking_type_id.id == 28 and tipe == 'tukar_guling':
@@ -349,7 +349,7 @@ class TukarGulingPO(models.Model):
def action_submit(self):
self.ensure_one()
- self._check_bill_on_revisi_po()
+ # self._check_bill_on_revisi_po()
self._validate_product_lines()
self._check_not_allow_tukar_guling_on_bu_input()
@@ -385,7 +385,7 @@ class TukarGulingPO(models.Model):
def action_approve(self):
self.ensure_one()
self._validate_product_lines()
- self._check_bill_on_revisi_po()
+ # self._check_bill_on_revisi_po()
self._check_not_allow_tukar_guling_on_bu_input()
if not self.operations: