mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] formatting, rml fixes
This commit is contained in:
@@ -2,13 +2,11 @@
|
|||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
|
<!--
|
||||||
#---------------------------------------------------------------------------------------------------------
|
Hours block menu
|
||||||
# Hours block menu
|
-->
|
||||||
#---------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
<record model="ir.actions.act_window" id="action_all_block_hour">
|
<record model="ir.actions.act_window" id="action_all_block_hour">
|
||||||
<field name="name">Hours Block</field>
|
<field name="name">Hours Blocks</field>
|
||||||
<field name="res_model">account.hours.block</field>
|
<field name="res_model">account.hours.block</field>
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
import time
|
import time
|
||||||
from openerp.report import report_sxw
|
from openerp.report import report_sxw
|
||||||
|
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
|
||||||
|
|
||||||
|
|
||||||
class account_hours_block(report_sxw.rml_parse):
|
class account_hours_block(report_sxw.rml_parse):
|
||||||
@@ -28,6 +29,7 @@ class account_hours_block(report_sxw.rml_parse):
|
|||||||
super(account_hours_block, self).__init__(cr, uid, name, context=context)
|
super(account_hours_block, self).__init__(cr, uid, name, context=context)
|
||||||
self.localcontext.update({
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
|
'date_format': DEFAULT_SERVER_DATE_FORMAT,
|
||||||
'analytic_lines': self._get_analytic_lines,
|
'analytic_lines': self._get_analytic_lines,
|
||||||
})
|
})
|
||||||
self.context = context
|
self.context = context
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<drawString x="17.7cm" y="28.1cm">Maintenance And Support Summary</drawString>
|
<drawString x="17.7cm" y="28.1cm">Maintenance And Support Summary</drawString>
|
||||||
|
|
||||||
<setFont name="Helvetica" size="9"/>
|
<setFont name="Helvetica" size="9"/>
|
||||||
<drawString x="1.0cm" y="2cm"> [[ time.strftime("%m-%d-%y %H:%M", time.localtime()) ]]</drawString>
|
<drawString x="1.0cm" y="2cm"> [[ formatLang(time.strftime(date_format), date=True) ]]</drawString>
|
||||||
<drawString x="17.7cm" y="2cm">Page <pageNumber/></drawString>
|
<drawString x="17.7cm" y="2cm">Page <pageNumber/></drawString>
|
||||||
|
|
||||||
<lineMode width="0.7"/>
|
<lineMode width="0.7"/>
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
<para style="P12a">Report Date: </para>
|
<para style="P12a">Report Date: </para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="P2">[[ time.strftime("%d.%m.%Y", time.localtime()) ]]</para>
|
<para style="P2">[[ formatLang(time.strftime(date_format), date=True) ]]</para>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -198,7 +198,6 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<!-- <para style="P12a">[[ o.type == 'hours' and "Quantity of hours" or "Amount"]] used : </para> -->
|
|
||||||
<para style="P12a">Amount used: [[ (o.type == 'amount' or removeParentNode('para')) and '' ]]</para>
|
<para style="P12a">Amount used: [[ (o.type == 'amount' or removeParentNode('para')) and '' ]]</para>
|
||||||
<para style="P12a">Quantity of hours used: [[ (o.type == 'hours' or removeParentNode('para')) and '' ]]</para>
|
<para style="P12a">Quantity of hours used: [[ (o.type == 'hours' or removeParentNode('para')) and '' ]]</para>
|
||||||
</td>
|
</td>
|
||||||
@@ -208,7 +207,6 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<!-- <para style="P12a">Remaining [[ o.type == 'hours' and "hours" or "amount"]] : </para> -->
|
|
||||||
<para style="P12a">Remaining amount: [[ (o.type == 'amount' or removeParentNode('para')) and '' ]]</para>
|
<para style="P12a">Remaining amount: [[ (o.type == 'amount' or removeParentNode('para')) and '' ]]</para>
|
||||||
<para style="P12a">Remaining hours: [[ (o.type == 'hours' or removeParentNode('para')) and '' ]]</para>
|
<para style="P12a">Remaining hours: [[ (o.type == 'hours' or removeParentNode('para')) and '' ]]</para>
|
||||||
|
|
||||||
@@ -243,19 +241,19 @@
|
|||||||
<tr>
|
<tr>
|
||||||
[[ repeatIn(analytic_lines(o), 'l') ]]
|
[[ repeatIn(analytic_lines(o), 'l') ]]
|
||||||
<td>
|
<td>
|
||||||
<para style="P2">[[ l.date and formatLang(l.date, date=True) or '' ]]</para>
|
<para style="P2">[[ l.date if formatLang(l.date, date=True) else '' ]]</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="P2">[[ l.name or '' ]]</para>
|
<para style="P2">[[ l.name or '' ]]</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="P2c">[[ round(l.unit_amount or '0.0', 2) ]]</para>
|
<para style="P2c">[[ round(l.unit_amount, 2) or '0.0' ]]</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="P2c">[[ l.to_invoice.customer_name ]]</para>
|
<para style="P2c">[[ l.to_invoice.customer_name ]]</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="P2c">[[ round((l.unit_amount and l.to_invoice) and (l.unit_amount - (l.unit_amount * l.to_invoice.factor) / 100 ) or '0.0', 2) ]]</para>
|
<para style="P2c">[[ round((l.unit_amount and l.to_invoice) and (l.unit_amount - (l.unit_amount * l.to_invoice.factor) / 100 ), 2) or '0.0' ]]</para>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</blockTable>
|
</blockTable>
|
||||||
|
|||||||
Reference in New Issue
Block a user