Commit b923a48 1 parent 69e207d commit b923a48 Copy full SHA for b923a48
File tree 4 files changed +35
-18
lines changed
4 files changed +35
-18
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ registry
10
10
let url = `/report/py3o/${ action . report_name } ` ;
11
11
const actionContext = action . context || { } ;
12
12
if (
13
- action . data === "undefined" ||
14
- action . data == null ||
15
- ( _typeof ( action . data ) === ' object' && action . data !== null )
13
+ typeof action . data === "undefined" ||
14
+ action . data === null ||
15
+ typeof action . data === " object"
16
16
) {
17
17
// Build a query string with `action.data` (it's the place where reports
18
18
// using a wizard to customize the output traditionally put their options)
Original file line number Diff line number Diff line change 5
5
import logging
6
6
import os
7
7
import shutil
8
+ import sys
8
9
import tempfile
9
10
from base64 import b64decode , b64encode
10
11
from contextlib import contextmanager
11
12
from unittest import mock
12
- from packaging import version
13
- import sys
14
-
15
- # Ensuring compatibility with PyPDF2 versions depending on the Python version
16
- PYTHON_VERSION = version .parse (sys .version )
17
-
18
- # Conditional import based on Python version
19
- if PYTHON_VERSION <= version .parse ("3.10" ):
20
- from PyPDF2 .pdf import PageObject
21
- else :
22
- from PyPDF2 import PageObject
23
13
14
+ import pkg_resources
15
+ from packaging import version
16
+ from PyPDF2 import PdfFileWriter
24
17
25
18
from odoo import tools
26
19
from odoo .exceptions import ValidationError
39
32
except ImportError :
40
33
logger .debug ("Cannot import genshi.core" )
41
34
35
+ # Ensuring compatibility with PyPDF2 versions depending on the Python version
36
+ PYTHON_VERSION = version .parse (sys .version )
37
+
38
+ # Conditional import based on Python version
39
+ if PYTHON_VERSION <= version .parse ("3.10" ):
40
+ from PyPDF2 .pdf import PageObject
41
+ else :
42
+ from PyPDF2 import PageObject
43
+
42
44
43
45
@contextmanager
44
46
def temporary_copy (path ):
Original file line number Diff line number Diff line change 8
8
<field name =" arch" type =" xml" >
9
9
<xpath expr =" /form/field[1]" position =" before" >
10
10
<field name =" is_py3o_report_not_available" invisible =" 1" />
11
- <div class =" alert alert-danger" role =" alert" style =" margin-bottom:0px;" invisible =" is_py3o_report_not_available == False" >
11
+ <div
12
+ class =" alert alert-danger"
13
+ role =" alert"
14
+ style =" margin-bottom:0px;"
15
+ invisible =" is_py3o_report_not_available == False"
16
+ >
12
17
<field name =" msg_py3o_report_not_available" />
13
18
</div >
14
19
</xpath >
15
20
<xpath expr =" //page[@name='security']" position =" before" >
16
- <page string =" LibreOffice Template" name =" py3o_tab" invisible =" report_type != 'py3o'" >
21
+ <page
22
+ string =" LibreOffice Template"
23
+ name =" py3o_tab"
24
+ invisible =" report_type != 'py3o'"
25
+ >
17
26
<group name =" py3o_params" >
18
27
<field name =" lo_bin_path" />
19
28
<field name =" py3o_filetype" />
32
41
<field name =" inherit_id" ref =" base.act_report_xml_search_view" />
33
42
<field name =" arch" type =" xml" >
34
43
<field name =" model" position =" after" >
35
- <field name =" report_type" invisible =" 1" />
36
- <filter name =" py3o" string =" Py3o Reports" domain =" [('report_type', '=', 'py3o')]" />
44
+ <field name =" report_type" invisible =" 1" />
45
+ <filter
46
+ name =" py3o"
47
+ string =" Py3o Reports"
48
+ domain =" [('report_type', '=', 'py3o')]"
49
+ />
37
50
</field >
38
51
</field >
39
52
</record >
Original file line number Diff line number Diff line change 1
1
# generated from manifests external_dependencies
2
2
lxml
3
+ py3o.formats
4
+ py3o.template
3
5
xlrd
4
6
xlsxwriter
You can’t perform that action at this time.
0 commit comments