summaryrefslogtreecommitdiff
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
parent28c6731e8ee1394f61ff88f2750f81d14eb5fb4e (diff)
window dunning run, still error, need fix
-rwxr-xr-xindoteknik_custom/__manifest__.py1
-rwxr-xr-xindoteknik_custom/models/__init__.py1
-rw-r--r--indoteknik_custom/models/dunning_run.py33
-rw-r--r--indoteknik_custom/views/dunning_run.xml21
4 files changed, 56 insertions, 0 deletions
diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py
index ad3f8af8..a703bcef 100755
--- a/indoteknik_custom/__manifest__.py
+++ b/indoteknik_custom/__manifest__.py
@@ -43,6 +43,7 @@
'views/users.xml',
'views/delivery_carrier.xml',
'views/account_move.xml',
+ 'views/dunning_run.xml',
'report/report.xml',
'report/report_banner_banner.xml',
'report/report_banner_banner2.xml',
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')
+
diff --git a/indoteknik_custom/views/dunning_run.xml b/indoteknik_custom/views/dunning_run.xml
new file mode 100644
index 00000000..5036b1cd
--- /dev/null
+++ b/indoteknik_custom/views/dunning_run.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<odoo>
+ <record id="dunning_run_tree" model="ir.ui.view">
+ <field name="name">dunning.run.tree</field>
+ <field name="model">dunning.run</field>
+ <field name="arch" type="xml">
+ <tree>
+ <field name="id"/>
+ <field name="number"/>
+ <field name="dunning_date"/>
+ <field name="partner_id"/>
+ <field name="dunning_level"/>
+ </tree>
+ </field>
+ </record>
+
+ <menuitem id="menu_dunning_run"
+ name="Dunning Run"
+ action="dunning_run_tree"
+ parent="account.account_reports_management_menu"/>
+</odoo> \ No newline at end of file