summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/report_logbook_sj.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-02-07 10:45:51 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-02-07 10:45:51 +0700
commitf6be42d37a363b86f4a9ec71ccb38c78cbe2d887 (patch)
tree9c297e776f67e35671012e94d3c64007bd5090d7 /indoteknik_custom/models/report_logbook_sj.py
parentedb3c1c80931078d40a8f56149aeca9efdcdc07d (diff)
parent29a9ec94f1ad131f398cf119a03a7b927a4c6cba (diff)
Merge branch 'production' into purchasing-job
# Conflicts: # indoteknik_custom/__manifest__.py # indoteknik_custom/models/__init__.py # indoteknik_custom/models/automatic_purchase.py # indoteknik_custom/models/purchase_order_line.py # indoteknik_custom/security/ir.model.access.csv # indoteknik_custom/views/automatic_purchase.xml # indoteknik_custom/views/purchase_order.xml
Diffstat (limited to 'indoteknik_custom/models/report_logbook_sj.py')
-rw-r--r--indoteknik_custom/models/report_logbook_sj.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/indoteknik_custom/models/report_logbook_sj.py b/indoteknik_custom/models/report_logbook_sj.py
new file mode 100644
index 00000000..d2008608
--- /dev/null
+++ b/indoteknik_custom/models/report_logbook_sj.py
@@ -0,0 +1,34 @@
+from odoo import models, fields, api
+from odoo.exceptions import UserError
+from pytz import timezone
+from datetime import datetime
+
+class ReportLogbookSJ(models.Model):
+ _name = 'report.logbook.sj'
+
+ name = fields.Char(string='Nomor SJ', default='Logbook SJ')
+ date = fields.Datetime(string='Date')
+ name_picking = fields.Char(string='Picking Name')
+ partner_id = fields.Many2one('res.partner', string='Customer')
+ approve_by_finance = fields.Boolean(string='Approve By Finance')
+ report_logbook_sj_line = fields.One2many(
+ comodel_name='report.logbook.sj.line',
+ inverse_name='report_logbook_sj_id',
+ string='Logbook SJ Line'
+ )
+
+ def approve(self):
+ if self.env.user.is_accounting:
+ self.approve_by_finance = True
+ else:
+ raise UserError('Hanya Accounting yang bisa Approve')
+
+class ReportLogbookSJLine(models.Model):
+ _name = 'report.logbook.sj.line'
+
+ product_id = fields.Many2one(comodel_name='product.product', string='Product')
+ location_id = fields.Many2one(comodel_name='stock.location', string='From')
+ product_uom_qty = fields.Float(string='Reserved')
+ qty_done = fields.Float(string='Done')
+ product_uom_id = fields.Many2one('uom.uom', string='Unit of Measure')
+ report_logbook_sj_id = fields.Many2one('report.logbook.sj', string='Logbook SJ') \ No newline at end of file