Comments (3)
Hello,
I guess that is a change in version 2.7.0 we should change the type of
columns to int.
Regards
Nicolas
2015-01-15 16:09 GMT+01:00 Alex Comba [email protected]:
Impacted versions:
Steps to reproduce:
- install module 'l10n_ch_payment_slip from
https://github.com/nbessi/l10n-switzerland/tree/new_payment_slip- set BVR data for the company
- create a new customer invoice
- print the 'Payment Slip' report
Current behavior:
This is the Traceback I got:
Traceback (most recent call last):
File "/home/tafaru/dev/envs/buildout/customer/parts/odoo/addons/report/controllers/main.py", line 118, in report_download
response = self.report_routes(reportname, docids=docids, converter='pdf')
File "/home/tafaru/dev/envs/buildout/customer/parts/odoo/openerp/http.py", line 388, in response_wrap
response = f(_args, *_kw)
File "/home/tafaru/dev/envs/buildout/customer/parts/odoo/addons/report/controllers/main.py", line 65, in report_routes
pdf = report_obj.get_pdf(cr, uid, docids, reportname, data=options_data, context=context)
File "/home/tafaru/dev/envs/buildout/customer/parts/odoo/openerp/api.py", line 237, in wrapper
return old_api(self, _args, *_kwargs)
File "/home/tafaru/dev/envs/buildout/customer/parts/new_payment_slip/l10n_ch_payment_slip/report/payment_slip_from_invoice.py", line 50, in get_pdf
out_format='PDF')
File "/home/tafaru/dev/envs/buildout/customer/parts/new_payment_slip/l10n_ch_payment_slip/payment_slip.py", line 592, in _draw_payment_slip
scan_font = self._get_scan_line_text_font(company)
File "/home/tafaru/dev/envs/buildout/customer/parts/odoo/openerp/api.py", line 235, in wrapper
return new_api(self, _args, *_kwargs)
File "/home/tafaru/dev/envs/buildout/customer/parts/new_payment_slip/l10n_ch_payment_slip/payment_slip.py", line 399, in _get_scan_line_text_font
company.bvr_scan_line_font_size or self._default_scan_font_size
File "/home/tafaru/dev/envs/buildout/customer/eggs/Pillow-2.5.1-py2.7-linux-x86_64.egg/PIL/ImageFont.py", line 228, in truetype
return FreeTypeFont(font, size, index, encoding)
File "/home/tafaru/dev/envs/buildout/customer/eggs/Pillow-2.5.1-py2.7-linux-x86_64.egg/PIL/ImageFont.py", line 131, in init
self.font = core.getfont(font, size, index, encoding)
TypeError: integer argument expected, got floatCasting company.bvr_scan_line_font_size to int seems to fix it.
But it sounds a bit strange
https://pillow.readthedocs.org/reference/ImageFont.html doesn't manage
size value as float.Any feedback will be appreciated.
Thank you in advance.
—
Reply to this email directly or view it on GitHub
#80.
Nicolas Bessi
Senior ERP consultant
Business Solution technical manager
Camptocamp SA
PSE A
CH-1015 Lausanne
Direct: +41 21 619 10 26
Office: +41 21 619 10 10
from l10n-switzerland.
Hello @nbessi,
thanks a lot for your quick reply.
I updated pillow version to 2.7.0 but the error is always the same. This is the Traceback I got:
Traceback (most recent call last):
File "/home/tafaru/dev/envs/buildout/customer/parts/odoo/addons/report/controllers/main.py", line 118, in report_download
response = self.report_routes(reportname, docids=docids, converter='pdf')
File "/home/tafaru/dev/envs/buildout/customer/parts/odoo/openerp/http.py", line 388, in response_wrap
response = f(*args, **kw)
File "/home/tafaru/dev/envs/buildout/customer/parts/odoo/addons/report/controllers/main.py", line 65, in report_routes
pdf = report_obj.get_pdf(cr, uid, docids, reportname, data=options_data, context=context)
File "/home/tafaru/dev/envs/buildout/customer/parts/odoo/openerp/api.py", line 237, in wrapper
return old_api(self, *args, **kwargs)
File "/home/tafaru/dev/envs/buildout/customer/parts/new_payment_slip/l10n_ch_payment_slip/report/payment_slip_from_invoice.py", line 50, in get_pdf
out_format='PDF')
File "/home/tafaru/dev/envs/buildout/customer/parts/new_payment_slip/l10n_ch_payment_slip/payment_slip.py", line 592, in _draw_payment_slip
scan_font = self._get_scan_line_text_font(company)
File "/home/tafaru/dev/envs/buildout/customer/parts/odoo/openerp/api.py", line 235, in wrapper
return new_api(self, *args, **kwargs)
File "/home/tafaru/dev/envs/buildout/customer/parts/new_payment_slip/l10n_ch_payment_slip/payment_slip.py", line 399, in _get_scan_line_text_font
company.bvr_scan_line_font_size or self._default_scan_font_size
File "/home/tafaru/dev/envs/buildout/customer/eggs/Pillow-2.7.0-py2.7-linux-x86_64.egg/PIL/ImageFont.py", line 240, in truetype
return FreeTypeFont(font, size, index, encoding)
File "/home/tafaru/dev/envs/buildout/customer/eggs/Pillow-2.7.0-py2.7-linux-x86_64.egg/PIL/ImageFont.py", line 137, in __init__
self.font = core.getfont(font, size, index, encoding)
TypeError: integer argument expected, got float
In addition, here https://github.com/python-pillow/Pillow/blob/master/PIL/ImageFont.py#L220 is written
:param size: The requested size, in points.
we should change the type of columns to int.
Let me know if I can create a PR that goes in this direction.
Thank you in advance.
from l10n-switzerland.
Please proceed forward.
Thanks Nicolas
Nicolas
from l10n-switzerland.
Related Issues (20)
- [11.0] broken fr.po HOT 3
- [10.0] Cannot compute the Payment Information Identification HOT 2
- l10n_ch_zip obsolete? HOT 2
- [12.0] SEPA Credit Transfer <PstCd> and <TwnNm> are not compatible with swiss banks HOT 6
- Allow duplicate account-Nr for Swiss payment-slip? HOT 6
- Migration to version 13.0 HOT 7
- Migrating Module 'l10n_ch_bank', 'l10n_ch_pain_credit_transfer', 'l10n_ch_payment_slip' HOT 1
- l10n_ch_base_bank should not depend on l10n_ch HOT 6
- Docstring of PaymentSlip._compute_payment_slip_image() is confusing HOT 1
- Add a way to re-use payment slip on a Qweb report HOT 3
- [11] align l10n_ch_payment_slip 11 on 12 HOT 3
- [11] remaining amount not write on ISR HOT 2
- Migration to version 14.0 HOT 13
- Migration to version 15.0 HOT 4
- l10n_ch_base_bank: Bank account type "qr-iban" does not exist HOT 1
- Backport of QR-Iban related module feature HOT 2
- Migration to version 16.0 HOT 7
- PDF creation very, but very slow HOT 1
- Migration to version 17.0 HOT 1
- can't configure postfinance ebill HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from l10n-switzerland.