bzr revid: hmo@tinyerp.com-20100929094456-pjhghp5o5zf2kq90
This commit is contained in:
Harry (OpenERP)
2010-09-29 15:14:56 +05:30
11 changed files with 85 additions and 40 deletions
+10 -9
View File
@@ -82,16 +82,15 @@
context="{'user_id': self, 'user_preference': 1}" groups="base.group_multi_company"/>
<field name="view" readonly="0"/>
<label string="" colspan="2"/>
<field name="menu_tips" colspan="2" readonly="0"/>
<newline/>
<separator colspan="4" string="Preferences"/>
</page>
<page string="Preferences">
<field name="password" password="True" readonly="0" colspan="4"/>
<field name="password" password="True" readonly="0" />
<field name="context_lang" completion="1" readonly="0"/>
<label string="" colspan="1"/>
<label colspan="3" string="You must logout and login again after changing your password."/>
<field name="context_lang" completion="1" readonly="0"/>
<field name="context_tz" completion="1" readonly="0"/>
<field name="menu_tips" colspan="2" readonly="0"/>
<separator string="Email &amp; Signature" colspan="4"/>
<group colspan="4"><field name="user_email" widget="email"/></group>
<field colspan="4" name="signature" readonly="0" nolabel="1"/>
@@ -114,16 +113,18 @@
<newline/>
<notebook colspan="4">
<page string="User">
<field name="address_id" select="1"/>
<field name="user_email" widget="email"/>
<field name="company_id" required="1"
context="{'user_id': self, 'user_preference': 1}"
on_change="on_change_company_id(company_id)"
groups="base.group_multi_company"
/>
/>
<field name="address_id" select="1"/>
<field name="user_email" widget="email"/>
<field name="context_lang"/>
<field domain="[('usage','=','menu')]" name="menu_id" required="True"/>
<field name="action_id" required="True"/>
<field domain="[('usage','=','menu')]" name="menu_id" required="True"/>
<field name="context_lang"/>
<field name="context_tz"/>
<field name="view" readonly="0"/>
<field name="menu_tips" colspan="2"/>
+1 -18
View File
@@ -209,16 +209,6 @@ class act_window(osv.osv):
res[act.id] = str(form_arch)
return res
def _get_help_status(self, cr, uid, ids, name, arg, context={}):
activate_tips = self.pool.get('res.users').browse(cr, uid, uid).menu_tips
if activate_tips:
cr.execute(""" SELECT action.id,
CASE WHEN r.uid IS NULL THEN True ELSE False END
AS help_status FROM ir_act_window action
LEFT JOIN ir_act_window_user_rel r ON
(action.id = r.act_id AND (r.uid IS NULL or r.uid= %s)) WHERE action.id = ANY(%s)""",(uid,ids,))
return dict(cr.fetchall())
_columns = {
'name': fields.char('Action Name', size=64, translate=True),
'type': fields.char('Action Type', size=32, required=True),
@@ -252,8 +242,6 @@ class act_window(osv.osv):
'menus': fields.char('Menus', size=4096),
'help': fields.text('Action description',
help='Optional help text for the users with a description of the target view, such as its usage and purpose.'),
'display_help':fields.function(_get_help_status, type='boolean', method=True, string='Display Help',
help='It gives the status if the help message has to be displayed or not when a user performs an action')
}
_defaults = {
@@ -266,12 +254,7 @@ class act_window(osv.osv):
'auto_refresh': lambda *a: 0,
'auto_search':lambda *a: True
}
def _auto_init(self, cr, context={}):
super(act_window, self)._auto_init(cr, context)
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'act_window_action_uid_index\'')
if not cr.fetchone():
cr.execute('CREATE INDEX act_window_action_uid_index ON ir_act_window_user_rel (act_id, uid)')
cr.commit()
act_window()
class act_window_view(osv.osv):
@@ -95,7 +95,7 @@ class base_module_upgrade(osv.osv_memory):
if dep_mod.state in ('unknown','uninstalled'):
unmet_packages.append(dep_mod.name)
if len(unmet_packages):
raise wizard.except_wizard('Unmet dependency !', 'Following modules are uninstalled or unknown. \n\n'+'\n'.join(unmet_packages))
raise osv.except_osv('Unmet dependency !', 'Following modules are uninstalled or unknown. \n\n'+'\n'.join(unmet_packages))
mod_obj.download(cr, uid, ids, context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
@@ -0,0 +1,22 @@
<?xml version = '1.0' encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template name="first_page_graphics_corporation">
<!--logo-->
<fill color="black"/>
<stroke color="black"/>
<setFont name="DejaVu Sans" size="8"/>
<drawString x="1.3cm" y="19.5cm"><xsl:value-of select="//header-date"/></drawString>
<setFont name="DejaVu Sans Bold" size="10"/>
<drawString x="13.8cm" y="19.5cm"><xsl:value-of select="//company"/></drawString>
<setFont name="DejaVu Sans" size="8"/>
<drawRightString x="28.4cm" y="19.5cm"><pageNumber/> / </drawRightString>
<stroke color="#000000"/>
<lines size="8">1.3cm 19.3cm 28.5cm 19.3cm</lines>
</xsl:template>
<xsl:template name="first_page_frames">
<frame id="col1" x1="2.0cm" y1="2.5cm" width="24.7cm" height="16cm"/>
</xsl:template>
</xsl:stylesheet>
+2 -2
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:import href="../../base/report/custom_default.xsl"/>
<xsl:import href="../../base/report/custom_rml.xsl"/>
<xsl:import href="../../base/report/custom_default_printscreen.xsl"/>
<xsl:import href="../../base/report/custom_rml_printscreen.xsl"/>
<xsl:template match="/">
<xsl:call-template name="rml">
<xsl:with-param name="pageSize" select="report/config/PageSize"/>
@@ -0,0 +1,29 @@
<?xml version = '1.0' encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template name="first_page_graphics_report"/>
<xsl:template name="rml">
<document filename="example.pdf">
<template pageSize="29.7cm,21cm" leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm" bottomMargin="2.0cm" title="Report" author="Generated by Open ERP, Fabien Pinckaers" allowSplitting="20">
<pageTemplate id="first_page">
<pageGraphics>
<xsl:call-template name="first_page_graphics_corporation"/>
</pageGraphics>
<xsl:call-template name="first_page_frames"/>
</pageTemplate>
</template>
<stylesheet>
<xsl:call-template name="stylesheet"/>
</stylesheet>
<story>
<xsl:call-template name="story"/>
</story>
</document>
</xsl:template>
</xsl:stylesheet>
+4 -4
View File
@@ -212,8 +212,8 @@ class res_company(osv.osv):
<setFont name="DejaVu Sans Bold" size="10"/>
<drawString x="490" y="725">[[ company.partner_id.name ]]</drawString>
<setFont name="DejaVu Sans" size="8"/>
<drawRightString x="1065" y="725"><pageNumber/>/ </drawRightString>
<drawString x="1065" y="725"><pageCount/></drawString>
<drawRightString x="1073" y="725"><pageNumber/>/</drawRightString>
<drawString x="1073" y="725"><pageCount/></drawString>
<stroke color="#000000"/>
<lines>25 720 1085 720</lines>
</pageGraphics>
@@ -232,8 +232,8 @@ class res_company(osv.osv):
<setFont name="DejaVu Sans Bold" size="10"/>
<drawString x="9.8cm" y="28.3cm">[[ company.partner_id.name ]]</drawString>
<setFont name="DejaVu Sans" size="8"/>
<drawRightString x="19.7cm" y="28.3cm"><pageNumber/> / </drawRightString>
<drawString x="19.8cm" y="28.3cm"><pageCount/></drawString>
<drawRightString x="19.7cm" y="28.3cm"><pageNumber/>/</drawRightString>
<drawString x="19.7cm" y="28.3cm"><pageCount/></drawString>
<stroke color="#000000"/>
<lines>1.3cm 28.1cm 20cm 28.1cm</lines>
</pageGraphics>
+2 -2
View File
@@ -240,7 +240,7 @@ class users(osv.osv):
" aren't configured, it won't be possible to email new "
"users."),
'signature': fields.text('Signature', size=64),
'address_id': fields.many2one('res.partner.address', 'Address'),
'address_id': fields.many2one('res.partner.address', 'Company Address'),
'active': fields.boolean('Active'),
'action_id': fields.many2one('ir.actions.actions', 'Home Action'),
'menu_id': fields.many2one('ir.actions.actions', 'Menu Action'),
@@ -264,7 +264,7 @@ class users(osv.osv):
selection=[('simple','Simplified'),('extended','Extended')],
string='Interface', help="Choose between the simplified interface and the extended one"),
'user_email': fields.function(_email_get, method=True, fnct_inv=_email_set, string='Email', type="char", size=240),
'menu_tips': fields.boolean('Menu Tips', help="Check out this box if you want to display tips on each menu action"),
'menu_tips': fields.boolean('Menu Tips', help="Check out this box if you want to always display tips on each menu action"),
}
+1 -2
View File
@@ -548,11 +548,10 @@ class orm_template(object):
else:
return False
lines = []
data = map(lambda x: '', range(len(fields)))
done = []
for fpos in range(len(fields)):
done = []
f = fields[fpos]
if f:
r = row
+7
View File
@@ -30,12 +30,14 @@ import locale
import time, os
from operator import itemgetter
from datetime import datetime
from report import report_sxw
class report_printscreen_list(report_int):
def __init__(self, name):
report_int.__init__(self, name)
self.context = {}
self.groupby = []
self.cr=''
def _parse_node(self, root_node):
result = []
@@ -60,6 +62,7 @@ class report_printscreen_list(report_int):
def create(self, cr, uid, ids, datas, context=None):
if not context:
context={}
self.cr=cr
self.context = context
self.groupby = context.get('group_by',[])
self.groupby_no_leaf = context.get('group_by_no_leaf',False)
@@ -129,6 +132,10 @@ class report_printscreen_list(report_int):
_append_node('PageHeight', '%.2f' %(pageSize[1] * 2.8346,))
_append_node('report-header', title)
_append_node('company', pooler.get_pool(self.cr.dbname).get('res.users').browse(self.cr,uid,uid).company_id.name)
rpt_obj = pooler.get_pool(self.cr.dbname).get('res.users')
rml_obj=report_sxw.rml_parse(self.cr, uid, rpt_obj._name,context)
_append_node('header-date', str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")))
l = []
t = 0
rowcount = 0;
+6 -2
View File
@@ -42,11 +42,15 @@ class PageCount(platypus.Flowable):
def draw(self):
self.canv.beginForm("pageCount")
self.canv.setFont("Helvetica", utils.unit_get(str(8)))
self.canv.drawString(0, 0, str(self.canv.getPageNumber()))
if '_pageCount' in dir(self.canv):
self.canv.drawString(0, 0, str(self.canv._pageCount))
else:
self.canv.drawString(0, 0, str(self.canv.getPageNumber()))
self.canv.endForm()
class PageReset(platypus.Flowable):
def draw(self):
self.canv._pageCount = self.canv.getPageNumber()
self.canv._pageNumber = 0
class _rml_styles(object,):
@@ -261,7 +265,7 @@ class _rml_canvas(object):
if n.tag == 'pageNumber':
rc += str(self.canvas.getPageNumber())
rc += utils._process_text(self, n.tail)
return rc
return rc.replace('\n','')
def _drawString(self, node):
v = utils.attr_get(node, ['x','y'])