The report is displayed on the first page

Otherwise one needs to switch page every time.
Use a field.Html for the report so we can emphasise the main information.

The page where the report was should be displayed only for technical users,
it is meaningless for normal users.
This commit is contained in:
Guewen Baconnier
2014-12-15 13:59:17 +01:00
parent 54b59a9254
commit 7eac11eb4e
2 changed files with 10 additions and 8 deletions

View File

@@ -49,7 +49,7 @@ class CreditControlRun(models.Model):
states={'draft': [('readonly', False)]},
default=_get_policies,
)
report = fields.Text(string='Report', readonly=True, copy=False)
report = fields.Html(string='Report', readonly=True, copy=False)
state = fields.Selection([('draft', 'Draft'),
('done', 'Done')],
string='State',
@@ -123,13 +123,13 @@ class CreditControlRun(models.Model):
self.date)
generated |= policy_lines_generated
if policy_lines_generated:
report += (_("Policy \"%s\" has generated %d Credit "
"Control Lines.\n") %
report += (_("Policy \"<b>%s</b>\" has generated <b>%d Credit "
"Control Lines.</b><br/>") %
(policy.name, len(policy_lines_generated)))
else:
report += _(
"Policy \"%s\" has not generated any "
"Credit Control Lines.\n" % policy.name
"Policy \"<b>%s</b>\" has not generated any "
"Credit Control Lines.<br/>" % policy.name
)
vals = {'state': 'done',

View File

@@ -29,10 +29,12 @@
<notebook>
<page string="Policies">
<field name="policy_ids" colspan="4" nolabel="1"/>
<separator string="Report"
attrs="{'invisible': [('report', '=', False)]}"/>
<field name="report" colspan="4" nolabel="1"
attrs="{'invisible': [('report', '=', False)]}"/>
</page>
<page string="Report and Errors">
<field name="report" colspan="4" nolabel="1"/>
<separator string="Move lines To be treated manually"/>
<page string="Manual Lines" groups="base.group_no_one">
<field name="manual_ids" colspan="4" nolabel="1"/>
</page>
</notebook>