mirror of
https://github.com/bringout/oca-ocb-accounting.git
synced 2026-04-23 14:42:05 +02:00
19.0 vanilla
This commit is contained in:
parent
ba20ce7443
commit
768b70e05e
2357 changed files with 1057103 additions and 712486 deletions
|
|
@ -2,14 +2,14 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import datetime
|
||||
from odoo import api, models, _
|
||||
from odoo import api, models
|
||||
from odoo.tools.safe_eval import safe_eval
|
||||
#
|
||||
# Use period and Journal for selection or resources
|
||||
#
|
||||
|
||||
|
||||
class ReportAssertAccount(models.AbstractModel):
|
||||
class ReportAccount_TestReport_Accounttest(models.AbstractModel):
|
||||
_name = 'report.account_test.report_accounttest'
|
||||
_description = 'Account Test Report'
|
||||
|
||||
|
|
@ -35,22 +35,22 @@ class ReportAssertAccount(models.AbstractModel):
|
|||
cols = list(item)
|
||||
return [(col, item.get(col)) for col in cols if col in item]
|
||||
|
||||
localdict = {
|
||||
context = {
|
||||
'cr': self.env.cr,
|
||||
'uid': self.env.uid,
|
||||
'reconciled_inv': reconciled_inv, # specific function used in different tests
|
||||
'result': None, # used to store the result of the test
|
||||
'column_order': None, # used to choose the display order of columns (in case you are returning a list of dict)
|
||||
'_': lambda *a, **kw: _(*a, **kw), # pylint: disable=E8502
|
||||
'_': lambda *a, **kw: self.env._(*a, **kw), # pylint: disable=E8502,
|
||||
}
|
||||
safe_eval(code_exec, localdict, mode="exec", nocopy=True)
|
||||
result = localdict['result']
|
||||
column_order = localdict.get('column_order', None)
|
||||
safe_eval(code_exec, context, mode="exec")
|
||||
result = context['result']
|
||||
column_order = context.get('column_order')
|
||||
|
||||
if not isinstance(result, (tuple, list, set)):
|
||||
result = [result]
|
||||
if not result:
|
||||
result = [_('The test was passed successfully')]
|
||||
result = [self.env._('The test was passed successfully')]
|
||||
else:
|
||||
def _format(item):
|
||||
if isinstance(item, dict):
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@
|
|||
<t t-call="web.html_container">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2>Accounting tests on <span t-esc="datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')"/></h2>
|
||||
<h2>Accounting tests on <span t-out="datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')"/></h2>
|
||||
<div t-foreach="docs" t-as="o">
|
||||
<p>
|
||||
<strong>Name:</strong> <span t-field="o.name"/><br/>
|
||||
<strong>Description:</strong> <span t-field="o.desc"/>
|
||||
</p>
|
||||
<p t-foreach="execute_code(o.code_exec)" t-as="test_result">
|
||||
<span t-esc="test_result"/>
|
||||
<span t-out="test_result"/>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue