summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-03-05 13:22:32 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-03-05 13:22:32 +0700
commit2536527e464ca3b3bfe3f690e864e75593989e5a (patch)
tree9306e8fdfad05d44e9fc262e2ecea9224622d07a
parent672b682c602160de8e7ec77232b0a709c6ed2b87 (diff)
<MIqdad> fix error
-rwxr-xr-xindoteknik_custom/__manifest__.py374
-rwxr-xr-xindoteknik_custom/models/__init__.py1
-rw-r--r--indoteknik_custom/models/upah_harian_office.py36
-rwxr-xr-xindoteknik_custom/security/ir.model.access.csv3
-rw-r--r--indoteknik_custom/views/upah_harian_office_views.xml73
5 files changed, 292 insertions, 195 deletions
diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py
index 8c427579..77a49e96 100755
--- a/indoteknik_custom/__manifest__.py
+++ b/indoteknik_custom/__manifest__.py
@@ -9,192 +9,194 @@
'website': '',
'images': ['assets/favicon.ico'],
'depends': ['base', 'coupon', 'delivery', 'sale', 'sale_management', 'vit_kelurahan', 'vit_efaktur', 'proweb_kartu_stok'],
- 'data': [
- 'views/assets.xml',
- 'security/ir.model.access.csv',
- 'views/group_partner.xml',
- 'views/blog_post.xml',
- 'views/coupon_program.xml',
- 'views/delivery_order.xml',
- 'views/product_pricelist.xml',
- 'views/res_groups.xml',
- 'views/res_partner_company_type.xml',
- 'views/res_partner.xml',
- 'views/product_pricelist_item.xml',
- 'views/product_public_category.xml',
- 'views/product_template.xml',
- 'views/uangmuka_pembelian.xml',
- 'views/purchase_order.xml',
- 'views/purchase_pricelist.xml',
- 'views/sale_monitoring.xml',
- 'views/sale_monitoring_detail.xml',
- 'views/web_logging/user_activity_log.xml',
- 'views/web_logging/web_utm_source.xml',
- 'views/user_company_request.xml',
- 'views/user_pengajuan_tempo_request.xml',
- 'views/vit_kelurahan.xml',
- 'views/vit_kecamatan.xml',
- 'views/vit_kota.xml',
- 'views/website_user_cart.xml',
- 'views/website_user_wishlist.xml',
- 'views/x_banner_banner.xml',
- 'views/x_banner_category.xml',
- 'views/x_biaya_kirim.xml',
- 'views/x_manufactures.xml',
- 'views/x_partner_purchase_order.xml',
- 'views/x_product_tags.xml',
- 'views/stock_vendor.xml',
- 'views/crm_lead.xml',
- 'views/uangmuka_penjualan.xml',
- 'views/sale_order.xml',
- 'views/account_asset_views.xml',
- 'views/account_move_views.xml',
- 'views/ir_sequence.xml',
- 'views/stock_location.xml',
- 'views/stock_picking.xml',
- 'views/stock_picking_type.xml',
- 'views/users.xml',
- 'views/delivery_carrier.xml',
- 'views/invoice_reklas.xml',
- 'views/account_move.xml',
- 'views/dunning_run.xml',
- 'views/website_brand_homepage.xml',
- 'views/website_categories_homepage.xml',
- 'views/website_categories_management.xml',
- 'views/website_telegram.xml',
- 'views/website_categories_lob.xml',
- 'views/sales_target.xml',
- 'views/purchase_outstanding.xml',
- 'views/sales_outstanding.xml',
- 'views/customer_review.xml',
- 'views/website_content_channel.xml',
- 'views/website_content.xml',
- 'views/website_page_content.xml',
- 'views/custom_mail_marketing.xml',
- 'views/website_ads.xml',
- 'views/leads_monitoring.xml',
- 'views/ip_lookup.xml',
- 'views/wati.xml',
- 'views/midtrans.xml',
- 'views/automatic_purchase.xml',
- 'views/raja_ongkir.xml',
- 'views/procurement_monitoring_detail.xml',
- 'views/product_product.xml',
- 'views/brand_vendor.xml',
- 'views/promotion/promotion_program.xml',
- 'views/promotion/promotion_program_line.xml',
- 'views/promotion/promotion_product.xml',
- 'views/promotion/promotion_monitoring.xml',
- 'views/requisition.xml',
- 'views/landedcost.xml',
- 'views/product_sla.xml',
- 'views/voucher.xml',
- 'views/bill_receipt.xml',
- 'views/account_financial_report_view.xml',
- 'views/account_report_general_ledger_view.xml',
- 'views/account_move_multi_update.xml',
- 'views/airway_bill.xml',
- 'views/product_attribute_value.xml',
- 'views/mail_template_po.xml',
- 'views/mail_template_efaktur.xml',
- 'views/mail_template_invoice_po.xml',
- 'views/mail_template_invoice_reminder.xml',
- 'views/price_group.xml',
- 'views/mrp_production.xml',
- 'views/apache_solr.xml',
- 'views/apache_solr_queue.xml',
- 'views/cost_centre.xml',
- 'views/account_account_views.xml',
- 'views/account_move_line.xml',
- 'views/sale_orders_multi_update.xml',
- 'views/quotation_so_multi_update.xml',
- 'views/stock_move_line.xml',
- 'views/product_monitoring.xml',
- 'views/res_users.xml',
- 'views/account_bank_statement.xml',
- 'views/stock_warehouse_orderpoint.xml',
- 'views/customer_commision.xml',
- 'views/wati_history.xml',
- 'views/purchasing_job.xml',
- 'views/purchasing_job_multi_update.xml',
- 'views/sale_monitoring_detail_v2.xml',
- 'views/purchase_order_multi_update.xml',
- 'views/purchase_order_multi_confirm.xml',
- 'views/purchase_order_multi_ask_approval.xml',
- 'views/invoice_reklas_penjualan.xml',
- 'views/po_multi_cancel.xml',
- 'views/logbook_sj.xml',
- 'views/report_logbook_sj.xml',
- 'views/role_permission/ir_model_access.xml',
- 'views/role_permission/res_groups.xml',
- 'views/cust_commision.xml',
- 'views/stock_quant.xml',
- 'views/purchasing_job_state.xml',
- 'views/res_partner_site.xml',
- 'views/apps_stored.xml',
- 'views/ged_tracking.xml',
- 'views/dunning_run_ged.xml',
- 'views/account_move_multi_update_bills.xml',
- 'views/def_cargo_province.xml',
- 'views/def_cargo_city.xml',
- 'views/def_cargo_district.xml',
- 'views/purchase_order_multi_uangmuka.xml',
- 'views/purchase_order_multi_uangmuka2.xml',
- 'views/logbook_bill.xml',
- 'views/report_logbook_bill.xml',
- 'views/sale_order_multi_uangmuka_penjualan.xml',
- 'views/shipment_group.xml',
- 'views/approval_date_doc.xml',
- 'views/approval_invoice_date.xml',
- 'views/partner_payment_term.xml',
- 'views/vendor_payment_term.xml',
- 'views/approval_unreserve.xml',
- 'views/vendor_approval.xml',
- 'views/find_page.xml',
- 'views/approval_retur_picking.xml',
- 'views/form_vendor_approval_multi_approve.xml',
- 'views/form_vendor_approval_multi_reject.xml',
- 'views/user_pengajuan_tempo.xml',
- 'views/stock_backorder_confirmation_views.xml',
- 'views/barcoding_product.xml',
- 'views/project_views.xml',
- 'views/approval_payment_term.xml',
- 'report/report.xml',
- 'report/report_banner_banner.xml',
- 'report/report_banner_banner2.xml',
- 'report/purchase_order.xml',
- 'report/report_invoice.xml',
- 'report/report_picking.xml',
- 'report/report_sale_order.xml',
- 'report/report_surat_piutang.xml',
- 'report/report_tutup_tempo.xml',
- 'report/purchase_report.xml',
- 'report/purchase_report_internal.xml',
- 'views/vendor_sla.xml',
- 'views/coretax_faktur.xml',
- 'views/public_holiday.xml',
- 'views/stock_inventory.xml',
- 'views/sale_order_delay.xml',
- 'views/refund_sale_order.xml',
- 'views/advance_payment_request.xml',
- 'views/advance_payment_settlement.xml',
- 'views/tukar_guling.xml',
- 'views/tukar_guling_po.xml',
- 'views/update_date_planned_po_wizard_view.xml',
- 'views/unpaid_invoice_view.xml',
- 'views/letter_receivable.xml',
- 'views/letter_receivable_mail_template.xml',
- 'views/mail_template_pum.xml',
- 'views/sj_tele.xml',
- 'views/close_tempo_mail_template.xml',
- 'views/domain_apo.xml',
- 'views/uom_uom.xml',
- 'views/update_depreciation_move_wizard_view.xml',
- 'views/commission_internal.xml',
- 'views/keywords.xml',
- 'views/token_log.xml',
- 'views/gudang_service.xml',
- 'views/kartu_stock.xml',
+ "data": [
+ "security/ir.model.access.csv",
+ "views/account_account_views.xml",
+ "views/account_asset_views.xml",
+ "views/account_bank_statement.xml",
+ "views/account_financial_report_view.xml",
+ "views/account_move_line.xml",
+ "views/account_move_multi_update_bills.xml",
+ "views/account_move_multi_update.xml",
+ "views/account_move_views.xml",
+ "views/account_move.xml",
+ "views/account_report_general_ledger_view.xml",
+ "views/advance_payment_request.xml",
+ "views/advance_payment_settlement.xml",
+ "views/airway_bill.xml",
+ "views/apache_solr_queue.xml",
+ "views/apache_solr.xml",
+ "views/approval_date_doc.xml",
+ "views/approval_invoice_date.xml",
+ "views/approval_payment_term.xml",
+ "views/approval_retur_picking.xml",
+ "views/approval_unreserve.xml",
+ "views/apps_stored.xml",
+ "views/assets.xml",
+ "views/automatic_purchase.xml",
+ "views/barcoding_product.xml",
+ "views/bill_receipt.xml",
+ "views/blog_post.xml",
+ "views/brand_vendor.xml",
+ "views/close_tempo_mail_template.xml",
+ "views/commission_internal.xml",
+ "views/coretax_faktur.xml",
+ "views/cost_centre.xml",
+ "views/coupon_program.xml",
+ "views/crm_lead.xml",
+ "views/cust_commision.xml",
+ "views/custom_mail_marketing.xml",
+ "views/customer_commision.xml",
+ "views/customer_review.xml",
+ "views/def_cargo_city.xml",
+ "views/def_cargo_district.xml",
+ "views/def_cargo_province.xml",
+ "views/delivery_carrier.xml",
+ "views/delivery_order.xml",
+ "views/domain_apo.xml",
+ "views/dunning_run_ged.xml",
+ "views/dunning_run.xml",
+ "views/find_page.xml",
+ "views/form_vendor_approval_multi_approve.xml",
+ "views/form_vendor_approval_multi_reject.xml",
+ "views/ged_tracking.xml",
+ "views/group_partner.xml",
+ "views/gudang_service.xml",
+ "views/invoice_reklas_penjualan.xml",
+ "views/invoice_reklas.xml",
+ "views/ip_lookup.xml",
+ "views/ir_sequence.xml",
+ "views/kartu_stock.xml",
+ "views/keywords.xml",
+ "views/landedcost.xml",
+ "views/leads_monitoring.xml",
+ "views/letter_receivable_mail_template.xml",
+ "views/letter_receivable.xml",
+ "views/logbook_bill.xml",
+ "views/logbook_sj.xml",
+ "views/mail_template_efaktur.xml",
+ "views/mail_template_invoice_po.xml",
+ "views/mail_template_invoice_reminder.xml",
+ "views/mail_template_po.xml",
+ "views/mail_template_pum.xml",
+ "views/midtrans.xml",
+ "views/mrp_production.xml",
+ "views/partner_payment_term.xml",
+ "views/po_multi_cancel.xml",
+ "views/price_group.xml",
+ "views/procurement_monitoring_detail.xml",
+ "views/product_attribute_value.xml",
+ "views/product_monitoring.xml",
+ "views/product_pricelist_item.xml",
+ "views/product_pricelist.xml",
+ "views/product_product.xml",
+ "views/product_public_category.xml",
+ "views/product_sla.xml",
+ "views/product_template.xml",
+ "views/project_views.xml",
+ "views/promotion/promotion_monitoring.xml",
+ "views/promotion/promotion_product.xml",
+ "views/promotion/promotion_program_line.xml",
+ "views/promotion/promotion_program.xml",
+ "views/public_holiday.xml",
+ "views/purchase_order_multi_ask_approval.xml",
+ "views/purchase_order_multi_confirm.xml",
+ "views/purchase_order_multi_uangmuka.xml",
+ "views/purchase_order_multi_uangmuka2.xml",
+ "views/purchase_order_multi_update.xml",
+ "views/purchase_order.xml",
+ "views/purchase_outstanding.xml",
+ "views/purchase_pricelist.xml",
+ "views/purchasing_job_multi_update.xml",
+ "views/purchasing_job_state.xml",
+ "views/purchasing_job.xml",
+ "views/quotation_so_multi_update.xml",
+ "views/raja_ongkir.xml",
+ "views/refund_sale_order.xml",
+ "views/report_logbook_bill.xml",
+ "views/report_logbook_sj.xml",
+ "views/requisition.xml",
+ "views/res_groups.xml",
+ "views/res_partner_company_type.xml",
+ "views/res_partner_site.xml",
+ "views/res_partner.xml",
+ "views/res_users.xml",
+ "views/role_permission/ir_model_access.xml",
+ "views/role_permission/res_groups.xml",
+ "views/sale_monitoring_detail_v2.xml",
+ "views/sale_monitoring_detail.xml",
+ "views/sale_monitoring.xml",
+ "views/sale_order_delay.xml",
+ "views/sale_order_multi_uangmuka_penjualan.xml",
+ "views/sale_order.xml",
+ "views/sale_orders_multi_update.xml",
+ "views/sales_outstanding.xml",
+ "views/sales_target.xml",
+ "views/shipment_group.xml",
+ "views/sj_tele.xml",
+ "views/stock_backorder_confirmation_views.xml",
+ "views/stock_inventory.xml",
+ "views/stock_location.xml",
+ "views/stock_move_line.xml",
+ "views/stock_picking_type.xml",
+ "views/stock_picking.xml",
+ "views/stock_quant.xml",
+ "views/stock_vendor.xml",
+ "views/stock_warehouse_orderpoint.xml",
+ "views/token_log.xml",
+ "views/tukar_guling_po.xml",
+ "views/tukar_guling.xml",
+ "views/uangmuka_pembelian.xml",
+ "views/uangmuka_penjualan.xml",
+ "views/unpaid_invoice_view.xml",
+ "views/uom_uom.xml",
+ "views/upah_harian_office_views.xml",
+ "views/update_date_planned_po_wizard_view.xml",
+ "views/update_depreciation_move_wizard_view.xml",
+ "views/user_company_request.xml",
+ "views/user_pengajuan_tempo_request.xml",
+ "views/user_pengajuan_tempo.xml",
+ "views/users.xml",
+ "views/vendor_approval.xml",
+ "views/vendor_payment_term.xml",
+ "views/vendor_sla.xml",
+ "views/vit_kecamatan.xml",
+ "views/vit_kelurahan.xml",
+ "views/vit_kota.xml",
+ "views/voucher.xml",
+ "views/wati_history.xml",
+ "views/wati.xml",
+ "views/web_logging/user_activity_log.xml",
+ "views/web_logging/web_utm_source.xml",
+ "views/website_ads.xml",
+ "views/website_brand_homepage.xml",
+ "views/website_categories_homepage.xml",
+ "views/website_categories_lob.xml",
+ "views/website_categories_management.xml",
+ "views/website_content_channel.xml",
+ "views/website_content.xml",
+ "views/website_page_content.xml",
+ "views/website_telegram.xml",
+ "views/website_user_cart.xml",
+ "views/website_user_wishlist.xml",
+ "views/x_banner_banner.xml",
+ "views/x_banner_category.xml",
+ "views/x_biaya_kirim.xml",
+ "views/x_manufactures.xml",
+ "views/x_partner_purchase_order.xml",
+ "views/x_product_tags.xml",
+ "views/upah_harian_office_views.xml",
+ "report/purchase_order.xml",
+ "report/purchase_report_internal.xml",
+ "report/purchase_report.xml",
+ "report/report_banner_banner.xml",
+ "report/report_banner_banner2.xml",
+ "report/report_invoice.xml",
+ "report/report_picking.xml",
+ "report/report_sale_order.xml",
+ "report/report_surat_piutang.xml",
+ "report/report_tutup_tempo.xml",
+ "report/report.xml"
],
'demo': [],
'css': [],
diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py
index 31ee5108..b11b961f 100755
--- a/indoteknik_custom/models/__init__.py
+++ b/indoteknik_custom/models/__init__.py
@@ -170,3 +170,4 @@ from . import update_depreciation_move_wizard
from . import keywords
from . import token_log
from . import kartu_stock
+from . import upah_harian_office
diff --git a/indoteknik_custom/models/upah_harian_office.py b/indoteknik_custom/models/upah_harian_office.py
index b2c12bd5..7db56cdd 100644
--- a/indoteknik_custom/models/upah_harian_office.py
+++ b/indoteknik_custom/models/upah_harian_office.py
@@ -2,13 +2,17 @@ from odoo import models, fields, api
from odoo.exceptions import UserError, ValidationError
class UpahHarianOffice(models.Model):
- _name = 'upah.harian.office'
- _description = 'Upah Harian Office'
+ _name = 'upah.harian'
+ _description = 'Upah Harian'
+ _inherit = ['mail.thread', 'mail.activity.mixin']
name = fields.Char()
pemohon = fields.Many2one('res.users', String='Pemohon', required=True)
tanggal = fields.Date('Tanggal Pengajuan', required=True)
- state = fields.Selection([('draft', 'Draft'), ('done', 'Done')], default='draft')
+ upah_harian = fields.Float('Upah Harian')
+ notes = fields.Text('Notes')
+ state = fields.Selection([('draft', 'Draft'), ('approved', 'Approved'), ('paid', 'Paid'), ('cancel', 'Canceled')], default='draft')
+ cancel_reason = fields.Text('Alasan Cancel')
attachment = fields.Binary('Attachment')
approved_by = fields.Char('Approved By')
attachment_type = fields.Selection([('pdf', 'PDF'), ('image', 'Image')])
@@ -22,11 +26,11 @@ class UpahHarianOffice(models.Model):
('fat', 'FAT'),
('it', 'IT'),
('hr_ga', 'HR & GA'),
- ('pimpinan', 'Pimpinan')
], string='Departement Type', tracking=3, required=True)
+ is_ganti_jam = fields.Boolean('Ganti Jam?', default="False")
total_upah = fields.Float('Total Upah Harian', compute='_compute_total_upah')
- @api.models
+ @api.model
def create(self, vals):
vals['name'] = self.env['ir.sequence'].next_by_code('upah.harian.office')
return super(UpahHarianOffice, self).create(vals)
@@ -40,18 +44,32 @@ class UpahHarianOffice(models.Model):
raise UserError("Only PIC user can approve this document.")
self.state = 'done'
+ def action_reset_to_draft(self):
+ if self.state == 'cancel':
+ self.state = 'draft'
+
+ def action_cancel(self):
+ if self.state == 'draft':
+ if self.cancel_reason == '' or self.cancel_reason == False:
+ raise UserError ('Harus Isi Alasan Cancel')
+ else:
+ self.state = 'cancel'
def _compute_total_upah(self):
- for line in self:
- line.total_upah = sum(line.mapped('upah_harian_line').mapped('upah_harian'))
+ if self.departement_type != 'logistic':
+ for line in self:
+ line.total_upah = sum(line.mapped('upah_harian_line').mapped('upah_harian'))
+
+ def action_create_journal_entries(self):
+ return
class UpahHarianOfficeLine(models.Model):
_name = 'upah.harian.line'
_description = 'Upah Harian Line'
- upah_harian_id = fields.Many2one('upah.harian.office')
- upah_harian= fields.Float('Upah Harian', required=True, compute='_compute_upah_harian')
+ upah_harian_id = fields.Many2one('upah.harian')
+ upah_harian_compute = fields.Float('Upah Harian Computed', required=True, compute='_compute_upah_harian')
hari = fields.Char('Hari')
jam_masuk = fields.Float('Jam Masuk', required=True)
jam_keluar = fields.Float('Jam Keluar', required=True)
diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv
index 42c68e80..8f3bc9df 100755
--- a/indoteknik_custom/security/ir.model.access.csv
+++ b/indoteknik_custom/security/ir.model.access.csv
@@ -222,3 +222,6 @@ access_update_depreciation_move_wizard,access.update.depreciation.move.wizard,mo
access_keywords,keywords,model_keywords,base.group_user,1,1,1,1
access_token_log,access.token.log,model_token_log,,1,1,1,1
+
+access_upah_harian_office,upah.harian.office,model_upah_harian,base.group_user,1,1,1,1
+access_upah_harian_office_line,upah.harian.line,model_upah_harian_line,base.group_user,1,1,1,1 \ No newline at end of file
diff --git a/indoteknik_custom/views/upah_harian_office_views.xml b/indoteknik_custom/views/upah_harian_office_views.xml
new file mode 100644
index 00000000..1ec681d1
--- /dev/null
+++ b/indoteknik_custom/views/upah_harian_office_views.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <!-- View upah.harian.office View Tree -->
+ <record id="view_upah_harian_tree" model="ir.ui.view">
+ <field name="name">view.upah.harian.tree</field>
+ <field name="model">upah.harian</field>
+ <field name="arch" type="xml">
+ <tree>
+ <field name="name"/>
+ <field name="pemohon"/>
+ <field name="tanggal"/>
+ <field name="state"/>
+
+ </tree>
+ </field>
+ </record>
+
+ <!-- View upah.harian.office form -->
+ <record id="view_upah_harian_form" model="ir.ui.view">
+ <field name="name">view.upah.harian.form</field>
+ <field name="model">upah.harian</field>
+ <field name="arch" type="xml">
+ <form string="Upah Harian Office">
+
+ <header>
+ <button name="action_create_journal_entries" class="btn-primary" type="object" string="Create Journal Entries" attrs="{'invisible': [('state', 'not in', ['done'])]}"/>
+ <field name="state" widget="statusbar" readonly="1"/>
+ </header>
+
+ <sheet>
+ <div class="oe_title">
+ <label for="name"/>
+ <h1>
+ <field name="name"/>
+ </h1>
+ </div>
+
+ <group>
+ <group>
+ <field name="pemohon"/>
+ <field name="tanggal"/>
+ <field name="upah_harian"/>
+ </group>
+
+ <group>
+ <field name="attachment_type"/>
+ <field name="attachment"/>
+ </group>
+ </group>
+ </sheet>
+
+ </form>
+ </field>
+ </record>
+
+ <!-- View upah.harian.office search -->
+ <record id="view_upah_harian_search" model="ir.ui.view">
+ <field name="name">view.upah.harian.search</field>
+ <field name="model">upah.harian</field>
+ <field name="arch" type="xml">
+ <search>
+ <group expand="1" string="Group By">
+ <filter string="Name" name="name" domain="[]" context="{'group_by':'name'}"/>
+ </group>
+ </search>
+ </field>
+ </record>
+
+
+ <menuitem id="menu_upah_harian" name="Upah Harian" parent="account.menu_finance_entries" sequence="114" action="action_advance_payment_settlement" />
+
+</odoo>