summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/report_logbook_sj.py
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2024-02-02 14:07:43 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2024-02-02 14:07:43 +0700
commitc26ea43e1d8c3c5bfffb94bc1432589a9f2815c9 (patch)
tree86b02e1b4d362617b168f4cb0a5777be483d07fb /indoteknik_custom/models/report_logbook_sj.py
parent8bc43445f1d0b70d54d0a45830e04d0fcc406fbe (diff)
parentf5edc62d22c9a3973261ad289a11e189f0866f52 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
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