[REF] report: remove the report module
The content of the report module is now dispatched in the 'base' and the 'web' modules.
This commit is contained in:
@@ -15,7 +15,7 @@ You could use this simplified accounting in case you work with an (external) acc
|
||||
'category': 'Accounting',
|
||||
'website': 'https://www.odoo.com/page/billing',
|
||||
'images' : ['images/accounts.jpeg','images/bank_statement.jpeg','images/cash_register.jpeg','images/chart_of_accounts.jpeg','images/customer_invoice.jpeg','images/journal_entries.jpeg'],
|
||||
'depends' : ['base_setup', 'product', 'analytic', 'report', 'web_planner'],
|
||||
'depends' : ['base_setup', 'product', 'analytic', 'web_planner'],
|
||||
'data': [
|
||||
'security/account_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
|
||||
@@ -411,7 +411,7 @@ class AccountInvoice(models.Model):
|
||||
"""
|
||||
self.ensure_one()
|
||||
self.sent = True
|
||||
return self.env['report'].get_action(self, 'account.report_invoice')
|
||||
return self.env.ref('account.account_invoices').report_action(self)
|
||||
|
||||
@api.multi
|
||||
def action_invoice_sent(self):
|
||||
@@ -564,14 +564,14 @@ class AccountInvoice(models.Model):
|
||||
self.write({'state': 'draft', 'date': False})
|
||||
# Delete former printed invoice
|
||||
try:
|
||||
report_invoice = self.env['report']._get_report_from_name('account.report_invoice')
|
||||
report_invoice = self.env['ir.actions.report']._get_report_from_name('account.report_invoice')
|
||||
except IndexError:
|
||||
report_invoice = False
|
||||
if report_invoice and report_invoice.attachment:
|
||||
for invoice in self:
|
||||
with invoice.env.do_in_draft():
|
||||
invoice.number, invoice.state = invoice.move_name, 'open'
|
||||
attachment = self.env['report']._attachment_stored(invoice, report_invoice)[invoice.id]
|
||||
attachment = self.env['ir.actions.report'].retrieve_attachment(invoice.id)
|
||||
if attachment:
|
||||
attachment.unlink()
|
||||
return True
|
||||
|
||||
@@ -195,7 +195,7 @@ class ReportAgedPartnerBalance(models.AbstractModel):
|
||||
return res, total, lines
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
total = []
|
||||
model = self.env.context.get('active_model')
|
||||
docs = self.env[model].browse(self.env.context.get('active_id'))
|
||||
@@ -211,7 +211,7 @@ class ReportAgedPartnerBalance(models.AbstractModel):
|
||||
account_type = ['payable', 'receivable']
|
||||
|
||||
movelines, total, dummy = self._get_partner_move_lines(account_type, date_from, target_move, data['form']['period_length'])
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': self.ids,
|
||||
'doc_model': model,
|
||||
'data': data['form'],
|
||||
@@ -220,4 +220,3 @@ class ReportAgedPartnerBalance(models.AbstractModel):
|
||||
'get_partner_lines': movelines,
|
||||
'get_direction': total,
|
||||
}
|
||||
return self.env['report'].render('account.report_agedpartnerbalance', docargs)
|
||||
|
||||
@@ -56,14 +56,14 @@ class ReportTrialBalance(models.AbstractModel):
|
||||
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
self.model = self.env.context.get('active_model')
|
||||
docs = self.env[self.model].browse(self.env.context.get('active_ids', []))
|
||||
display_account = data['form'].get('display_account')
|
||||
accounts = docs if self.model == 'account.account' else self.env['account.account'].search([])
|
||||
account_res = self.with_context(data['form'].get('used_context'))._get_accounts(accounts, display_account)
|
||||
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': self.ids,
|
||||
'doc_model': self.model,
|
||||
'data': data['form'],
|
||||
@@ -71,4 +71,3 @@ class ReportTrialBalance(models.AbstractModel):
|
||||
'time': time,
|
||||
'Accounts': account_res,
|
||||
}
|
||||
return self.env['report'].render('account.report_trialbalance', docargs)
|
||||
|
||||
@@ -108,7 +108,7 @@ class ReportGeneralLedger(models.AbstractModel):
|
||||
return account_res
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
self.model = self.env.context.get('active_model')
|
||||
docs = self.env[self.model].browse(self.env.context.get('active_ids', []))
|
||||
|
||||
@@ -121,7 +121,7 @@ class ReportGeneralLedger(models.AbstractModel):
|
||||
|
||||
accounts = docs if self.model == 'account.account' else self.env['account.account'].search([])
|
||||
accounts_res = self.with_context(data['form'].get('used_context',{}))._get_account_move_entry(accounts, init_balance, sortby, display_account)
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': docids,
|
||||
'doc_model': self.model,
|
||||
'data': data['form'],
|
||||
@@ -130,4 +130,3 @@ class ReportGeneralLedger(models.AbstractModel):
|
||||
'Accounts': accounts_res,
|
||||
'print_journal': codes,
|
||||
}
|
||||
return self.env['report'].render('account.report_generalledger', docargs)
|
||||
|
||||
@@ -94,14 +94,14 @@ class ReportJournal(models.AbstractModel):
|
||||
return self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get()
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
target_move = data['form'].get('target_move', 'all')
|
||||
sort_selection = data['form'].get('sort_selection', 'date')
|
||||
|
||||
res = {}
|
||||
for journal in data['form']['journal_ids']:
|
||||
res[journal] = self.with_context(data['form'].get('used_context', {})).lines(target_move, journal, sort_selection, data)
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': data['form']['journal_ids'],
|
||||
'doc_model': self.env['account.journal'],
|
||||
'data': data,
|
||||
@@ -112,4 +112,3 @@ class ReportJournal(models.AbstractModel):
|
||||
'sum_debit': self._sum_debit,
|
||||
'get_taxes': self._get_taxes,
|
||||
}
|
||||
return self.env['report'].render('account.report_journal', docargs)
|
||||
|
||||
@@ -31,7 +31,7 @@ class ReportOverdue(models.AbstractModel):
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
totals = {}
|
||||
lines = self._get_account_move_lines(docids)
|
||||
lines_to_display = {}
|
||||
@@ -57,7 +57,7 @@ class ReportOverdue(models.AbstractModel):
|
||||
totals[partner_id][currency]['paid'] += line['credit']
|
||||
totals[partner_id][currency]['mat'] += line['mat']
|
||||
totals[partner_id][currency]['total'] += line['debit'] - line['credit']
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': docids,
|
||||
'doc_model': 'res.partner',
|
||||
'docs': self.env['res.partner'].browse(docids),
|
||||
@@ -66,4 +66,3 @@ class ReportOverdue(models.AbstractModel):
|
||||
'Totals': totals,
|
||||
'Date': fields.date.today(),
|
||||
}
|
||||
return self.env['report'].render('account.report_overdue', values=docargs)
|
||||
|
||||
@@ -68,7 +68,7 @@ class ReportPartnerLedger(models.AbstractModel):
|
||||
return result
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
data['computed'] = {}
|
||||
|
||||
obj_partner = self.env['res.partner']
|
||||
@@ -107,7 +107,7 @@ class ReportPartnerLedger(models.AbstractModel):
|
||||
partners = obj_partner.browse(partner_ids)
|
||||
partners = sorted(partners, key=lambda x: (x.ref, x.name))
|
||||
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': partner_ids,
|
||||
'doc_model': self.env['res.partner'],
|
||||
'data': data,
|
||||
@@ -116,4 +116,3 @@ class ReportPartnerLedger(models.AbstractModel):
|
||||
'lines': self._lines,
|
||||
'sum_partner': self._sum_partner,
|
||||
}
|
||||
return self.env['report'].render('account.report_partnerledger', docargs)
|
||||
|
||||
@@ -143,11 +143,11 @@ class ReportFinancial(models.AbstractModel):
|
||||
return lines
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
self.model = self.env.context.get('active_model')
|
||||
docs = self.env[self.model].browse(self.env.context.get('active_id'))
|
||||
report_lines = self.get_account_lines(data.get('form'))
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': self.ids,
|
||||
'doc_model': self.model,
|
||||
'data': data['form'],
|
||||
@@ -155,4 +155,3 @@ class ReportFinancial(models.AbstractModel):
|
||||
'time': time,
|
||||
'get_account_lines': report_lines,
|
||||
}
|
||||
return self.env['report'].render('account.report_financial', docargs)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_payment_receipt">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<h3><strong>Payment Receipt: <span t-field="o.name"/></strong></h3>
|
||||
<div class="row mt64">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_agedpartnerbalance">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2>Aged Partner Balance</h2>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_financial">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2 t-esc="data['account_report_id'][1]"/>
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<odoo>
|
||||
|
||||
<template id="report_generalledger">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-set="data_report_margin_top" t-value="12"/>
|
||||
<t t-set="data_report_header_spacing" t-value="9"/>
|
||||
<t t-set="data_report_dpi" t-value="110"/>
|
||||
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2><span t-esc="res_company.name"/>: General ledger</h2>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<template id="report_invoice_document">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})" />
|
||||
<div class="page">
|
||||
<div class="row">
|
||||
@@ -164,7 +164,7 @@
|
||||
</template>
|
||||
|
||||
<template id="report_invoice">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="account.report_invoice_document" t-lang="o.partner_id.lang"/>
|
||||
</t>
|
||||
@@ -183,7 +183,7 @@
|
||||
</template>
|
||||
|
||||
<template id="account_invoice_report_duplicate_main">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="account.account_invoice_report_duplicate" t-lang="o.partner_id.lang"/>
|
||||
</t>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_journal">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-set="data_report_margin_top" t-value="12"/>
|
||||
<t t-set="data_report_header_spacing" t-value="9"/>
|
||||
<t t-set="data_report_dpi" t-value="110"/>
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2><t t-esc="o.name"/> Journal</h2>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="account.report_overdue_document">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<div class="row">
|
||||
<div class="col-xs-5 col-xs-offset-7">
|
||||
@@ -79,7 +79,7 @@
|
||||
</template>
|
||||
|
||||
<template id="report_overdue">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="account.report_overdue_document" t-lang="o.lang"/>
|
||||
</t>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_partnerledger">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-set="data_report_margin_top" t-value="12"/>
|
||||
<t t-set="data_report_header_spacing" t-value="9"/>
|
||||
<t t-set="data_report_dpi" t-value="110"/>
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2>Partner Ledger</h2>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_trialbalance">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2><span t-esc="res_company.name"/>: Trial Balance</h2>
|
||||
|
||||
|
||||
@@ -48,4 +48,4 @@ class AccountingReport(models.TransientModel):
|
||||
|
||||
def _print_report(self, data):
|
||||
data['form'].update(self.read(['date_from_cmp', 'debit_credit', 'date_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter', 'target_move'])[0])
|
||||
return self.env['report'].get_action(self, 'account.report_financial', data=data, config=False)
|
||||
return self.env.ref('account.action_report_financial').report_action(self, data=data, config=False)
|
||||
|
||||
@@ -38,4 +38,4 @@ class AccountAgedTrialBalance(models.TransientModel):
|
||||
}
|
||||
start = stop - relativedelta(days=1)
|
||||
data['form'].update(res)
|
||||
return self.env['report'].with_context(landscape=True).get_action(self, 'account.report_agedpartnerbalance', data=data)
|
||||
return self.env.ref('account.action_report_aged_partner_balance').with_context(landscape=True).report_action(self, data=data)
|
||||
|
||||
@@ -20,4 +20,4 @@ class AccountReportGeneralLedger(models.TransientModel):
|
||||
if data['form'].get('initial_balance') and not data['form'].get('date_from'):
|
||||
raise UserError(_("You must define a Start Date"))
|
||||
records = self.env[data['model']].browse(data.get('ids', []))
|
||||
return self.env['report'].with_context(landscape=True).get_action(records, 'account.report_generalledger', data=data)
|
||||
return self.env.ref('account.action_report_general_ledger').with_context(landscape=True).report_action(records, data=data)
|
||||
|
||||
@@ -15,4 +15,4 @@ class AccountPartnerLedger(models.TransientModel):
|
||||
def _print_report(self, data):
|
||||
data = self.pre_print_report(data)
|
||||
data['form'].update({'reconciled': self.reconciled, 'amount_currency': self.amount_currency})
|
||||
return self.env['report'].get_action(self, 'account.report_partnerledger', data=data)
|
||||
return self.env.ref('account.action_report_partnerledger').report_action(self, data=data)
|
||||
|
||||
@@ -14,4 +14,4 @@ class AccountPrintJournal(models.TransientModel):
|
||||
def _print_report(self, data):
|
||||
data = self.pre_print_report(data)
|
||||
data['form'].update({'sort_selection': self.sort_selection})
|
||||
return self.env['report'].with_context(landscape=True).get_action(self, 'account.report_journal', data=data)
|
||||
return self.env.ref('account.action_report_journal').with_context(landscape=True).report_action(self, data=data)
|
||||
|
||||
@@ -13,4 +13,4 @@ class AccountBalanceReport(models.TransientModel):
|
||||
def _print_report(self, data):
|
||||
data = self.pre_print_report(data)
|
||||
records = self.env[data['model']].browse(data.get('ids', []))
|
||||
return self.env['report'].get_action(records, 'account.report_trialbalance', data=data)
|
||||
return self.env.ref('account.action_report_trial_balance').report_action(records, data=data)
|
||||
|
||||
@@ -61,11 +61,10 @@ class ReportAssertAccount(models.AbstractModel):
|
||||
return result
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
Report = self.env['report']
|
||||
report = Report._get_report_from_name('account_test.report_accounttest')
|
||||
def get_report_values(self, docids, data=None):
|
||||
report = self.env['ir.actions.report']._get_report_from_name('account_test.report_accounttest')
|
||||
records = self.env['accounting.assert.test'].browse(self.ids)
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': self._ids,
|
||||
'doc_model': report.model,
|
||||
'docs': records,
|
||||
@@ -73,4 +72,3 @@ class ReportAssertAccount(models.AbstractModel):
|
||||
'execute_code': self.execute_code,
|
||||
'datetime': datetime
|
||||
}
|
||||
return Report.render('account_test.report_accounttest', docargs)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_accounttest">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2>Accouting tests on <span t-esc="datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')"/></h2>
|
||||
<div t-foreach="docs" t-as="o">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'version': '1.1',
|
||||
'website' : 'https://www.odoo.com/page/accounting',
|
||||
'category': 'Hidden/Dependency',
|
||||
'depends' : ['base', 'decimal_precision', 'mail', 'report'],
|
||||
'depends' : ['base', 'decimal_precision', 'mail'],
|
||||
'description': """
|
||||
Module for defining analytic accounting object.
|
||||
===============================================
|
||||
|
||||
@@ -32,6 +32,8 @@ class BaseConfigSettings(models.TransientModel):
|
||||
group_multi_currency = fields.Boolean(string='Allow multi currencies',
|
||||
implied_group='base.group_multi_currency',
|
||||
help="Allows to work in a multi currency environment")
|
||||
paperformat_id = fields.Many2one(related="company_id.paperformat_id", string='Paper format')
|
||||
external_report_layout = fields.Selection(related="company_id.external_report_layout")
|
||||
|
||||
@api.model
|
||||
def get_default_fields(self, fields):
|
||||
@@ -80,5 +82,33 @@ class BaseConfigSettings(models.TransientModel):
|
||||
for config in self:
|
||||
partner_rule.write({'active': not config.company_share_partner})
|
||||
|
||||
def act_discover_fonts(self):
|
||||
self.company_id.act_discover_fonts()
|
||||
@api.model
|
||||
def _prepare_report_view_action(self, template):
|
||||
template_id = self.env.ref(template)
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'ir.ui.view',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_id': template_id.id,
|
||||
}
|
||||
|
||||
@api.model
|
||||
def edit_external_header(self):
|
||||
return self._prepare_report_view_action('web.external_layout_' + self.external_report_layout)
|
||||
|
||||
@api.model
|
||||
def change_report_template(self):
|
||||
self.ensure_one()
|
||||
template = self.env.ref('report.view_company_report_form', False)
|
||||
return {
|
||||
'name': _('Choose Your Document Layout'),
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_id': self.env.user.company_id.id,
|
||||
'res_model': 'res.company',
|
||||
'views': [(template.id, 'form')],
|
||||
'view_id': template.id,
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
@@ -10,7 +10,46 @@
|
||||
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div id="business_documents"/>
|
||||
<div id="business_documents">
|
||||
<h2>Business Documents</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_right_pane">
|
||||
<label string="Format"/>
|
||||
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/>
|
||||
<div class="text-muted">
|
||||
Set the paper format of printed documents
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16 row">
|
||||
<label for="paperformat_id" string="Format" class="col-xs-3 col-md-3 o_light_label"/>
|
||||
<field name="paperformat_id" class="oe_inline"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_right_pane">
|
||||
<label string="Document Template"/>
|
||||
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/>
|
||||
<div class="text-muted">
|
||||
Choose your document's header and footer layout
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16" groups="base.group_no_one">
|
||||
<label for="external_report_layout" string="Template" class="col-xs-3 col-md-3 o_light_label"/>
|
||||
<field name="external_report_layout" class="oe_inline"/>
|
||||
</div>
|
||||
<div class="mt16">
|
||||
<button name="change_report_template" string="Change Document Template" type="object" class="oe_link" icon="fa-arrow-right"/>
|
||||
<button name="edit_external_header" string="Edit Header" type="object" class="oe_link" groups="base.group_no_one"/>
|
||||
<button name="%(base.action_report_externalpreview)d" string="Preview Document" type="action" class="oe_link" groups="base.group_no_one"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="emails"/>
|
||||
<h2>Users</h2>
|
||||
<div class="row mt16 o_settings_container" id="default_user_rights">
|
||||
|
||||
@@ -17,7 +17,7 @@ Key Features
|
||||
* Manage your Events and Registrations
|
||||
* Use emails to automatically confirm and send acknowledgments for any event registration
|
||||
""",
|
||||
'depends': ['base_setup', 'mail', 'report'],
|
||||
'depends': ['base_setup', 'mail'],
|
||||
'data': [
|
||||
'security/event_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<!-- template use to render a Registration Badge -->
|
||||
<template id="event_registration_report_template_badge">
|
||||
<t t-call="report.basic_layout">
|
||||
<t t-call="web.basic_layout">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<div class="page">
|
||||
<div class="row">
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
<!-- template use to edit Event Badget (allow to set the HTML badge fields) -->
|
||||
<template id="event_event_report_template_badge">
|
||||
<t t-call="report.basic_layout">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page">
|
||||
<t t-foreach="docs" t-as="event">
|
||||
<div class="row">
|
||||
|
||||
@@ -16,7 +16,7 @@ Keeps account of the attendances of the employees on the basis of the
|
||||
actions(Check in/Check out) performed by them.
|
||||
""",
|
||||
'website': 'https://www.odoo.com/page/employees',
|
||||
'depends': ['hr', 'report', 'barcodes'],
|
||||
'depends': ['hr', 'barcodes'],
|
||||
'data': [
|
||||
'security/hr_attendance_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</record>
|
||||
|
||||
<template id="print_employee_badge">
|
||||
<t t-call="report.basic_layout">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page">
|
||||
<t t-foreach="docs" t-as="employee">
|
||||
<div class="col-sm-6">
|
||||
|
||||
@@ -26,7 +26,7 @@ The whole flow is implemented as:
|
||||
This module also uses analytic accounting and is compatible with the invoice on timesheet module so that you are able to automatically re-invoice your customers' expenses if your work by project.
|
||||
""",
|
||||
'website': 'https://www.odoo.com/page/expenses',
|
||||
'depends': ['hr_contract', 'account_accountant', 'report', 'web_tour'],
|
||||
'depends': ['hr_contract', 'account_accountant', 'web_tour'],
|
||||
'data': [
|
||||
'security/hr_expense_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_expense_sheet">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<h2>Expenses Report</h2>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_expense">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="get_expenses()" t-as="o">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<h2>HR Expenses</h2>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ You can keep track of leaves in different ways by following reports:
|
||||
|
||||
A synchronization with an internal agenda (Meetings of the CRM module) is also possible in order to automatically create a meeting when a leave request is accepted by setting up a type of meeting in Leave Type.
|
||||
""",
|
||||
'depends': ['hr', 'calendar', 'resource', 'report'],
|
||||
'depends': ['hr', 'calendar', 'resource'],
|
||||
'data': [
|
||||
'data/report_paperformat.xml',
|
||||
'data/hr_holidays_data.xml',
|
||||
|
||||
@@ -101,11 +101,10 @@ class HrHolidaySummaryReport(models.AbstractModel):
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
Report = self.env['report']
|
||||
holidays_report = Report._get_report_from_name('hr_holidays.report_holidayssummary')
|
||||
def get_report_values(self, docids, data=None):
|
||||
holidays_report = self.env['ir.actions.report']._get_report_from_name('hr_holidays.report_holidayssummary')
|
||||
holidays = self.env['hr.holidays'].browse(self.ids)
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': self.ids,
|
||||
'doc_model': holidays_report.model,
|
||||
'docs': holidays,
|
||||
@@ -115,4 +114,3 @@ class HrHolidaySummaryReport(models.AbstractModel):
|
||||
'get_data_from_report': self._get_data_from_report(data['form']),
|
||||
'get_holidays_status': self._get_holidays_status(),
|
||||
}
|
||||
return Report.render('hr_holidays.report_holidayssummary', docargs)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<odoo>
|
||||
|
||||
<report
|
||||
id="report_holidays_summary"
|
||||
id="action_report_holidayssummary"
|
||||
string="Leaves Summary"
|
||||
model="hr.holidays"
|
||||
report_type="qweb-pdf"
|
||||
@@ -10,7 +10,7 @@
|
||||
file="hr_holidays.report_holidayssummary"
|
||||
menu="False"/>
|
||||
|
||||
<record id="report_holidays_summary" model="ir.actions.report">
|
||||
<record id="action_report_holidayssummary" model="ir.actions.report">
|
||||
<field name="paperformat_id" ref="hr_holidays.paperformat_hrsummary"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<odoo>
|
||||
|
||||
<template id="report_holidayssummary">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h3 class="mb32">Leaves Summary</h3>
|
||||
<t t-set="info" t-value="get_header_info"/>
|
||||
|
||||
@@ -31,4 +31,4 @@ class HolidaysSummaryDept(models.TransientModel):
|
||||
'model': 'hr.department',
|
||||
'form': data
|
||||
}
|
||||
return self.env['report'].get_action(departments, 'hr_holidays.report_holidayssummary', data=datas)
|
||||
return self.env.ref('hr_holidays.action_report_holidayssummary').report_action(departments, data=datas)
|
||||
|
||||
@@ -29,4 +29,4 @@ class HolidaysSummaryEmployee(models.TransientModel):
|
||||
'model': 'hr.employee',
|
||||
'form': data
|
||||
}
|
||||
return self.env['report'].get_action(employees, 'hr_holidays.report_holidayssummary', data=datas)
|
||||
return self.env.ref('hr_holidays.action_report_holidayssummary').report_action(employees, data=datas)
|
||||
|
||||
@@ -24,7 +24,6 @@ Generic Payroll system.
|
||||
'hr_contract',
|
||||
'hr_holidays',
|
||||
'decimal_precision',
|
||||
'report',
|
||||
],
|
||||
'data': [
|
||||
'security/hr_payroll_security.xml',
|
||||
|
||||
@@ -28,7 +28,7 @@ class ContributionRegisterReport(models.AbstractModel):
|
||||
return result
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
register_ids = self.env.context.get('active_ids', [])
|
||||
contrib_registers = self.env['hr.contribution.register'].browse(register_ids)
|
||||
date_from = data['form'].get('date_from', fields.Date.today())
|
||||
@@ -38,7 +38,7 @@ class ContributionRegisterReport(models.AbstractModel):
|
||||
for register in contrib_registers:
|
||||
lines = lines_data.get(register.id)
|
||||
lines_total[register.id] = lines and sum(lines.mapped('total')) or 0.0
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': register_ids,
|
||||
'doc_model': 'hr.contribution.register',
|
||||
'docs': contrib_registers,
|
||||
@@ -46,4 +46,3 @@ class ContributionRegisterReport(models.AbstractModel):
|
||||
'lines_data': lines_data,
|
||||
'lines_total': lines_total
|
||||
}
|
||||
return self.env['report'].render('hr_payroll.report_contributionregister', docargs)
|
||||
|
||||
@@ -87,9 +87,9 @@ class PayslipDetailsReport(models.AbstractModel):
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
payslips = self.env['hr.payslip'].browse(docids)
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': docids,
|
||||
'doc_model': 'hr.payslip',
|
||||
'docs': payslips,
|
||||
@@ -97,4 +97,3 @@ class PayslipDetailsReport(models.AbstractModel):
|
||||
'get_details_by_rule_category': self.get_details_by_rule_category(payslips.mapped('details_by_salary_rule_category').filtered(lambda r: r.appears_on_payslip)),
|
||||
'get_lines_by_contribution_register': self.get_lines_by_contribution_register(payslips.mapped('line_ids').filtered(lambda r: r.appears_on_payslip)),
|
||||
}
|
||||
return self.env['report'].render('hr_payroll.report_payslipdetails', docargs)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_contributionregister">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<h2>PaySlip Lines by Contribution Register</h2>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_payslip">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<h2>Pay Slip</h2>
|
||||
<p t-field="o.name"/>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_payslipdetails">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<h2>Pay Slip</h2>
|
||||
<p t-field="o.name"/>
|
||||
|
||||
@@ -24,4 +24,4 @@ class PayslipLinesContributionRegister(models.TransientModel):
|
||||
'model': 'hr.contribution.register',
|
||||
'form': self.read()[0]
|
||||
}
|
||||
return self.env['report'].get_action([], 'hr_payroll.report_contributionregister', data=datas)
|
||||
return self.env.ref('hr_payroll.action_contribution_register').report_action([], data=datas)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<odoo>
|
||||
<template id="report_timesheet">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-set="show_task" t-value="bool(docs.mapped('task_id'))"/>
|
||||
<t t-set="show_project" t-value="len(docs.mapped('project_id')) > 1"/>
|
||||
<div class="page">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record model="res.company" id="base.main_company">
|
||||
<field name="paperformat_id" ref="report.paperformat_us"/>
|
||||
<field name="paperformat_id" ref="base.paperformat_us"/>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -148,7 +148,7 @@ class AccountInvoice(models.Model):
|
||||
self.ensure_one()
|
||||
if self.l10n_ch_isr_valid:
|
||||
self.l10n_ch_isr_sent = True
|
||||
return self.env['report'].get_action(self, 'l10n_ch.isr_report_main')
|
||||
return self.env.ref('l10n_ch.l10n_ch_isr_report').report_action(self)
|
||||
else:
|
||||
raise ValidationError(_("""You cannot generate an ISR yet.\n
|
||||
For this, you need to :\n
|
||||
|
||||
@@ -34,7 +34,7 @@ class MailTemplate(models.Model):
|
||||
template = res_ids_to_templates[res_id]
|
||||
report_name = 'ISR-' + self.render_template(template.report_name, template.model, res_id) + '.pdf'
|
||||
|
||||
pdf = self.env['report'].get_pdf([res_id], 'l10n_ch.isr_report_main')
|
||||
pdf = self.env.ref('l10n_ch.l10n_ch_isr_report').render_qweb_pdf([res_id])[0]
|
||||
pdf = base64.b64encode(pdf)
|
||||
|
||||
attachments_list = multi_mode and rslt[res_id]['attachments'] or rslt['attachments']
|
||||
|
||||
@@ -37,14 +37,14 @@
|
||||
<field name="paperformat_id" ref="paperformat_euro_no_margin"/>
|
||||
</record>
|
||||
|
||||
<template id="assets_common" name="l10n_ch_isr_report" inherit_id="report.assets_common">
|
||||
<template id="assets_common" name="l10n_ch_isr_report" inherit_id="web.assets_common">
|
||||
<xpath expr="." position="inside">
|
||||
<link href="/l10n_ch/static/src/less/report_isr.less" rel="stylesheet"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="l10n_ch_isr_report_template">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-set="split_total_amount" t-value="invoice.split_total_amount()"/>
|
||||
<t t-set="print_bank" t-value="invoice.company_id.l10n_ch_isr_print_bank_location"/>
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
</template>
|
||||
|
||||
<template id="l10n_ch.isr_report_main">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="invoice">
|
||||
<t t-call="l10n_ch.l10n_ch_isr_report_template"/>
|
||||
</t>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<template id="report_l10nfrbilan">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2>Bilan</h2>
|
||||
<div class="row mt32 mb32">
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<template id="report_l10nfrresultat">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2>Compte de résultat</h2>
|
||||
<div class="row mt32 mb32">
|
||||
|
||||
@@ -30,9 +30,9 @@ class FichePayeParser(models.AbstractModel):
|
||||
return self.env['hr.payslip.line'].search([('slip_id', '=', obj.id), ('salary_rule_id.parent_rule_id.id', '=', parent_line.salary_rule_id.id)], limit=1)
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
payslip = self.env['hr.payslip'].browse(docids)
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': docids,
|
||||
'doc_model': 'hr.payslip',
|
||||
'data': data,
|
||||
@@ -42,4 +42,3 @@ class FichePayeParser(models.AbstractModel):
|
||||
'get_total_by_rule_category': self.get_total_by_rule_category,
|
||||
'get_employer_line': self.get_employer_line,
|
||||
}
|
||||
return self.env['report'].render('l10n_fr_hr_payroll.report_l10n_fr_fiche_paye', docargs)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_l10n_fr_fiche_paye">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
<div class="row">
|
||||
|
||||
@@ -92,14 +92,14 @@ class ReportHrSalaryEmployeeBymonth(models.AbstractModel):
|
||||
return self.total
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
model = self.env.context.get('active_model')
|
||||
docs = self.env[model].browse(self.env.context.get('active_id'))
|
||||
get_periods, months, total_mnths = self.get_periods(data['form'])
|
||||
get_employee = self.get_employee(data['form'], months, total_mnths)
|
||||
get_months_tol = self.get_months_tol()
|
||||
get_total = self.get_total(get_months_tol)
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': docids,
|
||||
'doc_model': model,
|
||||
'data': data,
|
||||
@@ -110,4 +110,3 @@ class ReportHrSalaryEmployeeBymonth(models.AbstractModel):
|
||||
'get_total': get_total,
|
||||
'month_len': len(total_mnths) + 1
|
||||
}
|
||||
return self.env['report'].render('l10n_in_hr_payroll.report_hrsalarybymonth', docargs)
|
||||
|
||||
@@ -126,10 +126,10 @@ class EmployeesYearlySalaryReport(models.AbstractModel):
|
||||
return self.total
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
model = self.env.context.get('active_model')
|
||||
docs = self.env[model].browse(self.env.context.get('active_id'))
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': docids,
|
||||
'doc_model': model,
|
||||
'data': data,
|
||||
@@ -142,4 +142,3 @@ class EmployeesYearlySalaryReport(models.AbstractModel):
|
||||
'get_allow': self.get_allow,
|
||||
'get_deduct': self.get_deduct,
|
||||
}
|
||||
return self.env['report'].render('l10n_in_hr_payroll.report_hryearlysalary', docargs)
|
||||
|
||||
@@ -46,9 +46,9 @@ class payroll_advice_report(models.AbstractModel):
|
||||
return result
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
advice = self.env['hr.payroll.advice'].browse(docids)
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': docids,
|
||||
'doc_model': 'hr.payroll.advice',
|
||||
'data': data,
|
||||
@@ -59,4 +59,3 @@ class payroll_advice_report(models.AbstractModel):
|
||||
'get_detail': self.get_detail,
|
||||
'get_bysal_total': self.get_bysal_total,
|
||||
}
|
||||
return self.env['report'].render('l10n_in_hr_payroll.report_payrolladvice', docargs)
|
||||
|
||||
@@ -9,13 +9,12 @@ class PayslipDetailsReportIN(models.AbstractModel):
|
||||
_inherit = 'report.hr_payroll.report_payslipdetails'
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
payslips = self.env['hr.payslip'].browse(docids)
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': docids,
|
||||
'doc_model': 'hr.payslip',
|
||||
'docs': payslips,
|
||||
'data': data,
|
||||
'get_details_by_rule_category': self.get_details_by_rule_category(payslips.mapped('details_by_salary_rule_category'))
|
||||
}
|
||||
return self.env['report'].render('l10n_in_hr_payroll.report_payslipdetails', docargs)
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
file="l10n_in_hr_payroll.report_payslipdetails" />
|
||||
|
||||
<report
|
||||
auto="False"
|
||||
id="payroll_advice"
|
||||
id="payroll_advice"
|
||||
model="hr.payroll.advice"
|
||||
string="Print Advice"
|
||||
report_type="qweb-pdf"
|
||||
@@ -18,7 +17,7 @@
|
||||
file="l10n_in_hr_payroll.report_payrolladvice"/>
|
||||
|
||||
<report
|
||||
id="hr_salary_bymonth"
|
||||
id="action_report_hrsalarybymonth"
|
||||
string="Yearly Salary by Head"
|
||||
model="hr.salary.employee.month"
|
||||
report_type="qweb-pdf"
|
||||
@@ -26,8 +25,7 @@
|
||||
name="l10n_in_hr_payroll.report_hrsalarybymonth"/>
|
||||
|
||||
<report
|
||||
auto="False"
|
||||
id="yearly_salary"
|
||||
id="action_report_hryearlysalary"
|
||||
model="yearly.salary.detail"
|
||||
name="l10n_in_hr_payroll.report_hryearlysalary"
|
||||
file="l10n_in_hr_payroll.report_hryearlysalary"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_hrsalarybymonth">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.internal_layout">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<div class="page">
|
||||
<div class="text-center">
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_hryearlysalary">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-foreach="get_employee(data['form'])" t-as="employee">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2><span t-field="employee.company_id"/></h2>
|
||||
<p> From
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_payrolladvice">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<div class="page">
|
||||
<table>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_payslipdetails">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<h2>Pay Slip Details</h2>
|
||||
<p t-field="o.name"/>
|
||||
|
||||
@@ -36,4 +36,4 @@ class HrSalaryEmployeeBymonth(models.TransientModel):
|
||||
res = self.read()
|
||||
res = res and res[0] or {}
|
||||
data.update({'form': res})
|
||||
return self.env['report'].get_action(self, 'l10n_in_hr_payroll.report_hrsalarybymonth', data=data)
|
||||
return self.env.ref('l10n_in_hr_payroll.action_report_hrsalarybymonth').report_action(self, data=data)
|
||||
|
||||
@@ -31,4 +31,4 @@ class YearlySalaryDetail(models.TransientModel):
|
||||
res = self.read()
|
||||
res = res and res[0] or {}
|
||||
data.update({'form': res})
|
||||
return self.env['report'].get_action(self, 'l10n_in_hr_payroll.report_hryearlysalary', data=data)
|
||||
return self.env.ref('l10n_in_hr_payroll.action_report_hryearlysalary').report_action(self, data=data)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
United States - Chart of accounts.
|
||||
==================================
|
||||
""",
|
||||
'depends': ['l10n_generic_coa', 'report'],
|
||||
'depends': ['l10n_generic_coa'],
|
||||
'data': [
|
||||
'data/res_company_data.xml',
|
||||
],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record model="res.company" id="base.main_company">
|
||||
<field name="paperformat_id" ref="report.paperformat_us"/>
|
||||
<field name="paperformat_id" ref="base.paperformat_us"/>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_lunch_order">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
|
||||
|
||||
@@ -509,7 +509,7 @@ class MailTemplate(models.Model):
|
||||
|
||||
if report.report_type not in ['qweb-html', 'qweb-pdf']:
|
||||
raise UserError(_('Unsupported report type %s found.') % report.report_type)
|
||||
result, format = Template.env['report'].get_pdf([res_id], report_service), 'pdf'
|
||||
result, format = report.render_qweb_pdf([res_id])
|
||||
|
||||
# TODO in trunk, change return format to binary to match message_post expected format
|
||||
result = base64.b64encode(result)
|
||||
|
||||
@@ -41,7 +41,7 @@ class MrpBomCost(models.AbstractModel):
|
||||
return product_lines
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
boms = self.env['mrp.bom'].browse(docids)
|
||||
res = self.get_lines(boms)
|
||||
return self.env['report'].render('mrp.mrp_bom_cost_report', {'lines': res})
|
||||
return self.env['ir.actions.report'].render_template('mrp.mrp_bom_cost_report', {'lines': res})
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="mrp_bom_cost_report">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="lines" t-as="line">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<t t-set="currency" t-value="line['currency']"/>
|
||||
<h1><t t-esc="line['name']"/></h1><br/>
|
||||
|
||||
@@ -41,12 +41,11 @@ class BomStructureReport(models.AbstractModel):
|
||||
return children
|
||||
|
||||
@api.multi
|
||||
def render_html(self, docids, data=None):
|
||||
docargs = {
|
||||
def get_report_values(self, docids, data=None):
|
||||
return {
|
||||
'doc_ids': docids,
|
||||
'doc_model': 'mrp.bom',
|
||||
'docs': self.env['mrp.bom'].browse(docids),
|
||||
'get_children': self.get_children,
|
||||
'data': data,
|
||||
}
|
||||
return self.env['report'].render('mrp.mrp_bom_structure_report', docargs)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<template id="mrp_bom_structure_report">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2>BOM Structure</h2>
|
||||
<table class="table table-condensed">
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_mrporder">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
<div class="row">
|
||||
|
||||
@@ -246,7 +246,7 @@ class Repair(models.Model):
|
||||
|
||||
@api.multi
|
||||
def print_repair_order(self):
|
||||
return self.env['report'].get_action(self, 'mrp_repair.report_mrprepairorder')
|
||||
return self.env.ref('mrp_repair.action_report_mrp_repair_order').report_action(self)
|
||||
|
||||
def action_repair_invoice_create(self):
|
||||
self.action_invoice_create()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<data>
|
||||
<template id="report_mrprepairorder">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-set="o" t-value="o.with_context({'lang': o.partner_id.lang})" />
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
@@ -159,7 +159,7 @@
|
||||
</template>
|
||||
|
||||
<template id="report_mrprepairorder2">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<t t-call="mrp_repair.report_mrprepairorder" t-lang="doc.partner_id.lang"/>
|
||||
</t>
|
||||
|
||||
@@ -29,6 +29,6 @@ class PosController(http.Controller):
|
||||
@http.route('/pos/sale_details_report', type='http', auth='user')
|
||||
def print_sale_details(self, date_start=False, date_stop=False, **kw):
|
||||
r = request.env['report.point_of_sale.report_saledetails']
|
||||
pdf = request.env['report'].with_context(date_start=date_start, date_stop=date_stop).get_pdf(r, 'point_of_sale.report_saledetails')
|
||||
pdf = request.env.ref('point_of_sale.sale_details_report').with_context(date_start=date_start, date_stop=date_stop).render_qweb_pdf(r)
|
||||
pdfhttpheaders = [('Content-Type', 'application/pdf'), ('Content-Length', len(pdf))]
|
||||
return request.make_response(pdf, headers=pdfhttpheaders)
|
||||
|
||||
@@ -1002,8 +1002,8 @@ class ReportSaleDetails(models.AbstractModel):
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
data = dict(data or {})
|
||||
configs = self.env['pos.config'].browse(data['config_ids'])
|
||||
data.update(self.get_sale_details(data['date_start'], data['date_stop'], configs))
|
||||
return self.env['report'].render('point_of_sale.report_saledetails', data)
|
||||
return data
|
||||
|
||||
@@ -9,8 +9,7 @@ class PosInvoiceReport(models.AbstractModel):
|
||||
_name = 'report.point_of_sale.report_invoice'
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
Report = self.env['report']
|
||||
def get_report_values(self, docids, data=None):
|
||||
PosOrder = self.env['pos.order']
|
||||
ids_to_print = []
|
||||
invoiced_posorders_ids = []
|
||||
@@ -24,4 +23,4 @@ class PosInvoiceReport(models.AbstractModel):
|
||||
not_invoiced_orders_names = list(map(lambda a: a.name, not_invoiced_posorders))
|
||||
raise UserError(_('No link to an invoice for %s.') % ', '.join(not_invoiced_orders_names))
|
||||
|
||||
return Report.sudo().render('account.report_invoice', {'docs': self.env['account.invoice'].sudo().browse(ids_to_print)})
|
||||
return self.env['ir.actions.report'].sudo().render_template('account.report_invoice', {'docs': self.env['account.invoice'].sudo().browse(ids_to_print)})
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<template id="report_saledetails">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
|
||||
<div class="text-center">
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<template id="report_statement">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2>Statement</h2>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_userlabel">
|
||||
<t t-call="report.basic_layout">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page">
|
||||
<t t-foreach="docs" t-as="user">
|
||||
<div class="col-xs-6 mb92">
|
||||
|
||||
@@ -45,5 +45,4 @@ class PosDetails(models.TransientModel):
|
||||
@api.multi
|
||||
def generate_report(self):
|
||||
data = {'date_start': self.start_date, 'date_stop': self.end_date, 'config_ids': self.pos_config_ids.ids}
|
||||
return self.env['report'].get_action(
|
||||
[], 'point_of_sale.report_saledetails', data=data)
|
||||
return self.env.ref('point_of_sale.sale_details_report').report_action([], data=data)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'name': 'Products & Pricelists',
|
||||
'version': '1.2',
|
||||
'category': 'Sales',
|
||||
'depends': ['base', 'decimal_precision', 'mail', 'report'],
|
||||
'depends': ['base', 'decimal_precision', 'mail'],
|
||||
'description': """
|
||||
This is the base module for managing products and pricelists in Odoo.
|
||||
========================================================================
|
||||
|
||||
@@ -9,12 +9,12 @@ class report_product_pricelist(models.AbstractModel):
|
||||
_name = 'report.product.report_pricelist'
|
||||
|
||||
@api.model
|
||||
def render_html(self, docids, data=None):
|
||||
def get_report_values(self, docids, data=None):
|
||||
data = data if data is not None else {}
|
||||
pricelist = self.env['product.pricelist'].browse(data.get('form', {}).get('price_list', False))
|
||||
products = self.env['product.product'].browse(data.get('ids', data.get('active_ids')))
|
||||
quantities = self._get_quantity(data)
|
||||
docargs = {
|
||||
return {
|
||||
'doc_ids': data.get('ids', data.get('active_ids')),
|
||||
'doc_model': 'hr.contribution.register',
|
||||
'docs': products,
|
||||
@@ -25,7 +25,6 @@ class report_product_pricelist(models.AbstractModel):
|
||||
categories_data=self._get_categories(pricelist, products, quantities)
|
||||
),
|
||||
}
|
||||
return self.env['report'].render('product.report_pricelist', docargs)
|
||||
|
||||
def _get_quantity(self, data):
|
||||
return sorted([data['form'][key] for key in data['form'].keys() if key.startswith('qty') and data['form'][key]])
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_pricelist">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.internal_layout">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2>Price List</h2>
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</template>
|
||||
|
||||
<template id="report_productlabel">
|
||||
<t t-call="report.basic_layout">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page">
|
||||
<t t-foreach="docs" t-as="product">
|
||||
<t t-call="product.report_simple_label">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_producttemplatelabel">
|
||||
<t t-call="report.basic_layout">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page">
|
||||
<t t-foreach="docs" t-as="template">
|
||||
<t t-foreach="template.product_variant_ids" t-as="product">
|
||||
|
||||
@@ -26,4 +26,4 @@ class product_price_list(models.TransientModel):
|
||||
res = res and res[0] or {}
|
||||
res['price_list'] = res['price_list'][0]
|
||||
datas['form'] = res
|
||||
return self.env['report'].get_action([], 'product.report_pricelist', data=datas)
|
||||
return self.env.ref('product.action_report_pricelist').report_action([], data=datas)
|
||||
|
||||
@@ -25,7 +25,7 @@ Dashboard / Reports for Purchase Management will include:
|
||||
* Purchase Analysis
|
||||
""",
|
||||
'website': 'https://www.odoo.com/page/purchase',
|
||||
'depends': ['stock_account', 'report'],
|
||||
'depends': ['stock_account'],
|
||||
'data': [
|
||||
'security/purchase_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
|
||||
@@ -307,7 +307,7 @@ class PurchaseOrder(models.Model):
|
||||
|
||||
@api.multi
|
||||
def print_quotation(self):
|
||||
return self.env['report'].get_action(self, 'purchase.report_purchasequotation')
|
||||
return self.env.ref('purchase.report_purchase_quotation').report_action(self)
|
||||
|
||||
@api.multi
|
||||
def button_approve(self, force=False):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_purchaseorder_document">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/>
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
@@ -116,7 +116,7 @@
|
||||
</template>
|
||||
|
||||
<template id="report_purchaseorder">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="purchase.report_purchaseorder_document" t-lang="o.partner_id.lang"/>
|
||||
</t>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_purchasequotation_document">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/>
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
@@ -60,7 +60,7 @@
|
||||
</template>
|
||||
|
||||
<template id="report_purchasequotation">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="purchase.report_purchasequotation_document" t-lang="o.partner_id.lang"/>
|
||||
</t>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<template id="report_purchaserequisitions">
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.external_layout">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import controllers
|
||||
from . import models
|
||||
from . import tests
|
||||
@@ -1,28 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
{
|
||||
'name': 'Report',
|
||||
'category': 'Base',
|
||||
'summary': 'Hidden',
|
||||
'description': """
|
||||
Report
|
||||
""",
|
||||
'depends': ['base', 'web', 'base_setup'],
|
||||
'demo': [
|
||||
'data/report_demo.xml',
|
||||
],
|
||||
'data': [
|
||||
'data/report_paperformat_data.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/report_paperformat_views.xml',
|
||||
'views/base_config_settings_views.xml',
|
||||
'views/ir_actions_report_views.xml',
|
||||
'views/res_company_view.xml',
|
||||
'views/templates.xml',
|
||||
],
|
||||
'qweb': [
|
||||
'static/src/xml/*.xml',
|
||||
],
|
||||
'auto_install': True,
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user