summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-10-26 12:02:31 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-10-26 12:02:31 +0700
commit259497e322a2d7f482e3e345725a19ecc42ef96c (patch)
treeabd3dedbdae3b1d89c34afafd6e95755f228c351 /indoteknik_custom/models
parent28c6731e8ee1394f61ff88f2750f81d14eb5fb4e (diff)
window dunning run, still error, need fix
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/__init__.py1
-rw-r--r--indoteknik_custom/models/dunning_run.py33
2 files changed, 34 insertions, 0 deletions
diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py
index 37a8d31f..94fe56fe 100755
--- a/indoteknik_custom/models/__init__.py
+++ b/indoteknik_custom/models/__init__.py
@@ -28,3 +28,4 @@ from . import product_pricelist
from . import users
from . import ir_attachment
from . import delivery_carrier
+from . import dunning_run
diff --git a/indoteknik_custom/models/dunning_run.py b/indoteknik_custom/models/dunning_run.py
new file mode 100644
index 00000000..dc943c23
--- /dev/null
+++ b/indoteknik_custom/models/dunning_run.py
@@ -0,0 +1,33 @@
+from odoo import models, api, fields
+
+
+class DunningRun(models.Model):
+ _name = 'dunning.run'
+ _description = 'Dunning Run'
+ _order = 'dunning_date desc, id desc'
+
+ number = fields.Char(string='Document No', index=True, required=True, copy=False, readonly=True)
+ dunning_date = fields.Date(string='Dunning Date')
+ partner_id = fields.Many2one(
+ 'res.partner', string='Customer', readonly=True,
+ states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
+ required=True, change_default=True, index=True, tracking=1,
+ domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", )
+ order_line = fields.One2many('dunning.run.line', 'dunning_id', string='Dunning Lines',
+ auto_join=True)
+ dunning_level = fields.Integer(string='Dunning Level', default=30, help='30 hari sebelum jatuh tempo invoice')
+
+
+class DunningRunLine(models.Model):
+ _name = 'dunning.run.line'
+ _description = 'Dunning Run Line'
+ _order = 'dunning_id, id'
+
+ dunning_id = fields.Many2one('dunning.run', string='Dunning Ref', required=True, ondelete='cascade', index=True, copy=False)
+ invoice_id = fields.Many2one('account.move', string='Invoice')
+ date_invoice = fields.Date(string='Invoice Date')
+ # due_date = fields.Date(string='Due Date')
+ efaktur_id = fields.Many2one('vit.efaktur', string='Faktur Pajak')
+ reference = fields.Char(string='Reference')
+ open_amt = fields.Float(string='Open Amount')
+