-
Notifications
You must be signed in to change notification settings - Fork 25
/
report.xml
53 lines (44 loc) · 2.29 KB
/
report.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <[email protected]>
The licence is in the file __manifest__.py
-->
<odoo>
<report id="report_account_check_deposit"
model="account.check.deposit"
string="Check Deposit"
report_type="qweb-pdf"
name="account_check_deposit.report_checkdeposit"
file="account_check_deposit.report_checkdeposit"
print_report_name="'check_deposit-%s%s' % (object.name, object.state == 'draft' and '-draft' or '')"
print_report_name="(object._get_report_base_filename())"
/>
<!-- v14+ -->
<record id="report_account_check_deposit" model="ir.actions.report">
<field name="name">Check Deposit</field>
<field name="model">account.check.deposit</field>
<field name="report_type">qweb-pdf</field> <!-- qweb-html or qweb-text -->
<field name="report_name">account_check_deposit.report_checkdeposit</field>
<field name="report_file">account_check_deposit.report_checkdeposit</field>
<!-- "print_report_name" only works in form view, not in tree view -->
<field name="print_report_name">'check_deposit-%s%s' % (object.name, object.state == 'draft' and '-draft' or '')</field>
<field name="binding_model_id" ref="model_account_check_deposit" />
<field name="binding_type">report</field> <!-- default value -->
</record>
<!-- v14+ XLSX -->
<record id="pos_details_xlsx_report" model="ir.actions.report">
<field name="name">Rapport PdV</field>
<field name="model">pos.details.wizard</field>
<field name="report_type">xlsx</field>
<field name="report_name">barroux_base.report_saledetails_xlsx</field> <!-- module name.code -->
<field name="report_file">barroux_base.report_saledetails_xlsx</field> <!-- identique à report_name -->
</record>
class PosDetailsSessionXlsx(models.AbstractModel):
_name = "report.barroux_base.report_saledetails_xlsx" # = 'report.' + champ report_name
_inherit = "report.report_xlsx.abstract"
_description = "POS details Session XLSX"
def generate_xlsx_report(self, workbook, data, objects):
# for some strange reasons, lang is not kept in context
self = self.with_context(lang=self.env.user.lang)
</odoo>