def _lookup_report(self, name): """ Look up a report definition. """ join = os.path.join # First lookup in the deprecated place, because if the report definition # has not been updated, it is more likely the correct definition is there. # Only reports with custom parser sepcified in Python are still there. if 'report.' + name in odoo.report.interface.report_int._reports: return odoo.report.interface.report_int._reports['report.' + name] self._cr.execute("SELECT * FROM ir_act_report_xml WHERE report_name=%s", (name,)) row = self._cr.dictfetchone() if not row: raise Exception("Required report does not exist: %s" % name) if row['report_type'] in ('qweb-pdf', 'qweb-html'): return row['report_name'] elif row['report_rml'] or row['report_rml_content_data']: kwargs = {} if row['parser']: kwargs['parser'] = getattr(odoo.addons, row['parser']) return report_sxw('report.'+row['report_name'], row['model'], join('addons', row['report_rml'] or '/'), header=row['header'], register=False, **kwargs) elif row['report_xsl'] and row['report_xml']: return report_rml('report.'+row['report_name'], row['model'], join('addons', row['report_xml']), row['report_xsl'] and join('addons', row['report_xsl']), register=False) else: raise Exception("Unhandled report type: %s" % row)
def convert(self, amount, cur): return amount_to_text_en.amount_to_text(amount, 'en', cur); def get_bysal_total(self): return self.total_bysal def get_detail(self, line_ids): result = [] i = 1 self.total_bysal = 0.00 for l in line_ids: res = {} res.update({ 'serial': i, 'postname': l.slip_id.post_id.name, 'name': l.slip_id.employee_id.name, 'acc_no': l.slip_id.bankacc, 'ifsc_code': l.ifsc_code, 'bysal': l.bysal, 'debit_credit': l.debit_credit, }) i = i + 1 self.total_bysal += l.bysal result.append(res) return result report_sxw.report_sxw('report.guards.payroll.advice', 'guards.payroll.advice', 'sos/report/report_payroll_advice.rml', parser=guards_payroll_advice_report, header="external") # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
self.localcontext['company'] = company self.rml_header = company.rml_header self.rml_header2 = company.rml_header2 self.localcontext['logo'] = company.logo self.logo = company.logo # get client's company address def set_address(self, order): partner = order.partner_id self.localcontext[ 'addr'] = partner.child_ids and partner.child_ids[0] or partner report_sxw.report_sxw('report.of_gesdoc.courriers_sale', 'sale.order', "addons/of_gesdoc/report/courrier_sale.rml", parser=CourrierSale, header=True) report_sxw.report_sxw('report.of_gesdoc.courriers_sale_se', 'sale.order', "addons/of_gesdoc/report/courrier_sale_se.rml", parser=CourrierSale, header=True) report_sxw.report_sxw('report.of_gesdoc.courriers_sale_sehead', 'sale.order', "addons/of_gesdoc/report/courrier_sale_sehead.rml", parser=CourrierSale, header=False) report_sxw.report_sxw('report.of_gesdoc.courriers_sale_se_sehead', 'sale.order', "addons/of_gesdoc/report/courrier_sale_se.rml",
return customer_comment #customer_comment def partner_name(self,o): name = '' name = o.partner_id.name if o.partner_id.last_name: name += ' ' + o.partner_id.last_name return name def partner_add(self,o): addres_li=[];complete_address='' street=o.partner_id.street; street2=o.partner_id.street2; state=o.partner_id.state_id.code ; zip=o.partner_id.zip;\ city=o.partner_id.city country=o.partner_id.country_id.name if street:addres_li.append(street) if street2:addres_li.append(street2) if city: addres_li.append(city) if state:addres_li.append(state) if zip:addres_li.append(zip) # if country:addres_li.append(country) add = (str(street) if street else '') +(', ' if street else '') + '\n' + (str(street2) if street2 else '')+(', ' if street2 else '') + '\n' +(str(city) if city else '' )+(', ' if city else '')+ (str(state) if state else '')+ ', ' +(str(zip) if zip else '') # complete_address=', '.join(addres_li) # address=textwrap.fill(complete_address,width=80) return add #report_sxw.report_sxw( 'report.account.invoice.custom', 'account.invoice', # 'custom_addons/bista_iugroup/report/account_print_custom_invoice.rml', parser=account_invoice ) report_sxw.report_sxw( 'report.account.invoice.custom.asit', 'account.invoice', 'custom_addons/bista_iugroup/report/account_print_asit_invoice.rml', parser=account_invoice ) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
total_product_weight = line.quantity * product_weight final_weight += total_product_weight return final_weight def get_line_item_notes(self, line): desc, sale_order_line = '', self.env['sale.order.line'] if line.saleline_invoice_id: sale_order_line_brw = sale_order_line.browse( self.cr, self.uid, line.saleline_invoice_id) for line_item_note in sale_order_line_brw.line_item_note_ids: if line_item_note.invoice_note == True: desc += line_item_note.line_item_note return desc def get_order_level_notes(self, invoice): desc = '' if invoice.sale_invoice_id.id: if invoice.sale_invoice_id.order_level_notes_ids: for order_level_note in invoice.sale_invoice_id.order_level_notes_ids: if order_level_note.order_invoice_note == True: desc += order_level_note.order_item_note return desc report_sxw.report_sxw( 'report.sale.invoice.customer', 'account.invoice', 'custom_addons/bista_check/report/account_invoice_report.rml', parser=sale_invoice_report, header=False)
else: int_date_hour = datetime.time(date_datetime_local).hour int_date_min = datetime.time(date_datetime_local).minute return "%02d:%02d" % (int_date_hour, int_date_min) def get_client(self, line): if not line.address_id: return "" address = line.address_id city_vals = [s for s in (address.zip, address.city) if s] partner_vals = [ s for s in ( address.name, address.street, address.street2, " ".join(city_vals), address.phone, address.mobile, address.fax, ) if s ] return "\n".join(partner_vals) report_sxw.report_sxw('report.of_planning.of_planning_jour', 'of.planning.report', 'addons/of_planning/report/of_planning_jour.rml', parser=OfPlanningJour, header=False)
xml = xml + "<amount_spacer>" + str( dimension.amount_h) + "mm</amount_spacer>" dot = "." for s in range(dimension.amount_w): dot = dot + "." xml = xml + "<amount_dot>" + dot + "</amount_dot><amount>" + voucher.amount_in_word + "</amount>" #Number xml = xml + "<number_spacer>" + str( dimension.number_h) + "mm</number_spacer>" dot = "." for s in range(dimension.number_w): dot = dot + "." xml = xml + "<number_dot>" + dot + "</number_dot><number>" + str( voucher.amount) + "</number>" xml = xml + "<font_size>" + str( dimension.font_size) + "</font_size></page></report>" print xml return xml report_sxw.report_sxw( 'report.account.print.check', 'account.payment', 'addons/account_check_printing_custom/report/account_configure_check_report.xsl', parser=report_check_custom, header=True) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
result[0]['title'] = pad.title and pad.title.shortcut or False else: result[0]['title'] = False else: result[0]['title'] = False result[0]['name'] = '' result[0]['street'] = '' result[0]['street2'] = '' result[0]['zip'] = '' result[0]['city'] = '' return [result[0]] report_sxw.report_sxw('report.of_gesdoc.courriers_crm', 'crm.lead', "addons/of_gesdoc/report/CourrierCrm.rml", parser=CourrierCrm, header=True) report_sxw.report_sxw('report.of_gesdoc.courriers_crm_se', 'crm.lead', "addons/of_gesdoc/report/CourrierCrm_se.rml", parser=CourrierCrm, header=True) report_sxw.report_sxw('report.of_gesdoc.courriers_crm_sehead', 'crm.lead', "addons/of_gesdoc/report/CourrierCrm.rml", parser=CourrierCrm, header=False) report_sxw.report_sxw('report.of_gesdoc.courriers_crm_se_sehead', 'crm.lead', "addons/of_gesdoc/report/CourrierCrm_se.rml",
try: requested_by = 'Requested by: ' + model_id.event_id.ordering_partner_id.name except Exception as e: requested_by = 'Requested by: ' try: #import ipdb;ipdb.set_trace() if model_id.comment: notes = 'Notes: ' + model_id.comment else: notes = 'Notes: ' except Exception as e: notes = 'Notes: ' res.extend([date_invoice,interpreter,medical_file_no,birthdate,language,date_of_service,service,\ location,requested_by]) return res report_sxw.report_sxw( 'report.account.invoice.translator', 'account.invoice', 'custom_addons/bista_iugroup/report/translator_invoice.rml', parser=account_invoice) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
else: ret_data['date'] = datetime.strptime( data.date, '%Y-%m-%d').strftime('%A %d/%m/%y') ret_data['file_number'] = '' ret_data['client'] = '' ret_data['description'] = data.name ret_data['from_time'] = str(int( data.from_time)) + ':' + str( int(math.floor((data.from_time % 1) * 60))) ret_data['to_time'] = str(int( data.to_time)) + ':' + str( int(math.floor((data.to_time % 1) * 60))) ret_data['hours'] = str(int( data.unit_amount)) + ':' + str( int(math.floor((data.unit_amount % 1) * 60))) ret_datas.append(ret_data) return ret_datas except NameError: raise orm.except_orm(_(''), _('No Data To Generate Report')) def format_date(self, hours): return datetime.strptime(str(hours), '%H.%S').strftime('%H:%S') report_sxw.report_sxw( 'report.week.timesheet', 'hr_timesheet_sheet.sheet', 'custom_addons/india_law/legal_e/report/week_timesheet_view.rml', parser=WeekTimesheetReport, header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@api.multi def format_date(self, date, format): return datetime.strptime(date, '%Y-%m-%d').strftime(format) @api.multi def check_proceedings(self, case_id): search_ids = self.env['court.proceedings'].search([('case_id', '=', case_id)]) if len(search_ids): return True return False @api.multi def get_data_proceedings(self, case_id): search_ids = self.env['court.proceedings'].search([('case_id', '=', case_id)]) return search_ids @api.multi def get_prepared_by(self, data): return self.env['res.users'].read(['name'])['name'] return '' report_sxw.report_sxw( 'report.client.case.history', 'case.sheet', 'custom_addons/india_law/legal_e/report/client_case_history_view.rml', parser=ClientCaseHistoryAll, header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# 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 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 odoo.report import report_sxw class workcenter_code(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(workcenter_code, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) report_sxw.report_sxw('report.mrp.wc.barcode', 'mrp.workcenter', 'addons/mrp_operations/report/mrp_wc_barcode.rml', parser=workcenter_code, header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.report import report_sxw class rmlparser(report_sxw.rml_parse): def set_context(self, objects, data, ids, report_type = None): super(rmlparser,self).set_context(objects, data, ids, report_type) self.setCompany(objects[0]) report_sxw.report_sxw('report.preview.report', 'res.company', 'addons/base/report/preview_report.rml', parser=rmlparser, header='external')
if event_id.actual_event_start: if event_id.actual_event_start == 'False': pass #return True else: return event_id.actual_event_start else: pass def time_end(self, event_id): if event_id.actual_event_end: if event_id.actual_event_start == 'False': pass #return True else: return event_id.actual_event_end else: pass report_sxw.report_sxw( 'report.event.completion.report', 'event', 'custom_addons/bista_iugroup/report/event_completion_report.rml', parser=event_completion) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# # 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 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 odoo.report import report_sxw class frequency_table_parser(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(frequency_table_parser, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'filter_objs': self._filter_objects }) def _filter_objects(self, objects): new_objects = [] for obj in objects: if obj.lu or obj.ma or obj.mi or obj.ju or obj.vi or obj.sa or obj.do or obj.sm or obj.qc or obj.m or obj.bt or obj.tr or obj.ct or obj.st or obj.an or obj.s_n: new_objects.append(obj) return new_objects report_sxw.report_sxw('report.sale.order.freq.table','sale.order','addons/limp_sale/report/limp_sale_frequency_table.rml',parser=frequency_table_parser)
return "" address = line.address_id city_vals = [s for s in (address.zip, address.city) if s] partner_vals = [ s for s in ( address.name, address.street, address.street2, " ".join(city_vals), address.phone, address.mobile, address.fax, ) if s ] return "\n".join(partner_vals) def get_description(self, line): return line.description.replace('<br>', '\n').replace( '<br/>', '\n').replace('<p>', '').replace('</p>', '\n').replace( '<p/>', '\n').replace('<b>', '').replace('</b>', '').replace( '<i>', '').replace('</i>', '').replace('<u>', '').replace('</u>', '') report_sxw.report_sxw('report.of_planning.of_planning_jour', 'of_planning.impression_wizard', 'addons/of_planning/report/of_planning_jour.rml', parser=OfPlanningJour, header=False)
def get_heure(self, intervention): date_datetime_local = fields.Datetime.context_timestamp( intervention, fields.Datetime.from_string(intervention.date)) return "%02d:%02d" % (date_datetime_local.hour, date_datetime_local.minute) def get_client(self, line): if not line.address_id: return "" address = line.address_id city_vals = [s for s in (address.zip, address.city) if s] partner_vals = [ s for s in ( address.name, address.street, address.street2, " ".join(city_vals), address.phone, address.mobile, address.fax, ) if s ] return "\n".join(partner_vals) report_sxw.report_sxw('report.of_planning.of_planning_semaine', 'of.planning.report', 'addons/of_planning/report/of_planning_semaine.rml', parser=OfPlanningSemaine, header=False)
}) def get_lines(self, lines): res = [] sl_no = 0 for line in lines: sl_no = sl_no+1 data = {'sl_no':sl_no,'name':line.name,'amount':line.amount} res.append(data) for i in range(1,21): res.append({'sl_no':'','name':'','amount':''}) return res def get_amt_inwords(self, invoice, total,ttype,currency_id): if ttype == 'words': amt_in_words = amount_to_text(total,'en',currency_id.name) if currency_id.name == 'INR': amt_in_words = amt_in_words.replace('INR','Rupees').replace('Cents','Paisa').replace('Cent','Paisa') return amt_in_words else: return total def get_date(self, dt): dt = datetime.strptime(dt, "%Y-%m-%d") dt = datetime.strftime(dt, "%d-%b-%y") return dt report_sxw.report_sxw('report.consolidated.bill.llp', 'consolidated.bill', 'addons/legal_e/routine_entries/wizard/consolidated_bill_llp_report.rml', parser=consolidated_bill_llp, header=False) report_sxw.report_sxw('report.consolidated.bill.hdfc', 'consolidated.bill', 'addons/legal_e/routine_entries/wizard/consolidated_bill_hdfc_report.rml', parser=consolidated_bill_llp, header=False) report_sxw.report_sxw('report.consolidated.bill.cbi', 'consolidated.bill', 'addons/legal_e/routine_entries/wizard/consolidated_bill_cbi_report.rml', parser=consolidated_bill_llp, header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
try: requested_by = 'Requested by: ' + model_id.event_id.ordering_partner_id.name except Exception as e: requested_by = 'Requested by: ' try: #import ipdb;ipdb.set_trace() if model_id.comment: notes = 'Notes: ' + model_id.comment else: notes = 'Notes: ' except Exception as e: notes = 'Notes: ' res.extend([date_invoice,interpreter,medical_file_no,birthdate,language,date_of_service,service,\ location,requested_by]) return res report_sxw.report_sxw( 'report.account.invoice.interpreter', 'account.invoice', 'custom_addons/bista_iugroup/report/interpreter_invoice.rml', parser=account_invoice) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
class ConsolidatedBillLlpAnnexture(report_sxw.rml_parse): def __init__(self, name): super(ConsolidatedBillLlpAnnexture, self).__init__(name) self.localcontext.update({ 'time': time, 'get_date':self.get_date, 'get_stages': self.get_stages, }) @api.multi def get_date(self, dt): dt = datetime.strptime(dt, "%Y-%m-%d") dt = datetime.strftime(dt, "%d-%b-%y") return dt @api.multi def get_stages(self, lines): stages = '' for data_obj in lines.invoice_lines_fixed: stages += data_obj.name + '\n' for data_obj in lines.invoice_lines_other_expenses: stages += data_obj.name + '\n' return stages report_sxw.report_sxw('report.consolidated.bill.llp.annexure', 'consolidated.bill', 'custom_addons/india_law/legal_e/report/consolidated_bill_llp_annexture.rml', parser=ConsolidatedBillLlpAnnexture, header=False) report_sxw.report_sxw('report.consolidated.bill.hdfc.annexure', 'consolidated.bill', 'custom_addons/india_law/legal_e/report/consolidated_bill_hdfc_annexture.rml', parser=ConsolidatedBillLlpAnnexture, header=False) report_sxw.report_sxw('report.consolidated.bill.cbi.annexure', 'consolidated.bill', 'custom_addons/india_law/legal_e/report/consolidated_bill_cbi_annexture.rml', parser=ConsolidatedBillLlpAnnexture, header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# 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 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 odoo.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:
self.cr, self.uid, o_id, context=self.localcontext) for row in rows: vals = { 'partner_id': row.partner_id and row.partner_id.name or row.lead_id.name, 'user_id': row.user_id.name, 'name': row.name, } val = { 'lxr': row.partner_id and row.partner_id.name or row.lead_id.name, 'em_mp': row.user_id.name, 'em_phone': row.user_id.partner_id.phone, 'name': row.name, 'quotation_name': row.name, } records.append(val) return records report_sxw.report_sxw( 'report.sale.quotation.report.pcb.cn', 'sale.quotation', 'addons/sale_pcb_rfq/report/sale_quotation_report_cn.rml', parser=sale_quotation_report_pcb_cn, header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
[('employee_id', '=', employee_id)]) _leave_days = [] for leave in _emp_leave_obj.browse(self.cr, self.uid, _leave_ids): _start_date = datetime.strptime(leave.start_date, '%Y-%m-%d') _end_date = datetime.strptime(leave.end_date, '%Y-%m-%d') for d in rrule.rrule(rrule.DAILY, dtstart=_start_date, until=_end_date): _leave_days.append((leave.leave_type, d)) _leave_types = [x[0] for x in _leave_days] for ltype in set(_leave_types): _ltype_val = self.getSelectionValue('cicon.hr.employee.leave', 'leave_type', ltype) res.update({_ltype_val: {}}) m = 1 while m <= 12: _leave_count = len([ x for x in _leave_days if x[0] == ltype and x[1].month == m and x[1].year == report_year ]) res[_ltype_val][str(m)] = _leave_count m += 1 return res report_sxw.report_sxw( 'report.emp.leave.summary.webkit', 'hr.employee', 'cicon_addons/cicon_hr/report/emp_leave_report_summary.mako', parser=EmpLeaveReport)
# context = { # 'uom' : product.uos_id.id, # 'date': intervention.date, # } # price = self.env['product.pricelist'].price_get(self.cr, self.uid, [pricelist_id], # product.id, 1.0, part.id, context)[pricelist_id] result = '' # Code copié depuis account.invoice.line.set_tax() # taxes = product.taxes_id # company_id = intervention.company_id or self.env.user.company_id # taxes = taxes.filtered(lambda r: r.company_id == company_id) # # if price: # # taxes = pf.map_tax(taxes, self.product_id, self.invoice_id.partner_id) # taxes = taxes.compute_all(price, product=product, partner=address) # # result = taxes['total_excluded'] + taxes['taxes'] if taxes else price # # # Fonctionalite du module of_sales, mais on s'evite ici de recopier le fichier attestation_ramonage en entier # if getattr(intervention.tache_id, 'arrondi') and round(abs(round(result)-result)-.01) == 0: # result = round(result) return result report_sxw.report_sxw('report.of_planning.attestation_ramonage', 'of.planning.intervention', 'addons/of_planning/report/attestation_ramonage.rml', parser=attestation_ramonage)
def get_total_by_rule_category(self, obj, code): payslip_line = self.pool.get('hr.payslip.line') rule_cate_obj = self.pool.get('hr.salary.rule.category') cate_ids = rule_cate_obj.search(self.cr, self.uid, [('code', '=', code)]) category_total = 0 if cate_ids: line_ids = payslip_line.search(self.cr, self.uid, [('slip_id', '=', obj.id),('category_id.id', '=', cate_ids[0] )]) for line in payslip_line.browse(self.cr, self.uid, line_ids): category_total += line.total return category_total def get_employer_line(self, obj, parent_line): payslip_line = self.pool.get('hr.payslip.line') line_ids = payslip_line.search(self.cr, self.uid, [('slip_id', '=', obj.id), ('salary_rule_id.parent_rule_id.id', '=', parent_line.salary_rule_id.id )]) res = line_ids and payslip_line.browse(self.cr, self.uid, line_ids[0]) or False return res report_sxw.report_sxw('report.fiche.paye', 'hr.payslip', 'l10n_fr_hr_payroll/report/fiche_paye.rml', parser=fiche_paye_parser) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
zip = o.partner_id.zip \ city=o.partner_id.city country = o.partner_id.country_id.name print street, street2, state, zip, city if street: addres_li.append(street) if street2: addres_li.append(street2) if city: addres_li.append(city) if state: addres_li.append(state) if zip: addres_li.append(zip) # if country:addres_li.append(country) #+ '\n' add = (str(street) if street else '') + ( ', ' if street else '' ) + '\n' + (str(street2) if street2 else '') + ( ', ' if street2 else '') + '\n' + (str(city) if city else '') + ( ', ' if city else '') + (str(state) if state else '') + ', ' + (str(zip) if zip else '') complete_address = ', '.join(addres_li) address = textwrap.fill(complete_address, width=80) print "add........", add return add report_sxw.report_sxw( 'report.account.invoice.sd.header', 'account.invoice', 'custom_addons/bista_iugroup/report/account_print_sd_header.rml', parser=account_invoice) #report_sxw.report_sxw( 'report.account.invoice.sd.header', 'account.invoice', # 'custom_addons/bista_iugroup/report/account_print_custom_invoice.rml', parser=account_invoice ) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
return '' @api.multi def get_client_name(self, data): if data.has_key('form') and data['form'].has_key('client_id') and data['form']['client_id']: return self.env['res.partner'].read(data['form']['client_id'],['name'])['name'] return '' @api.multi def format_date(self, date, format): return datetime.strptime(date, '%Y-%m-%d').strftime(format) @api.multi def check_proceedings(self, case_id): search_ids = self.env['court.proceedings'].search([('case_id','=',case_id)]) if len(search_ids): return True return False @api.multi def get_data_proceedings(self, case_id): search_ids = self.env['court.proceedings'].search([('case_id','=',case_id)]) return search_ids def get_prepared_by(self,data): return self.pool.get('res.users').read(self.cr, self.uid, self.uid, ['name'])['name'] return '' report_sxw.report_sxw('report.bills.payment.details', 'account.invoice', 'custom_addons/india_law/legal_e/report/bills_payment_details_view.rml', parser=AllBillsPaymentDetails, header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
def __init__(self, cr, uid, name, context=None): super(account_invoice_hon, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'get_date': self.get_date, 'new_date': self.new_date, }) def get_date(self, date_invoice): if date_invoice in ['False' or False]: return False return datetime.strptime(date_invoice, "%Y-%m-%d").strftime('%d-%m-%Y') def new_date(self, date_due): if date_due in ['False' or False]: return False return datetime.strptime(date_due, "%Y-%m-%d").strftime('%d-%m-%Y') report_sxw.report_sxw( 'report.account.invoice.hon', 'account.invoice', 'addons/freelancer_self_billing/report/report_account_invoice_print.rml', parser=account_invoice_hon, ) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
class account_invoice(report_sxw.rml_parse): def __init__(self, cr, uid, name, context=None): super(account_invoice, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'get_date': self.get_date, 'new_date': self.new_date, }) def get_date(self, invoice_date): if not invoice_date: return False return datetime.strptime(invoice_date, "%Y-%m-%d").strftime('%d-%m-%Y') def new_date(self, period_id): if not period_id: return False return datetime.strptime(period_id.date_start, "%Y-%m-%d").strftime('%B %Y') report_sxw.report_sxw( 'report.account.invoice.custom', 'account.invoice', 'addons/magnus_account/report/report_account_invoice_print.rml', parser=account_invoice, ) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# -*- coding: utf-8 -*- # © 2015-2019 Deltatech # See README.rst file on addons root folder for license details import time from odoo.report import report_sxw class expenses_deduction_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(expenses_deduction_report, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) report_sxw.report_sxw( 'report.deltatech.expenses.deduction.print', 'deltatech.expenses.deduction', 'addons/deltatech_expenses/report/expenses_deduction_report.rml', parser=expenses_deduction_report) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
def adr_get(self, partner): pad_obj = self.pool.get('res.partner.address') c_ids = pad_obj.search(self.cr, self.uid, [('partner_id', '=', partner.id)]) result = pad_obj.read(self.cr, self.uid, c_ids[0]) if result['title']: pad = pad_obj.browse(self.cr, self.uid, c_ids[0]) result['title'] = pad.title and pad.title.shortcut or False else: result['title'] = False return [result] report_sxw.report_sxw('report.of_gesdoc.courriers', 'res.partner', "addons/of_gesdoc/report/courrier.rml", parser=Courrier, header=True) report_sxw.report_sxw('report.of_gesdoc.courriers_se', 'res.partner', "addons/of_gesdoc/report/courrier_se.rml", parser=Courrier, header=True) report_sxw.report_sxw('report.of_gesdoc.courriers_sehead', 'res.partner', "addons/of_gesdoc/report/courrier_sehead.rml", parser=Courrier, header=False) report_sxw.report_sxw('report.of_gesdoc.courriers_se_sehead', 'res.partner', "addons/of_gesdoc/report/courrier_se.rml",