本文整理汇总了Python中report.report_sxw.report_sxw函数的典型用法代码示例。如果您正苦于以下问题:Python report_sxw函数的具体用法?Python report_sxw怎么用?Python report_sxw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了report_sxw函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register_all
def register_all(self, cr):
opj = os.path.join
result=''
cr.execute("SELECT * FROM ir_act_report_xml WHERE model=%s \
ORDER BY id", ('dm.offer.document',))
result = cr.dictfetchall()
for r in result:
if netsvc.service_exist('report.'+r['report_name']):
continue
if r['report_rml'] or r['report_rml_content_data']:
report_sxw('report.'+r['report_name'], r['model'],
opj('addons',r['report_rml'] or '/'), header=r['header'],
parser=offer_document)
super(report_xml, self).register_all(cr)
示例2: register_all
def register_all(self, cr):
"""Report registration handler that may be overridden by subclasses to
add their own kinds of report services.
Loads all reports with no manual loaders (auto==True) and
registers the appropriate services to implement them.
"""
opj = os.path.join
cr.execute("SELECT * FROM ir_act_report_xml WHERE auto=%s ORDER BY id", (True,))
result = cr.dictfetchall()
svcs = netsvc.Service._services
for r in result:
if svcs.has_key('report.'+r['report_name']):
continue
if r['report_rml'] or r['report_rml_content_data']:
report_sxw('report.'+r['report_name'], r['model'],
opj('addons',r['report_rml'] or '/'), header=r['header'])
if r['report_xsl']:
report_rml('report.'+r['report_name'], r['model'],
opj('addons',r['report_xml']),
r['report_xsl'] and opj('addons',r['report_xsl']))
示例3: last_lines
'time_thr_f':time_thr_f or '',
'dekan':dekan or '',
'dekan_f':dekan_f or '',
'dep_mngr':dep_mngr or '',
'dep_mngr_f':dep_mngr_f or '',
})
result.append({
'name1':name1,
'name2':name2,
'lines':lines
})
# for val in result:
# print "result : ",val['name1']
return result
def last_lines(self, form):
self.cnt += 1
res = [{'code':'retired','name':'Тэтгэврээ тогтоолгоод ажиллаж байгаа','cnt':self.cnt},
{'code':'badge','name':'Төрийн одонтой','cnt':self.cnt+1},
{'code':'terguunii','name':'Боловсролын тэргүүний ажилтан','cnt':self.cnt+2},
{'code':'dotoodod','name':'Өнгөрсөн хичээлийн жилд дотоодод мэргэжил дээшлүүлсэн','cnt':self.cnt+3},
{'code':'gadaadad','name':'Өнгөрсөн хичээлийн жилд гадаадад мэргэжил дээшлүүлсэн','cnt':self.cnt+4},
{'code':'dot_sanaltai','name':'Төвлөрсөн, бүсчилсэн шугамаар дотоодод мэргэжил дээшлүүлэх саналтай','cnt':self.cnt+5},
{'code':'gad_sanaltai','name':'Төвлөрсөн, бүсчилсэн шугамаар гадаадад мэргэжил дээшлүүлэх саналтай','cnt':self.cnt+6}]
return res
report_sxw.report_sxw(
'report.db_5',
'hr.employee',
'addons/school/report/report_db_5.rml',
parser=report_db_5,
header=False)
示例4: _process_child
if not done:
done={}
ctx = self.context.copy()
ctx['fiscalyear'] = form['fiscalyear_id']
if form['filter'] == 'filter_period':
ctx['period_from'] = form['period_from']
ctx['period_to'] = form['period_to']
elif form['filter'] == 'filter_date':
ctx['date_from'] = form['date_from']
ctx['date_to'] = form['date_to']
ctx['state'] = form['target_move']
parents = ids
child_ids = obj_account._get_children_and_consol(self.cr, self.uid,
ids, context=ctx)
if child_ids:
ids = child_ids
accounts = obj_account.read(self.cr, self.uid, ids, ['type','code','name','debit','credit','balance','parent_id','level','child_id'], ctx)
for parent in parents:
if parent in done:
continue
done[parent] = 1
_process_child(accounts,form['display_account'],parent)
return self.result_acc
report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header="internal")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例5: account_invoice
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from report import report_sxw
class account_invoice(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(account_invoice, self).__init__(cr, uid, name, context=context)
self.localcontext.update({"time": time, "convert": self.convert})
def convert(self, amount, cur):
amt_en = amount_to_text_en.amount_to_text(amount, "en", cur)
return amt_en
report_sxw.report_sxw(
"report.account.bsc.invoice",
"account.bsc.invoice",
"addons/account/report/account_bsc_invoice.rml",
parser=account_invoice,
)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例6: or
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import base_report
from report import report_sxw
class cdr(base_report.base_report):
def __init__(self, cr, uid, name, context):
super(cdr, self).__init__(cr, uid, name, context)
report_sxw.report_sxw('report.l10n.fr.compute_resultant', 'account.move.line','addons/l10n_fr/report/compute_resultant_report.rml', parser=cdr, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例7: _
return _('Date')
return _('No Filter')
def _get_start_date(self, data):
if data.get('form', False) and data['form'].get('date_from', False):
return data['form']['date_from']
return ''
def _get_end_date(self, data):
if data.get('form', False) and data['form'].get('date_to', False):
return data['form']['date_to']
return ''
report_sxw.report_sxw('report.consumption.summary', 'stock.picking',
'addons/kg_store_reports/report/consumption_summary.rml',
parser=consumption_summary, header = False)
# GRN NO and Supplier should be blank if a picking have more than one line
"""
new_data=[]
count = 0
for pos1, item1 in enumerate(data):
delete_items = []
match_found = False
for pos2, item2 in enumerate(data):
if not pos1 == pos2:
if item1['grn_number'] == item2['grn_number'] and item1['part_name'] == item2['part_name']:
match_found = True
if count == 0:
示例8: count
self.cr.execute('select count(crm_lead.id) from crm_lead where crm_lead.partner_name = %s',([line.name]))
lead = self.cr.fetchall()[0][0] or 0
self.cr.execute('select count(sale_order.id) from sale_order where sale_order.partner_id = %s',([line.id]))
sale = self.cr.fetchall()[0][0] or 0
self.cr.execute('select sum(amount_untaxed) from sale_order where sale_order.partner_id = %s',([line.id]))
total_sale = self.cr.fetchall()[0][0] or 0
res.append({
'name': line.name or '',
'phone': line.phone or '',
'mobile': line.mobile,
'email': line.email,
'fax': line.fax or '',
'lead': lead,
'sale': sale,
'total': total_sale,
})
return res
report_sxw.report_sxw(
'report.inactive.partner.report',
'res.partner',
'addons/inactive_partner_report/report/order_line_expiry.rml',
parser=inactive_partner_report,
header='external'
)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例9: formatdate
'disc': self.discount,
'net': self.netamount,
'formatdate': self.formatdate,
'address': partner.address and partner.address[0] or False,
})
def formatdate(self, datestr):
dateobj = ParseAny(datestr)
return dateobj.strftime(self.localcontext['dformat'])
def netamount(self, order_line_id):
sql = 'select (qty*price_unit) as net_price from pos_order_line where id = %s'
self.cr.execute(sql, (order_line_id,))
res = self.cr.fetchone()
return res[0]
def discount(self, order_id):
sql = 'select discount, price_unit, qty from pos_order_line where order_id = %s '
self.cr.execute(sql, (order_id,))
res = self.cr.fetchall()
dsum = 0
for line in res:
if line[0] != 0:
dsum = dsum +(line[2] * (line[0]*line[1]/100))
return dsum
report_sxw.report_sxw('report.pos.receipt', 'pos.order', 'addons/point_of_sale/report/pos_receipt.rml', parser=order, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例10: report_webkit_html
import time
import locale
from report import report_sxw
from osv import osv
class report_webkit_html(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(report_webkit_html, self).__init__(cr, uid, name, context=context)
self.localcontext.update({"time": time, "cr": cr, "uid": uid, "locale": locale})
report_sxw.report_sxw(
"report.product.computed.report",
"product.product",
"addons/c2c_stock_accounting/report/product_computed_report.mako",
parser=report_webkit_html,
)
示例11: code_barcode
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import pooler
import time
from report import report_sxw
class code_barcode(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(code_barcode, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
})
report_sxw.report_sxw('report.mrp.code.barcode', 'mrp_operations.operation.code', 'addons/mrp_operations/report/mrp_code_barcode.rml',parser=code_barcode,header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例12: sorted
'disable': line.disable,
'prod_image': line.prod_image,
'name': line.name or '',
'categ_id': line.product_id.categ_id.name,
'product_id': line.product_id.name,
'product_uom_qty':line.product_uom_qty or 0,
'price_unit': line.price_unit,
'description': line.name,
'note': line.note or '',
'totals': self.totals,
})
self.totals += (line.product_uom_qty)
self.subtotals += (line.product_uom_qty)
self.subtotal_price += (line.price_unit)
newlist = sorted(res, key=lambda k: k['name'])
groups = itertools.groupby(newlist, key=operator.itemgetter('categ_id'))
result = [{'categ_id':k,'values':[x for x in v]} for k,v in groups]
return result
def _get_static_data(self, obj):
product_obj = self.pool.get('product.product')
product_id = product_obj.search(self.cr, self.uid ,[('name','=','quote template image')])
img_browse = product_obj.browse(self.cr, self.uid, product_id[0]).image
return img_browse
report_sxw.report_sxw('report.sale.order.image', 'sale.order', 'sales_focus_design/report/focus_design.rml', parser=focus_design, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例13: monthly_budget
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from report import report_sxw
from spreadsheet_xml.spreadsheet_xml_write import SpreadsheetReport
class monthly_budget(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context=None):
super(monthly_budget, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
})
return
report_sxw.report_sxw('report.msf.pdf.budget.monthly', 'msf.budget', 'addons/msf_budget/report/monthly_budget.rml', parser=monthly_budget, header=False)
class monthly_budget2(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context=None):
super(monthly_budget2, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
})
return
SpreadsheetReport('report.xls.budget.monthly','msf.budget','addons/msf_budget/report/monthly_budget.mako', parser=monthly_budget2)
示例14: pos_monthly_report_kt
val['net']=deposit
val['tax']=0.0
val['gross']=val['net']+val['tax']
res['amt'].append(val)
val={}
val['name']='Entnahmen'
val['no']=d
val['net']=withdraw
val['tax']=0.0
val['gross']=val['net']+val['tax']
res['amt'].append(val)
res['should_in_pos']=sess_obj.cash_register_balance_end
res['actual_in_pos']=sess_obj.cash_register_balance_end_real
lst.append(res)
return lst
report_sxw.report_sxw('report.pos_daily_report', 'daily.pos.wizard', 'addons/dantunes_pos/report/pos_daily_report.rml', parser=pos_daily_report_kt, header=False)
class pos_monthly_report_kt(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context=None):
super(pos_monthly_report_kt, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'get_address':self.get_address,
'get_session_details':self.get_session_details,
'get_totals':self.get_totals
})
cash_total=0.0
card_total=0.0
deposit_total=0.0
withdraw_total=0.0
示例15:
res['currency']=''
elif entry.state=='text':
res['name']=entry.name
res['price_subtotal']=''
res['currency']=''
elif entry.state=='line':
res['quantity']='_______________'
res['price_unit']='______________'
res['discount']='____________'
res['tax_types']='____________________'
res['uos']='_____'
res['name']='_______________________________________________'
res['price_subtotal']='____________'
res['currency']='____'
elif entry.state=='break':
res['type']=entry.state
res['name']=entry.name
res['price_subtotal']=''
res['currency']=''
else:
res['name']=entry.name
res['price_subtotal']=''
res['currency']=invoice.currency_id.code
result.append(res)
return result
report_sxw.report_sxw('report.notify_account.invoice', 'account.invoice', 'addons/account_invoice_layout/report/special_message_invoice.rml', parser=account_invoice_with_message)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: