[FIX] renamed ir.actions.report.paperformat model to report.paperformat, renamed html_skeleton to html_container in report layouts and renamed paperformat.py file to report_paperformat.py

bzr revid: sle@openerp.com-20140218155347-tfxlndg9wgaw0bv1
This commit is contained in:
Simon Lejeune 2014-02-18 16:53:47 +01:00
parent 47d1019ed0
commit fabc1cdd40
17 changed files with 75 additions and 80 deletions

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<template id="report_vat">
<t t-call="report.html_skeleton">
<t t-call="report.html_container">
<t t-call="report.internal_layout">
<div class="page">
<h2>Tax Statement</h2>

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<template id="report_lunchorder">
<t t-call="report.html_skeleton">
<t t-call="report.html_container">
<t t-call="report.external_layout">
<div class="page">
<div class="oe_structure"/>

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<template id="report_mrporder">
<t t-call="report.html_skeleton">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report.internal_layout">
<div class="page">

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<template id="report_mrprepairorder">
<t t-call="report.html_skeleton">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
<div class="page">

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<template id="report_purchaseorder">
<t t-call="report.html_skeleton">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
<div class="page">

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<template id="report_purchasequotation">
<t t-call="report.html_skeleton">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
<div class="page">

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<template id="report_purchaserequisitions">
<t t-call="report.html_skeleton">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
<div class="page">

View File

@ -12,7 +12,7 @@ Report
'views/layouts.xml',
'views/paperformat_view.xml',
'views/res_company_view.xml',
'data/paperformat_defaults.xml',
'data/report_paperformat.xml',
'security/ir.model.access.csv',
],
'js': [

View File

@ -36,7 +36,6 @@ try:
except ImportError:
import StringIO
from pyPdf import PdfFileWriter, PdfFileReader
from werkzeug.test import Client
from werkzeug.wrappers import BaseResponse

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="paperformat_euro" model="ir.actions.report.paperformat">
<record id="paperformat_euro" model="report.paperformat">
<field name="name">European A4</field>
<field name="default" eval="True" />
<field name="format">A4</field>
@ -17,7 +17,7 @@
<field name="dpi">90</field>
</record>
<record id="paperformat_us" model="ir.actions.report.paperformat">
<record id="paperformat_us" model="report.paperformat">
<field name="name">US Letter</field>
<field name="default" eval="True" />
<field name="format">Letter</field>

View File

@ -1,3 +1,3 @@
import report
import paperformat
import report_paperformat

View File

@ -62,6 +62,20 @@ class report(osv.Model):
d = obj._field.digits[1] or DEFAULT_DIGITS
return d
def _get_lang_dict(self):
pool_lang = self.pool['res.lang']
lang = self.localcontext.get('lang', 'en_US') or 'en_US'
lang_ids = pool_lang.search(request.cr, request.uid, [('code', '=', lang)])[0]
lang_obj = pool_lang.browse(request.cr, request.uid, lang_ids)
lang_dict = {
'lang_obj': lang_obj,
'date_format': lang_obj.date_format,
'time_format': lang_obj.time_format
}
self.lang_dict.update(lang_dict)
self.default_lang[lang] = self.lang_dict.copy()
return True
def formatLang(self, value, digits=None, date=False, date_time=False, grouping=True, monetary=False, dp=False, currency_obj=False):
"""
Assuming 'Account' decimal.precision=3:
@ -116,20 +130,6 @@ class report(osv.Model):
res = '%s %s' % (currency_obj.symbol, res)
return res
def _get_lang_dict(self):
pool_lang = self.pool['res.lang']
lang = self.localcontext.get('lang', 'en_US') or 'en_US'
lang_ids = pool_lang.search(request.cr, request.uid, [('code', '=', lang)])[0]
lang_obj = pool_lang.browse(request.cr, request.uid, lang_ids)
lang_dict = {
'lang_obj': lang_obj,
'date_format': lang_obj.date_format,
'time_format': lang_obj.time_format
}
self.lang_dict.update(lang_dict)
self.default_lang[lang] = self.lang_dict.copy()
return True
def render(self, cr, uid, ids, template, values=None, context=None):
if values is None:
values = {}
@ -228,8 +228,8 @@ class report(osv.Model):
return action
def eval_params(self, dict_param):
"""Parse a dictionary generated from the webclient into a dictionary understandable by a
wizard controller.
"""Parse a dictionary generated by the webclient (javascript) into a dictionary
understandable by a wizard controller (python).
"""
for key, value in dict_param.iteritems():
if value.lower() == 'false':

View File

@ -22,8 +22,8 @@
from openerp.osv import osv, fields
class actions_report_paperformat(osv.Model):
_name = "ir.actions.report.paperformat"
class report_paperformat(osv.Model):
_name = "report.paperformat"
_description = "Allows customization of a report."
_columns = {'name': fields.char('Name', required=True),
@ -98,10 +98,10 @@ class actions_report_paperformat(osv.Model):
class res_company(osv.Model):
_inherit = 'res.company'
_columns = {'paperformat_id': fields.many2one('ir.actions.report.paperformat', 'Paper format')}
_columns = {'paperformat_id': fields.many2one('report.paperformat', 'Paper format')}
class ir_actions_report(osv.Model):
_inherit = 'ir.actions.report.xml'
_columns = {'paperformat_id': fields.many2one('ir.actions.report.paperformat', 'Paper format')}
_columns = {'paperformat_id': fields.many2one('report.paperformat', 'Paper format')}

View File

@ -1,4 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"paperformat_access_portal","ir_actions_report_paperformat group_portal","model_ir_actions_report_paperformat",,1,0,0,0
"paperformat_access_employee","ir_actions_report_paperformat group_hr_user","model_ir_actions_report_paperformat",,1,0,1,0
"paperformat_access_portal","ir_actions_report_paperformat group_portal","model_report_paperformat",,1,0,0,0
"paperformat_access_employee","ir_actions_report_paperformat group_hr_user","model_report_paperformat",,1,0,1,0
"access_report","access_report","model_report",,1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 paperformat_access_portal ir_actions_report_paperformat group_portal model_ir_actions_report_paperformat model_report_paperformat 1 0 0 0
3 paperformat_access_employee ir_actions_report_paperformat group_hr_user model_ir_actions_report_paperformat model_report_paperformat 1 0 1 0
4 access_report access_report model_report 1 1 1 1

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="html_skeleton">
<template id="html_container">
&lt;!DOCTYPE html&gt;
<html t-att-lang="lang and lang.replace('_', '-')"
t-att-data-website-id="website.id if editable else None"
@ -170,7 +170,7 @@
<t t-raw="0" />
</template>
<template id="editor_head" inherit_id="report.html_skeleton" name="Editor" groups="base.group_website_publisher">
<template id="editor_head" inherit_id="report.html_container" name="Editor" groups="base.group_website_publisher">
<xpath expr="//body" position="attributes">
<attribute name="style">padding-top: 51px;</attribute>
</xpath>

View File

@ -18,7 +18,7 @@
<record id="paperformat_view_tree" model="ir.ui.view">
<field name="name">paper_format_view_tree</field>
<field name="model">ir.actions.report.paperformat</field>
<field name="model">report.paperformat</field>
<field name="arch" type="xml">
<tree string="Paper format configuration">
<field name="name" />
@ -28,7 +28,7 @@
<record id="paperformat_view_form" model="ir.ui.view">
<field name="name">paper_format_view_form</field>
<field name="model">ir.actions.report.paperformat</field>
<field name="model">report.paperformat</field>
<field name="arch" type="xml">
<form string="Paper format configuration" version="7.0">
<group>
@ -53,7 +53,7 @@
<record id="paper_format_action" model="ir.actions.act_window">
<field name="name">Paper Format General Configuration</field>
<field name="res_model">ir.actions.report.paperformat</field>
<field name="res_model">report.paperformat</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<template id="report_saleorder">
<t t-call="report.html_skeleton">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
<div class="page">
@ -53,46 +53,42 @@
</div>
</div>
<div class="row">
<div class="col-xs-12">
<table class="table table-condensed">
<thead>
<tr>
<th>Description</th>
<th>Taxes</th>
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
<th groups="sale.group_discount_per_so_line">Disc.(%)</th>
<th class="text-right">Price</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.order_line" t-as="l">
<td>
<span t-field="l.name"/>
</td>
<td>
<span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>
</td>
<td class="text-right">
<span t-field="l.product_uom_qty"/>
<span groups="product.group_uom" t-field="l.product_uom"/>
</td>
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td groups="sale.group_discount_per_so_line">
<span t-field="l.discount"/>
</td>
<td class="text-right">
<span t-field="l.price_subtotal"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<table class="table table-condensed">
<thead>
<tr>
<th>Description</th>
<th>Taxes</th>
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
<th groups="sale.group_discount_per_so_line">Disc.(%)</th>
<th class="text-right">Price</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.order_line" t-as="l">
<td>
<span t-field="l.name"/>
</td>
<td>
<span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>
</td>
<td class="text-right">
<span t-field="l.product_uom_qty"/>
<span groups="product.group_uom" t-field="l.product_uom"/>
</td>
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td groups="sale.group_discount_per_so_line">
<span t-field="l.discount"/>
</td>
<td class="text-right">
<span t-field="l.price_subtotal"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-xs-4 pull-right">