@@ -213,6 +213,8 @@ function install_wkhtmltopdf {
213
213
read -ra wkhtmltox_deps < <( dpkg -f " $wkhtmltox_path " Depends | sed -r ' s/,//g' ) ;
214
214
if ! (install_sys_deps_internal " ${wkhtmltox_deps[@]} " && with_sudo dpkg -i " $wkhtmltox_path " ); then
215
215
echoe -e " ${REDC} ERROR:${NC} Error caught while installing ${BLUEC} wkhtmltopdf${NC} ." ;
216
+ rm " $wkhtmltox_path " || true ; # try to remove downloaded file, ignore errors
217
+ return 2;
216
218
fi
217
219
218
220
rm " $wkhtmltox_path " || true ; # try to remove downloaded file, ignore errors
@@ -402,6 +404,12 @@ function install_sys_deps_for_odoo_version {
402
404
return 1;
403
405
fi
404
406
407
+ local odoo_major_version=" ${odoo_version% .* } " ;
408
+ if [ " $odoo_major_version " -lt 11 ]; then
409
+ # We have to install python2 support for odoo versions less than 11.0
410
+ install_python2_support;
411
+ fi
412
+
405
413
odoo_branch=${odoo_branch:- $odoo_version } ;
406
414
local control_url=" https://raw.githubusercontent.com/odoo/odoo/$odoo_branch /debian/control" ;
407
415
local tmp_control;
@@ -588,6 +596,17 @@ function install_and_configure_postgresql {
588
596
}
589
597
590
598
599
+ function install_python2_support {
600
+ echo -e " ${BLUEC} Installing python2 dependencies (to support odoo 10 and below)...${NC} " ;
601
+ if ! install_sys_deps_internal python2-dev python2-pip-whl; then
602
+ echo -e " ${YELLOWC} WARNING${NC} : It seems that it is too old version of OS, trying old version of python2 support..." ;
603
+ if ! install_sys_deps_internal python-dev; then
604
+ echo -e " ${YELLOWC} WARNING${NC} : Cannot install python2 support... skipping..." ;
605
+ fi
606
+ fi
607
+ }
608
+
609
+
591
610
# install_system_prerequirements
592
611
function install_system_prerequirements {
593
612
local usage="
@@ -634,15 +653,9 @@ function install_system_prerequirements {
634
653
libsasl2-dev libldap2-dev libssl-dev libffi-dev fontconfig \
635
654
libmagic1 python3-virtualenv;
636
655
637
- echo -e " ${BLUEC} Installing python2 dependencies (to support odoo 10 and below)...${NC} " ;
638
- if ! install_sys_deps_internal python2-dev python2-pip-whl; then
639
- echo -e " ${YELLOWC} WARNING${NC} : It seems that it is too old version of OS, trying old version of python2 support..." ;
640
- if ! install_sys_deps_internal python-dev; then
641
- echo -e " ${YELLOWC} WARNING${NC} : Cannot install python2 support... skipping..." ;
642
- fi
643
- fi
644
656
if ! install_wkhtmltopdf; then
645
657
echoe -e " ${YELLOWC} WARNING:${NC} Cannot install ${BLUEC} wkhtmltopdf${NC} !!! Skipping..." ;
658
+ echoe -e " ${LBLUEC} HINT:${NC} If your system has wkhtmltopdf>=0.12.5 then try to install system package." ;
646
659
fi
647
660
}
648
661
0 commit comments