diff options
Diffstat (limited to 'indoteknik_custom/models')
| -rwxr-xr-x | indoteknik_custom/models/res_users.py | 1 | ||||
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/models/upah_harian_office.py | 18 |
3 files changed, 11 insertions, 10 deletions
diff --git a/indoteknik_custom/models/res_users.py b/indoteknik_custom/models/res_users.py index 8f5b4008..0c1d2fa0 100755 --- a/indoteknik_custom/models/res_users.py +++ b/indoteknik_custom/models/res_users.py @@ -13,6 +13,7 @@ class ResUsers(models.Model): otp_create_date = fields.Datetime(string='OTP Create Date') payment_terms_id = fields.Many2one('account.payment.term', related='partner_id.property_payment_term_id', string='Payment Terms') pic = fields.Boolean('PIC') + harian = fields.Boolean('Harian') def _generate_otp(self): diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index e42f0ce3..d0e5e5d8 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -2429,7 +2429,7 @@ class SaleOrder(models.Model): user = self.env.user is_sales_admin = user.id in (3401, 20, 3988, 17340) if is_sales_admin: - order.approval_status = 'pengajuan1' + order.approval_status = 'pengajuan0' order.message_post(body="Mengajukan approval ke Sales") return self._create_approval_notification('Sales') diff --git a/indoteknik_custom/models/upah_harian_office.py b/indoteknik_custom/models/upah_harian_office.py index d5ee5878..17db4a92 100644 --- a/indoteknik_custom/models/upah_harian_office.py +++ b/indoteknik_custom/models/upah_harian_office.py @@ -78,13 +78,11 @@ class UpahHarian(models.Model): attachment_file_image = fields.Binary( string='Attachment Image', attachment_filename='attachment_filename_image', - compute = 'auto_paid_attachment' ) attachment_file_pdf = fields.Binary( string='Attachment PDF', attachment_filename='attachment_filename_pdf', - compute = 'auto_paid_attachment' ) attachment_filename_image = fields.Char() @@ -192,16 +190,18 @@ class UpahHarian(models.Model): self.approved_by_dept = False or "" self.approved_by_finance = False or "" - @api.depends('attachment_file_image', 'attachment_file_pdf') - def auto_paid_attachment(self): - if self.attachment_file_image or self.attachment_file_pdf: - self.state = 'paid' - self.message_post(body = _("Auto Paid by %s") % self.env.user.name) + def write(self, vals): + res = super().write(vals) + if 'attachment_file_image' in vals or 'attachment_file_pdf' in vals: + for rec in self: + if rec.attachment_file_image or rec.attachment_file_pdf: + rec.state = 'paid' + + return res def action_create_journal_entries(self): - - if self.env.user.has_group('indoteknik_custom.group_role_fat'): + if not self.env.user.has_group('indoteknik_custom.group_role_fat'): raise UserError("Hanya Finance yang bisa create journal") move = self.env['account.move'].create({ |
