_('POS Orders')) + ' ' + ', '.join(pos_nbrs)) else: if line.name and line.name.find(":") != -1: n = line.name.split(":")[0] if n: po_ids = pos_order_obj.search( self.cursor, self.uid, [('name', '=', n)]) if po_ids: ref_order = pos_order_obj.read( self.cursor, self.uid, po_ids[0], ['pos_reference'])['pos_reference'] ref_line = "%s" % ( ref_order and (_('POS') + ' ' + ref_order + (line.statement_id and ' (Pago)' or '')) or '') except: #ignore pass if not ref_line: ref_line = line.ref or '' return ref_line HeaderFooterTextWebKitParser( 'report.account.account_report_print_journal_webkit_ext', 'account.journal.period', 'addons/uy_account_report_print_journal/report/account_report_print_journal.mako', parser=PrintJournalWebkitExt)
from openerp.addons.account_financial_report_webkit.report.webkit_parser_header_fix import HeaderFooterTextWebKitParser from openerp.addons.account_financial_report_webkit.report.open_invoices import PartnersOpenInvoicesWebkit import logging _logger = logging.getLogger(__name__) class PartnersOpenInvoicesWebkit(PartnersOpenInvoicesWebkit): def set_context(self, objects, data, ids, report_type=None): """Populate a ledger_lines attribute on each browse record that will be used by mako template""" self.account_selection_ids = self._get_form_param('accounts_ids', data) return super(PartnersOpenInvoicesWebkit, self).set_context( objects, data, ids, report_type=report_type) def get_all_accounts(self, account_ids, exclude_type=None, only_type=None, filter_report_type=None, context=None): return self.account_selection_ids or super(PartnersOpenInvoicesWebkit, self).get_all_accounts(account_ids, exclude_type, only_type, filter_report_type, context) report_parser = HeaderFooterTextWebKitParser( 'report.account.account_report_open_invoices_webkit', 'account.account', 'addons/account_financial_report_webkit/report/templates/\ account_report_open_invoices.mako', parser=PartnersOpenInvoicesWebkit, register = False) report_parser._reports['report.account.account_report_open_invoices_webkit'] = report_parser
self.print_attendances = print_attendances self.print_overtime = print_overtime self.p_att.get_wizard_params(month, year) self.p_overt.get_wizard_params(month, year) self.p_holy.get_wizard_params(month, year) def get_print_holidays(self): return self.print_holidays def get_print_attendances(self): return self.print_attendances def get_print_overtime(self): return self.print_overtime def get_days(self): last_day = lengthmonth(self.year, self.month) days = [] for i in range(1, last_day + 1, 1): days.append(i) return days def get_date(self): date = datetime(self.year, self.month, 1) return date.strftime("%B %Y") HeaderFooterTextWebKitParser('report.summary', 'hr.employee', os.path.dirname(os.path.realpath(__file__)) + '/summary.mako', parser=parser_employee_report)
return self.hol_types def get_remaining_holidays(self, emp_id): # hrs=self.pool.get('hr.holidays.status') hrs = pooler.get_pool(self.cr.dbname).get('hr.holidays.status') hrs_list = hrs.search(self.cr, self.uid, []) # self.hol_types=hrss.read(self.cr,self.uid,hrs_list,['id','name']) self.hols_remaining = hrs.get_days(self.cr, self.uid, hrs_list, emp_id, 0) def _get_rem_holidays_by_type(self, hol_type): if (hol_type in self.hols_remaining): return self.hols_remaining[hol_type].values() return 0 def get_desc_holiday_by_type(self, hol_type): if (hol_type in self.hols_remaining): return self.hols_remaining[hol_type].keys() return 0 def get_date(self): date = datetime.today() return date.strftime("%d %B %Y") HeaderFooterTextWebKitParser('report.holidays', 'hr.employee', os.path.dirname(os.path.realpath(__file__)) + '/holidays_rem.mako', parser=parser_hol_remaining)
# sum(l.amount_currency) AS curr_balance if self.localcontext.get('partner_ids', False): sql += " AND l.partner_id in %(partner_ids)s" search_params['partner_ids'] = tuple(self.localcontext.get('partner_ids')) if self.localcontext.get('operating_unit_ids', False): sql += " AND l.operating_unit_id in %(operating_unit_ids)s" search_params['operating_unit_ids'] = tuple(self.localcontext.get('operating_unit_ids')) try: self.cursor.execute(sql, search_params) res = self.cursor.dictfetchone() except Exception: self.cursor.rollback() raise return {'debit': res.get('debit') or 0.0, 'credit': res.get('credit') or 0.0, 'init_balance': res.get('balance') or 0.0, 'usd_debit': res.get('usd_debit') or 0.0, 'usd_credit': res.get('usd_credit') or 0.0, 'usd_init_balance': (res.get('usd_debit') or 0.0) - (res.get('usd_credit') or 0.0), 'init_balance_currency': res.get('curr_balance') or 0.0, 'state': mode} HeaderFooterTextWebKitParser( 'report.account.account_report_general_ledger_webkit_ext', 'account.account', 'addons/uy_account_report_general_ledger/report/account_report_general_ledger.mako', parser=GeneralLedgerWebkitExt)
_('Open Invoices Report'), 'additional_args': [ ('--header-font-name', 'Helvetica'), ('--footer-font-name', 'Helvetica'), ('--header-font-size', '10'), ('--footer-font-size', '6'), ('--header-left', header_report_name), ('--header-spacing', '2'), ('--footer-left', footer_date_time), ('--footer-right', ' '.join( (_('Page'), '[page]', _('of'), '[topage]'))), ('--footer-line', ), ], }) def is_open(self, cr, uid, account_move_line): move_line_obj = self.pool.get('account.move.line').browse( cr, uid, account_move_line['id']) if move_line_obj.reconcile_id.id == False: return True else: return False HeaderFooterTextWebKitParser( 'report.account_financial_report_webkit.account.account_report_open_invoices_webkit', 'account.account', 'addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_open_invoices.mako', parser=l10n_cr_PartnersOpenInvoicesWebkit)
aaa.id AS asset_id, aaa.name AS asset_name, aaa.purchase_value AS purchase_value, aadl.amount AS amount, aadl.depreciated_value AS depreciated_value, aadl.remaining_value AS remaining_value, aadl.depreciation_date AS depreciation_date, aaa.purchase_date AS purchase_date FROM account_asset_asset aaa JOIN account_asset_depreciation_line aadl ON (aadl.asset_id = aaa.id) JOIN account_asset_category aac ON (aaa.category_id = aac.id) JOIN account_move_line aml ON (aml.id=aadl.move_id) JOIN account_period ap ON (ap.id=aml.period_id) JOIN account_fiscalyear af ON (af.id=ap.fiscalyear_id) WHERE aaa.state NOT LIKE 'draft' AND aadl.move_check = TRUE AND af.date_stop <= '""" + year + """-12-31' ORDER BY aaa.category_id, aaa.id, aml.id """ self.cr.execute(query_move_lines) res = self.cr.dictfetchall() return res HeaderFooterTextWebKitParser('report.asset_register_report', 'account.asset.asset', os.path.dirname(os.path.realpath(__file__)) + \ '/asset_register_report.mako', parser=asset_register_report)
'initial_balance_mode': initial_balance_mode, }) return super(PartnersLedgerWebkit_by_account, self).set_context( objects, data, new_ids, report_type=report_type) def _compute_partner_ledger_lines(self, accounts_ids, main_filter, target_move, start, stop, partner_filter=False): res = defaultdict(dict) for acc_id in accounts_ids: move_line_ids = self.get_partners_move_lines_ids( acc_id, main_filter, start, stop, target_move, exclude_reconcile=False, partner_filter=partner_filter) if not move_line_ids: continue for partner_id in move_line_ids: partner_line_ids = move_line_ids.get(partner_id, []) lines = self._get_move_line_datas(list(set(partner_line_ids))) res[acc_id][partner_id] = lines return res HeaderFooterTextWebKitParser( 'report.account.account_report_partners_ledger_webkit_by_account', 'account.account', 'addons/general_ledger_by_account_xls/reports/templates/\ account_report_partners_ledger_by_account.mako', parser=PartnersLedgerWebkit_by_account)
for r in res: if r['type'] in ['sale', 'sale_refund']: r['debit'] = r['balance'] r['credit'] = 0.0 self.total_debit += float(r['balance']) elif r['type'] in ['purchase', 'purchase_refund']: r['debit'] = 0.0 r['credit'] = r['balance'] self.total_credit += float(r['balance']) else: r['debit'] = 0.0 r['credit'] = 0.0 return res def _get_journal_totals_credit(self): return self.total_credit def _get_journal_totals_debit(self): return self.total_debit def _get_journal_margins(self): return self.total_credit + self.total_debit HeaderFooterTextWebKitParser('report.account_report_journal_account_flati', 'account.analytic.account', os.path.dirname(os.path.realpath(__file__)) + '/report_journal_account.mako', parser=account_report_journal_account_isa)
return self.pool.get('product.uom').browse(self.cr, self.uid, uom_id, context).name def _get_order_line(self, order_id, limit_page, offset_page): order_obj = pooler.get_pool(self.cr.dbname).get('purchase.order') order_data = order_obj.browse(self.cr, self.uid, order_id) order_lines = [] if order_data and order_data.order_line: hrs_list = [] hrs = pooler.get_pool(self.cr.dbname).get('purchase.order.line') hrs_list = hrs.search(self.cr, self.uid, [('order_id', '=', order_id), ], limit=limit_page, offset=offset_page) order_lines = hrs.browse(self.cr, self.uid, hrs_list) return order_lines def _count_lines(self, order_id): num_lines = 0 order_obj = pooler.get_pool(self.cr.dbname).get('purchase.order') order_data = order_obj.browse(self.cr, self.uid, order_id) if order_data and order_data.order_line: for _ in order_data.order_line: num_lines = num_lines +1 return num_lines HeaderFooterTextWebKitParser('report.purchase_order_accredia', 'purchase.order', os.path.dirname(os.path.realpath(__file__)) + '/order.mako', parser=order)
self.cursor = self.cr self.filter = None self.active_model = context.get('active_model', '') self.active_ids = context.get('active_ids', []) self.company = self.pool.get('res.users').browse( self.cr, uid, uid, context=context).company_id self.localcontext.update({ 'cr': cursor, 'uid': uid, 'get_currency': self._get_currency, 'report_name': _('Nota Spese trasferta'), }) def _get_currency(self, expense_id): if expense_id: expense_obj = self.pool.get('hr.expense.expense') expense_data = expense_obj.browse(self.cr, self.uid, expense_id) for expense_line_data in expense_data.line_ids: if expense_line_data.currency_id and expense_line_data.currency_id.name and expense_line_data.currency_id.name != 'EUR': return expense_line_data.currency_id.name return '' HeaderFooterTextWebKitParser('report.hr_report_print_expense_webkit', 'hr.expense.expense', os.path.dirname(os.path.realpath(__file__)) + '/hr_expense.mako', parser=ParserReportExpense)
self.filters.append(p) domain = [ '|', '&', ('account_id.type', '=', 'payable'), ('debit', '=', 0), '&', ('account_id.type', '=', 'receivable'), ('credit', '=', 0) ] for i in domain: self.filters.append(i) def _get_move_line(self): hrs = pooler.get_pool(self.cr.dbname).get('account.move.line') hrs_list = hrs.search(self.cr, self.uid, self.filters) move_lines = hrs.browse(self.cr, self.uid, hrs_list) return move_lines def get_reconcile_name(self, reconcile_id): reconcile_description = '' if reconcile_id: acc = pooler.get_pool(self.cr.dbname).get('account.move.reconcile') acc_list = acc.browse(self.cr, self.uid, reconcile_id) reconcile_description = acc_list.name_get()[0][1] return reconcile_description HeaderFooterTextWebKitParser('report.due_list_pdf', 'account.move.line', os.path.dirname(os.path.realpath(__file__)) + '/template_due_list.mako', parser=account_due_list_report_ext_isa)
category_account_ids['expense'].id]['balance'], 'last_period': expense_last_period_balances[ category_account_ids['expense'].id]['balance'], 'fiscal_year': expense_fiscal_year_balances[category_account_ids['expense'].id] ['balance'], } return { 'income_accounts': income_accounts, 'expense_accounts': expense_accounts, 'income_account_ids': income_account_ids, 'expense_account_ids': expense_account_ids, 'total_income_balances': total_income_balances, 'total_expense_balances': total_expense_balances, 'income_period_balances': income_period_balances, 'expense_period_balances': expense_period_balances, 'income_last_period_balances': income_last_period_balances, 'expense_last_period_balances': expense_last_period_balances, 'income_fiscal_year_balances': income_fiscal_year_balances, 'expense_fiscal_year_balances': expense_fiscal_year_balances, } HeaderFooterTextWebKitParser( 'report.l10n_cr_account_financial_statements.account.profit_statement_report', 'account.account', 'addons/l10n_cr_account_financial_statements/report/profit_statement_report.mako', parser=ProfitStatementReport)
move_lines_memoizer = self._compute_account_move_lines( dict_account_ids, main_filter, target_move, start, stop) context_report_values.update( {'lines_accounts': move_lines_memoizer}) return objects, new_ids, context_report_values def _compute_account_move_lines(self, dict_accounts_ids, main_filter, target_move, start, stop): res = {} accounts_ids = dict_accounts_ids.keys() for acount_id, child_ids in dict_accounts_ids.items(): lines = [] for acc_id in child_ids: if acc_id in accounts_ids: move_line_ids = self.get_move_lines_ids( acc_id, main_filter, start, stop, target_move) if move_line_ids: lines += self._get_move_line_datas(move_line_ids) res[acount_id] = lines return res HeaderFooterTextWebKitParser( 'report.account.account_report_trial_balance_webkit_ext', 'account.account', 'addons/account_financial_report_webkit/report/templates/account_report_trial_balance.mako', parser=TrialBalanceWebkitExt)
else: jdomain = [ '|', '|' ('default_credit_account_id.code', 'ilike', '572%'), ('default_credit_account_id.code', 'ilike', '570%'), ('default_credit_account_id.code', 'ilike', '629004') ] if jdomain: journals = self.pool['account.journal'].search( self.cursor, self.uid, jdomain) if journals: special_domain = [('id', 'in', partner_line_ids), ('payment_mode_id', '=', False), ('journal_id', 'in', journals)] new_partner_line_ids += move_line_obj.search( self.cursor, self.uid, special_domain) if load_new: partner_line_ids = new_partner_line_ids lines = self._get_move_line_datas(list(set(partner_line_ids))) if lines: res[partner_id] = lines return res HeaderFooterTextWebKitParser( 'report.account.account_report_partner_payment_webkit', 'account.account', 'addons/account_partner_payment_report/report/templates/\ report_partner_payment.mako', parser=PartnersPaymentReportWebkit)
order_data = order_obj.browse(self.cr, self.uid, order_id) order_lines = [] if order_data and order_data.order_line: hrs_list = [] hrs = pooler.get_pool(self.cr.dbname).get('sale.order.line') hrs_list = hrs.search(self.cr, self.uid, [ ('order_id', '=', order_id), ], limit=limit_page, offset=offset_page) order_lines = hrs.browse(self.cr, self.uid, hrs_list) return order_lines def _count_lines(self, order_id): num_lines = 0 order_obj = pooler.get_pool(self.cr.dbname).get('sale.order') order_data = order_obj.browse(self.cr, self.uid, order_id) if order_data and order_data.order_line: for _ in order_data.order_line: num_lines = num_lines + 1 return num_lines HeaderFooterTextWebKitParser('report.report_sale_order_isa', 'sale.order', os.path.dirname(os.path.realpath(__file__)) + '/sale_order.mako', parser=sale_order_report_isa)
self.context = context def _get_hr_holidays_line(self, holidays_id, limit_page, offset_page): hr_holidays_obj = pooler.get_pool(self.cr.dbname).get('hr.holidays') hr_holidays_data = hr_holidays_obj.browse(self.cr, self.uid, holidays_id) hr_holidays_lines = [] if hr_holidays_data and hr_holidays_data.line_ids: hrs_list = [] hrs = pooler.get_pool(self.cr.dbname).get('hr.holidays.line') hrs_list = hrs.search(self.cr, self.uid, [('holidays_id', '=', holidays_id), ], limit=limit_page, offset=offset_page) hr_holidays_lines = hrs.browse(self.cr, self.uid, hrs_list) return hr_holidays_lines def _count_lines(self, holidays_id): num_lines = 0 hr_holidays_obj = pooler.get_pool(self.cr.dbname).get('hr.holidays') hr_holidays_data = hr_holidays_obj.browse(self.cr, self.uid, holidays_id) if hr_holidays_data and hr_holidays_data.line_ids: for _ in hr_holidays_data.line_ids: num_lines = num_lines +1 return num_lines HeaderFooterTextWebKitParser('report.hr_holidays_accredia', 'hr.holidays', os.path.dirname(os.path.realpath(__file__)) + '/hr_holidays.mako', parser=hr_holidays)
def _get_res_city(self): return self.res_city def _get_res_province(self): return self.res_province def _get_gender(self): return self.gender def _get_letter_type(self): return self.letter_type def _get_day_period_start(self): return str(self.period_start[8:10]) def _get_day_period_end(self): return str(self.period_end[8:10]) def _get_month_period_start(self): return str(self.period_start[5:7]) def _get_month_period_end(self): return str(self.period_end[5:7]) HeaderFooterTextWebKitParser('report.exporter_statement_report', 'account.exporter.statements', os.path.dirname(os.path.realpath(__file__)) + '/exporter_statements.mako', parser=parser_exporter_statements)
'amount_currency': self._get_amount_currency, 'display_target_move': self._get_display_target_move, 'accounts': self._get_accounts_br, 'additional_args': [ ('--header-font-name', 'Helvetica'), ('--footer-font-name', 'Helvetica'), ('--header-font-size', '10'), ('--footer-font-size', '6'), ('--header-left', header_report_name), ('--header-spacing', '2'), ('--footer-left', footer_date_time), ('--footer-right', ' '.join( (_('Page'), '[page]', _('of'), '[topage]'))), ('--footer-line', ), ], }) def setLang(self, lang): self.localcontext['lang'] = lang self.lang_dict_called = False HeaderFooterTextWebKitParser( 'report.account.account_report_ledger_balance_webkit', 'account.account', 'addons/account_financial_report_compressed/' 'report/templates/account_report_ledger_balance.mako', parser=LedgerBalanceWebkit)
import time from openerp.report import report_sxw import os from openerp.addons.account_financial_report_webkit.report.common_partner_reports import CommonPartnersReportHeaderWebkit from openerp.addons.account_financial_report_webkit.report.webkit_parser_header_fix import HeaderFooterTextWebKitParser class sale_worksheet_report_isa(report_sxw.rml_parse, CommonPartnersReportHeaderWebkit): _name = 'sale.worksheet.report.isa' def __init__(self, cr, uid, name, context=None): if context is None: context = {} super(sale_worksheet_report_isa, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) self.context = context HeaderFooterTextWebKitParser('report.worksheet_isa', 'sale.order', os.path.dirname(os.path.realpath(__file__)) + '/worksheet.mako', parser=sale_worksheet_report_isa)
return { 'asset_accounts': asset_accounts, 'liability_accounts': liability_accounts, 'equity_accounts': equity_accounts, 'income_account': income_account, 'expense_account': expense_account, 'asset_accounts_ids': asset_account_ids, 'liability_account_ids': liability_account_ids, 'equity_account_ids': equity_account_ids, 'income_account_id': income_account_id, 'expense_account_id': expense_account_id, 'total_asset_balances': total_asset_balances, 'total_liability_balances': total_liability_balances, 'total_equity_balances': total_equity_balances, 'total_income_balance': total_income_balance, 'total_expense_balance': total_expense_balance, 'asset_period_balances': asset_period_balances, 'liability_period_balances': liability_period_balances, 'equity_period_balances': equity_period_balances, 'asset_fiscal_year_balances': asset_fiscal_year_balances, 'liability_fiscal_year_balances': liability_fiscal_year_balances, 'equity_fiscal_year_balances': equity_fiscal_year_balances, } HeaderFooterTextWebKitParser( 'report.l10n_cr_account_financial_statements.account.situation_balance_report', 'account.account', 'addons/l10n_cr_account_financial_statements/report/situation_balance_report.mako', parser=IncomeStatementReport)
def _get_period_range(self, period_ids): period_start = '' period_stop = '' date_start = None date_stop = None period_data = self.pool.get('account.period').browse( self.cr, self.uid, period_ids) for t_period in period_data: if t_period.date_start: if not date_start: date_start = t_period.date_start if date_start <= t_period.date_start: date_start = t_period.date_start period_start = date_start if t_period.date_stop: if not date_stop: date_stop = t_period.date_stop if date_stop >= t_period.date_stop: date_stop = t_period.date_stop period_stop = date_stop return period_start + ' - ' + period_stop HeaderFooterTextWebKitParser('report.list_commission_invoice', 'account.invoice', os.path.dirname(os.path.realpath(__file__)) + '/list_commission_invoice.mako', parser=Parser)
It contains has partial reconcile id as key and the count of lines related to the reconcile id :param: a list of ledger lines generated by parent :class:`.open_invoices.PartnersOpenInvoicesWebkit` :retuns: lookup dict {ṛec_id: count} """ # possible bang if l_ids is really long. # We have the same weakness in common_report ... # but it seems not really possible for a partner # So I'll keep that option. l_ids = tuple(x['id'] for x in lines) sql = ("SELECT reconcile_partial_id, COUNT(*) FROM account_move_line" " WHERE reconcile_partial_id IS NOT NULL" " AND id in %s" " GROUP BY reconcile_partial_id") self.cr.execute(sql, (l_ids, )) res = self.cr.fetchall() return dict((x[0], x[1]) for x in res) HeaderFooterTextWebKitParser( 'report.account.account_aged_trial_balance_webkit', 'account.account', 'addons/account_financial_report_webkit/report/templates/\ aged_trial_webkit.mako', parser=AccountAgedTrialBalanceWebkit, )
if filter_type == 'filter_opening': period_ids = [ self.pool.get('account.period').search( cr, uid, [('fiscalyear_id', '=', fiscal_year_id), ('special', '=', True)], order='date_start asc')[0] ] initial_balance = self.pool.get( 'account.webkit.report.library').get_account_balance( cr, uid, accounts_ids, field_names, initial_balance=True, fiscal_year_id=fiscalyear.id, state=target_move, period_ids=period_ids, chart_account_id=chart_account_id, filter_type=filter_type) return initial_balance HeaderFooterTextWebKitParser( 'report.l10n_cr_account_financial_report_webkit.account.account_report_account_bank_balances_webkit', 'account.account', 'addons/l10n_cr_account_financial_report_webkit/report/account_bank_balances.mako', parser=account_bank_balances)
l.product_id, l.analytic_account, s.voucher_id, s.currency_id, s.user_valid, s.department_id, l.uom_id, l.id, s.state, s.journal_id, s.company_id, s.employee_id, em.name_related, p.expense_type ORDER BY s.company_id, s.employee_id """ self.cr.execute(query) res = self.cr.dictfetchall() return res HeaderFooterTextWebKitParser('report.account_report_expense_final', 'hr.expense.expense', os.path.dirname(os.path.realpath(__file__)) + '/hr_expense_final.mako', parser=ParserReportExpenseFinal)
m.document_date AS mdocument_date, m.document_number AS mdocument_number, m.name AS mname, l.ref AS lref, l.name AS lname, l.debit AS ldebit, l.credit AS lcredit, a.id AS account_id, a.code AS account_code, a.name AS account_name FROM account_move_line l JOIN account_move m on (l.move_id=m.id) JOIN account_account a on (l.account_id = a.id) JOIN account_journal j on (l.journal_id=j.id) WHERE (j.exclude_from_central_journal is null OR j.exclude_from_central_journal = FALSE) """ + t_filter + """ ORDER BY l.date, l.move_id asc """ self.cr.execute(query_move_lines) res = self.cr.dictfetchall() return res HeaderFooterTextWebKitParser('report.central_journal_report', 'account.move.line', os.path.dirname(os.path.realpath(__file__)) + \ '/central_journal_report.mako', parser=central_journal_report)
('--footer-font-size', '6'), ('--header-left', header_report_name), ('--header-spacing', '2'), ('--footer-left', footer_date_time), ('--footer-right', ' '.join( (_('Pagina'), t_year, _('/'), '[page]'))), ('--footer-line', ), ], }) return super(Parser, self).set_context(objects, data, ids, report_type=report_type) HeaderFooterTextWebKitParser('report.vat_registry_sale_webkit', 'account.move', os.path.dirname(os.path.realpath(__file__)) + '/vat_registry_sale.mako', parser=Parser) HeaderFooterTextWebKitParser('report.vat_registry_purchase_webkit', 'account.move', os.path.dirname(os.path.realpath(__file__)) + '/vat_registry_purchase.mako', parser=Parser) HeaderFooterTextWebKitParser('report.vat_registry_corrispettivi_webkit', 'account.move', os.path.dirname(os.path.realpath(__file__)) + '/vat_registry_corrispettivi.mako', parser=Parser)
from account_move_line join account_account on account_move_line.account_id = account_account.id join account_move on account_move_line.move_id = account_move.id where account_move_line.move_id = """ + str( move_id) + """ and account_account.id = """ + str( account_id) + """ ) """ + (form_values and form_values['target_move'] and form_values['target_move'] == 'posted' and "and account_move.state like 'posted'" or '' ) + """ ) order by l.move_id, l.reconcile_id, l.reconcile_partial_id """ self.cr.execute(query_move_lines) res = self.cr.dictfetchall() return res HeaderFooterTextWebKitParser('report.account.report.statement', 'account.account', os.path.dirname(os.path.realpath(__file__)) + '/templates/account_report_statement.mako', parser=AccountReportStatement)
date_start = filter_data[0] move_lines_id = self.pool.get('account.move.line').search( cr, uid, [('account_id', '=', account.id), ('partner_id', '=', partner), ('date', '<', date_start), ('reconcile_id', '=', False)], context=context) move_lines = self.pool.get('account.move.line').browse( cr, uid, move_lines_id) amount = 0.0 for move_line in move_lines: if currency != 'CRC': amount = move_line.amount_currency else: if move_line.debit != 0.0: amount = move_line.debit elif move_line.credit != 0.0: amount = move_line.credit * -1 initial_balance += amount return initial_balance HeaderFooterTextWebKitParser( 'report.account_financial_report_webkit.account.account_report_partners_ledger_webkit', 'account.account', 'addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partners_ledger.mako', parser=l10n_cr_PartnersLedgerWebkit)
t_count = 0 t_list = [] invoice_lines = {} invoice_obj = pooler.get_pool(self.cr.dbname).get('account.invoice') invoice_data = invoice_obj.browse(self.cr, self.uid, invoice_id) for t_line in invoice_data.tax_line: if (not t_line.tax_code_id) or (t_line.tax_code_id and not t_line.tax_code_id.notprintable): t_code = t_line.tax_code_id and t_line.tax_code_id.code or '-' if t_code not in t_list: t_list.append(t_code) invoice_lines[t_count] = {'code': t_code, 'name': t_line.name or '', 'base': t_line.base or 0.0, 'amount': t_line.amount or 0.0, } t_count = t_count + 1 else: for t_dict in invoice_lines: if invoice_lines[t_dict]['code'] == t_code: invoice_lines[t_dict]['base'] += t_line.base or 0.0 invoice_lines[t_dict]['amount'] += t_line.amount or 0.0 break return invoice_lines HeaderFooterTextWebKitParser('report.fattura_accredia_report2', 'account.invoice', os.path.dirname(os.path.realpath(__file__)) + '/invoice_accredia.mako', parser=parser_invoice_report_accredia)