diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-07-28 15:09:55 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-07-28 15:09:55 +0700 |
| commit | d15ce4e186e2b77f01e8dfd03886298cc733d4c1 (patch) | |
| tree | 1b32a4c29c4fcea85070fcecb5b77a7d55d30029 /indoteknik_custom/models/requisition.py | |
| parent | deba962d7368a5c4e30441b5a640102608e3dde6 (diff) | |
| parent | 36a53535dbdc5777266fd9276b4c557259dab6be (diff) | |
<hafid> merging odoo-backup
Diffstat (limited to 'indoteknik_custom/models/requisition.py')
| -rw-r--r-- | indoteknik_custom/models/requisition.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/indoteknik_custom/models/requisition.py b/indoteknik_custom/models/requisition.py index 74236850..bcdafb12 100644 --- a/indoteknik_custom/models/requisition.py +++ b/indoteknik_custom/models/requisition.py @@ -48,8 +48,8 @@ class Requisition(models.Model): is_po = fields.Boolean(string='Is PO') requisition_match = fields.One2many('requisition.purchase.match', 'requisition_id', string='Matches', auto_join=True) sale_order_id = fields.Many2one('sale.order', string='SO', help='harus diisi nomor SO yang ingin digenerate') - sales_approve = fields.Boolean(string='Sales Approve', tracking=3, copy=False) - merchandise_approve = fields.Boolean(string='Merchandise Approve', tracking=3, copy=False) + sales_approve = fields.Boolean(string='Approval Status', tracking=3, copy=False) + merchandise_approve = fields.Boolean(string='Approval Status', tracking=3, copy=False) def generate_requisition_from_so(self): state = ['done', 'sale'] @@ -82,20 +82,16 @@ class Requisition(models.Model): state = ['done', 'sale'] if self.sale_order_id.state in state: raise UserError('SO sudah Confirm, akan berakibat double Purchase melalui PJ') - if self.env.user.id not in [377, 19, 28]: - raise UserError('Hanya Vita dan Darren Yang Bisa Approve') - if self.env.user.id == 377 or self.env.user.id == 28: + if self.env.user.id not in [21, 19, 28]: + raise UserError('Hanya Rafly dan Darren Yang Bisa Approve') + if self.env.user.id == 19 or self.env.user.id == 28: self.sales_approve = True - elif self.env.user.id == 19 or self.env.user.id == 28: - if not self.sales_approve: - raise UserError('Vita Belum Approve') + elif self.env.user.id == 21 or self.env.user.id == 28: self.merchandise_approve = True def create_po_from_requisition(self): - if not self.sales_approve: - raise UserError('Harus Di Approve oleh Vita') - if not self.merchandise_approve: - raise UserError('Harus Di Approve oleh Darren') + if not self.sales_approve and not self.merchandise_approve: + raise UserError('Harus Di Approve oleh Darren atau Rafly') if not self.requisition_lines: raise UserError('Tidak ada Lines, belum bisa create PO') if self.is_po: |
