diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-02-19 14:49:40 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-02-19 14:49:40 +0700 |
| commit | b7580b1590fc3259aa028c0c909b0ee564e801d5 (patch) | |
| tree | 9e2fe58c19bb3b7c53e2f146a17cd16f2442c67a | |
| parent | 80c56615d5c605f6e96cc3567a6b3d0332152957 (diff) | |
<iman> update customer
| -rw-r--r-- | indoteknik_custom/models/commision.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/views/customer_commision.xml | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/indoteknik_custom/models/commision.py b/indoteknik_custom/models/commision.py index 3f035e2f..03473b09 100644 --- a/indoteknik_custom/models/commision.py +++ b/indoteknik_custom/models/commision.py @@ -233,6 +233,8 @@ class CustomerCommision(models.Model): return def action_confirm_customer_payment(self): + if self.payment_status == 'payment': + raise UserError('Customer Commision sudah berstatus Payment') group_id = self.env.ref('indoteknik_custom.group_role_fat').id users_in_group = self.env['res.users'].search([('groups_id', 'in', [group_id])]) if self.env.user.id not in users_in_group.mapped('id'): diff --git a/indoteknik_custom/views/customer_commision.xml b/indoteknik_custom/views/customer_commision.xml index 55736b0d..09031274 100644 --- a/indoteknik_custom/views/customer_commision.xml +++ b/indoteknik_custom/views/customer_commision.xml @@ -48,9 +48,9 @@ string="Confirm" type="object" options="{}"/> <button name="action_confirm_customer_payment" - string="Konfirmasi Pembayaran" type="object" - options="{}" - attrs="{'invisible': [('status', '!=', 'approved'),]}"/> + string="Konfirmasi Pembayaran" type="object" + options="{}" + attrs="{'invisible': [('status', '!=', 'approved')], 'readonly': [('payment_status', '=', 'payment')]}"/> </header> <sheet string="Customer Commision"> <div class="oe_button_box" name="button_box"/> |
