summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/account_move.py13
-rwxr-xr-xindoteknik_custom/models/user_activity_log.py1
2 files changed, 14 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index 1e0c56cf..54e51dcf 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -1,4 +1,5 @@
from odoo import models, api, fields
+from odoo.exceptions import AccessError, UserError, ValidationError
from datetime import timedelta
@@ -12,6 +13,18 @@ class AccountMove(models.Model):
date_terima_tukar_faktur = fields.Date(string='Terima Faktur')
shipper_faktur_id = fields.Many2one('delivery.carrier', string='Shipper Faktur')
+ def button_draft(self):
+ res = super(AccountMove, self).button_draft()
+ if not self.env.user.is_accounting:
+ raise UserError('Hanya Accounting yang bisa Reset to Draft')
+ return res
+
+ def action_post(self):
+ res = super(AccountMove, self).action_post()
+ if not self.env.user.is_accounting:
+ raise UserError('Hanya Accounting yang bisa Posting')
+ return res
+
@api.onchange('date_kirim_tukar_faktur')
def change_date_kirim_tukar_faktur(self):
for invoice in self:
diff --git a/indoteknik_custom/models/user_activity_log.py b/indoteknik_custom/models/user_activity_log.py
index 32b389a1..1a1a84fa 100755
--- a/indoteknik_custom/models/user_activity_log.py
+++ b/indoteknik_custom/models/user_activity_log.py
@@ -11,6 +11,7 @@ class UserActivityLog(models.Model):
page_title = fields.Char(string="Judul Halaman")
url = fields.Char(string="URL")
+ ip_address = fields.Char('IP Address')
res_user_id = fields.Many2one("res.users", string="User")
email = fields.Char(string="Email")
update_product = fields.Boolean(string="Update Product")