summaryrefslogtreecommitdiff
path: root/addons/account_test/models
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/account_test/models
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/account_test/models')
-rw-r--r--addons/account_test/models/__init__.py4
-rw-r--r--addons/account_test/models/accounting_assert_test.py24
2 files changed, 28 insertions, 0 deletions
diff --git a/addons/account_test/models/__init__.py b/addons/account_test/models/__init__.py
new file mode 100644
index 00000000..2fbb7774
--- /dev/null
+++ b/addons/account_test/models/__init__.py
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from . import accounting_assert_test
diff --git a/addons/account_test/models/accounting_assert_test.py b/addons/account_test/models/accounting_assert_test.py
new file mode 100644
index 00000000..69d6f159
--- /dev/null
+++ b/addons/account_test/models/accounting_assert_test.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import fields, models
+
+CODE_EXEC_DEFAULT = '''\
+res = []
+cr.execute("select id, code from account_journal")
+for record in cr.dictfetchall():
+ res.append(record['code'])
+result = res
+'''
+
+
+class AccountingAssertTest(models.Model):
+ _name = "accounting.assert.test"
+ _description = 'Accounting Assert Test'
+ _order = "sequence"
+
+ name = fields.Char(string='Test Name', required=True, index=True, translate=True)
+ desc = fields.Text(string='Test Description', index=True, translate=True)
+ code_exec = fields.Text(string='Python code', required=True, default=CODE_EXEC_DEFAULT)
+ active = fields.Boolean(default=True)
+ sequence = fields.Integer(default=10)