本文整理汇总了Python中report.report_sxw.report_sxw函数的典型用法代码示例。如果您正苦于以下问题:Python report_sxw函数的具体用法?Python report_sxw怎么用?Python report_sxw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了report_sxw函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
开发者ID:3dfxmadscientist,项目名称:odoo-extra-1,代码行数:15,代码来源:dm_ir_action_report.py
示例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']))
开发者ID:goldenboy,项目名称:razvoj,代码行数:20,代码来源:ir_actions.py
示例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)
开发者ID:ubs121,项目名称:openerp-school,代码行数:31,代码来源:report_db_5.py
示例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:
开发者ID:hectord,项目名称:unifield,代码行数:30,代码来源:account_balance.py
示例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:
开发者ID:sgeerish,项目名称:sirr_production,代码行数:30,代码来源:account_bsc_invoice.py
示例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:
开发者ID:CloudWareChile,项目名称:OpenChile,代码行数:29,代码来源:compute_resultant_report.py
示例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:
开发者ID:PramodhKG,项目名称:sampleErp,代码行数:31,代码来源:consumption_summary.py
示例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:
开发者ID:browseinfo,项目名称:7.0-opeida,代码行数:30,代码来源:inactive_partner_report.py
示例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:
开发者ID:MarkNorgate,项目名称:addons-EAD,代码行数:29,代码来源:pos_receipt.py
示例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,
)
开发者ID:Yajo,项目名称:c2c-rd-addons,代码行数:18,代码来源:report_webkit_html.py
示例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:
开发者ID:MarkNorgate,项目名称:addons-EAD,代码行数:29,代码来源:mrp_code_barcode.py
示例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:
开发者ID:browseinfo,项目名称:Teknopet_server_v7,代码行数:29,代码来源:focus_design.py
示例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)
开发者ID:hectord,项目名称:unifield,代码行数:30,代码来源:monthly_budget.py
示例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
开发者ID:rjpathan,项目名称:openerp-eran,代码行数:30,代码来源:pos_reports.py
示例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:
开发者ID:MarkNorgate,项目名称:addons-EAD,代码行数:29,代码来源:special_message_invoice.py
示例16: caracteristiques
pool = pooler.get_pool(self.cr.dbname)
sale_order_obj = pool.get('sale.order')
oid = sale_order_obj.search(self.cr, self.uid, [('name','=',order.origin)])[0]
saleorder = sale_order_obj.browse(self.cr, self.uid, oid)
return saleorder
def caracteristiques(self, order):
pool = pooler.get_pool(self.cr.dbname)
sale_order_obj = pool.get('sale.order')
oid = sale_order_obj.search(self.cr, self.uid, [('name','=',order.origin)])[0]
saleorder = sale_order_obj.browse(self.cr, self.uid, oid)
order_lines = saleorder.order_line
line = order_lines[0]
voiture = line.product_id
cars = []
for car in voiture.caracteristiques_ids:
if car.visible :
cars.append(car)
return cars
def format_quantity(self, qty):
return "0"+ str(int(qty))
def amount_in_word(self, amount):
return amount_to_text(amount, 'fr', 'DH')
report_sxw.report_sxw('report.invoice.ordervehicule', 'account.invoice', 'addons/account_invoice_layout/report/invoice_ordervehicule.rml', parser=invoicevehicule, header="external")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
开发者ID:khalidrahmani,项目名称:mrp_repair_dependencies,代码行数:29,代码来源:invoice_ordervehicule.py
示例17: _total_credit
debit = 0
credit = 0
balance = 0
for line in self.result_acc:
debit += line["type"] <> "view" and line["debit"] or 0
credit += line["type"] <> "view" and line["credit"] or 0
balance += line["type"] <> "view" and line["balance"] or 0
self.total_debit = debit
self.total_credit = credit
self.total_balance = balance
def _total_credit(self):
return self.total_credit
def _total_debit(self):
return self.total_debit
def _total_balance(self):
return self.total_balance
report_sxw.report_sxw(
"report.account.account.balance1",
"account.account",
"addons/retention/report/account_balance.rml",
parser=account_balance,
header="internal",
)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
开发者ID:kailIII,项目名称:odoo-ecuador,代码行数:30,代码来源:account_balance.py
示例18: get_payslip_data
payslips, total_net = self.get_payslip_data(cr, uid, context=context)
self.localcontext.update({
'payslips': payslips,
'total_net': total_net,
})
def get_payslip_data(self, cr, uid, context=None):
retval = {}
payslip_ids = []
slip_run_ids = context.get('active_ids')
slip_runs = self.pool.get('hr.payslip.run').browse(cr, uid, slip_run_ids, context=context)
payslip_obj = self.pool.get('hr.payslip')
for run in slip_runs:
payslip_ids.extend([x.id for x in run.slip_ids])
payslips = payslip_obj.browse(cr, uid, payslip_ids, context=context)
net_total = 0
for payslip in payslips:
lines = payslip_obj.get_visible_lines(cr, uid, payslip.id, context=context)
net_salary = sum(x.total for x in lines if x.sequence in [5000])
net_total += net_salary
retval[payslip] = {
'net_salary': net_salary,
}
return (retval, net_total)
report_sxw.report_sxw('report.webkit.bank_information_report_pdf',
'hr.payslip',
'lct_hr/report/payslip_report.html.mako',
parser=bank_information_report_pdf)
开发者ID:3dfxsoftware,项目名称:cbss-addons,代码行数:30,代码来源:bank_information_report.py
示例19: journal_print_i
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from report import report_sxw
from account.report.account_central_journal import journal_print
#
# Use period and Journal for selection or resources
#
class journal_print_i(journal_print):
def set_context(self, objects, data, ids, report_type=None):
obj_move = self.pool.get('account.move.line')
new_ids = ids
self.query_get_clause = ''
self.target_move = data['form'].get('target_move', 'all')
if (data['model'] == 'ir.ui.menu'):
new_ids = 'active_ids' in data['form'] and data['form']['active_ids'] or []
self.query_get_clause = 'AND '
self.query_get_clause += obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {}))
objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids)
if new_ids:
self.cr.execute('SELECT period_id, journal_id FROM account_journal_period WHERE id IN %s', (tuple(new_ids),))
res = self.cr.fetchall()
self.period_ids, self.journal_ids = zip(*res)
return super(journal_print_i, self).set_context(objects, data, ids, report_type=report_type)
report_sxw.report_sxw('report.account.central.journal.optim', 'account.journal.period', 'addons/ad_account_optimization/report/account_central_journal.rml', parser=journal_print_i, header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
开发者ID:Mohammadrezafah,项目名称:ERP-Supra,代码行数:31,代码来源:account_central_journal.py
示例20: report_resume
###############################################################################
import time
from report import report_sxw
class report_resume(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(report_resume, self).__init__(cr, uid, name, context)
self.localcontext.update({
'time': time,
'get_experience_by_category': self.get_experience_by_category,
})
def get_experience_by_category(self, employee_id, category):
self.cr.execute("SELECT exp.name, exp.start_date, exp.expire, exp.end_date, exp.location, exp.certification, \
exp.description, exp.diploma, exp.study_field, part.name partner_name FROM hr_experience exp \
LEFT JOIN res_partner part ON part.id = exp.partner_id \
WHERE exp.employee_id = %d AND exp.category = '%s'"%(employee_id, category))
return self.cr.dictfetchall()
report_sxw.report_sxw(
'report.hr.resume.report',
'hr.employee',
'addons/hr_resume/report/report_resume.rml',
parser=report_resume,
header=False
)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
开发者ID:alanljj,项目名称:odoo-hr,代码行数:30,代码来源:report_resume.py
注:本文中的report.report_sxw.report_sxw函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论