Commit Graph

222 Commits

Author SHA1 Message Date
Harald Welte 768d0fb9d3 barcode controller: Remove quiescence zone left and right
When creating reports with barcode labels, there is simply no space
for excessive quiescence zones.  Let's give control of layout to the
report template, not to the barcode renderer.
2017-11-30 08:32:29 +01:00
Odoo Translation Bot 8a187c5b1d [I18N] Update translation terms from Transifex 2017-09-26 11:47:00 +02:00
Odoo Translation Bot 058b9cbb10 [I18N] Update translation terms from Transifex 2017-06-01 02:40:07 +02:00
Olivier Dony e0014387c5
[FIX] report: always close pdf files after merge
If an exception during the merges (such as a file descriptor overrun), we
would otherwise depend on the next garbage collection to close the
files. But the next GC may never come.

For example if we ran out of OS file descriptors during merge, all future
requests will crash for the same reason, and the process will never recover
because the GC will never run.

Much easier to explicitly close the files all the time.
2017-05-11 09:01:12 +02:00
Odoo Translation Bot a09e4aa7aa [I18N] Update translation terms from Transifex 2017-03-19 02:55:34 +01:00
Odoo Translation Bot 333e7d1f9e [I18N] Update translation terms from Transifex 2017-02-26 02:55:24 +01:00
Odoo Translation Bot 8ce1e51340 [I18N] Update translation terms from Transifex 2017-02-05 02:54:43 +01:00
Odoo Translation Bot 66e2ddd670 [I18N] Update translation terms from Transifex 2017-01-29 02:55:31 +01:00
Odoo Translation Bot c150838bb5 [I18N] Update translation terms from Transifex 2017-01-19 17:28:33 +01:00
Odoo Translation Bot 082495240f [I18N] Update translation terms from Transifex 2017-01-15 02:55:40 +01:00
Odoo Translation Bot 2b8fcfc08b [I18N] Update translation terms from Transifex 2017-01-01 02:58:08 +01:00
Odoo Translation Bot 4227082869 [I18N] Update translation terms from Transifex 2016-12-18 02:58:16 +01:00
Odoo Translation Bot efdeb6779f [I18N] Update translation terms from Transifex 2016-12-04 02:57:30 +01:00
Odoo Translation Bot f9f562339f [I18N] Update translation terms from Transifex 2016-11-20 02:58:43 +01:00
Odoo Translation Bot c340284a60 [I18N] Update translation terms from Transifex 2016-10-30 02:56:40 +02:00
Odoo Translation Bot d3c4ab23e4 [I18N] Update translation terms from Transifex 2016-10-09 02:56:21 +02:00
Odoo Translation Bot ca18a1699c [I18N] Update translation terms from Transifex 2016-10-02 02:57:59 +02:00
Odoo Translation Bot 6a1ecef775 [I18N] Update translation terms from Transifex 2016-09-18 03:05:57 +02:00
Odoo Translation Bot 40691d31f3 [I18N] Update translation terms from Transifex 2016-09-11 03:04:01 +02:00
Odoo Translation Bot 75a196972e [I18N] Update translation terms from Transifex 2016-09-04 03:06:55 +02:00
Odoo Translation Bot 0606247a8b [I18N] Update translation terms from Transifex 2016-08-07 03:07:40 +02:00
Odoo Translation Bot 337049baa8 [I18N] Update translation terms from Transifex 2016-07-31 03:07:08 +02:00
Odoo Translation Bot c3dd308913 [I18N] Update translation terms from Transifex 2016-07-19 12:10:41 +02:00
Odoo Translation Bot ef83f798d5 [I18N] Update translation terms from Transifex 2016-07-10 03:01:32 +02:00
Odoo Translation Bot 3e965ecf58 [I18N] Update translation terms from Transifex 2016-06-26 02:57:50 +02:00
Odoo Translation Bot cd369396d9 [I18N] Update translation terms from Transifex 2016-06-19 02:59:13 +02:00
Odoo Translation Bot 3215a81bab [I18N] Update translation terms from Transifex 2016-06-12 03:06:37 +02:00
Odoo Translation Bot 95c9036aef [I18N] Update translation terms from Transifex 2016-05-22 02:57:09 +02:00
Odoo Translation Bot 8f46a6fe73 [I18N] Update translation terms from Transifex 2016-05-15 02:56:59 +02:00
Odoo Translation Bot 859fe655d2 [I18N] Update translation terms from Transifex 2016-05-08 02:57:57 +02:00
Odoo Translation Bot 8651d0815d [I18N] Update translation terms from Transifex 2016-05-01 02:57:51 +02:00
Odoo Translation Bot 0410d1187b [I18N] Update translation terms from Transifex 2016-04-24 02:59:16 +02:00
Odoo Translation Bot 05223f558d [I18N] Update translation terms from Transifex 2016-04-10 02:59:08 +02:00
Odoo Translation Bot 678a84e626 [I18N] Update translation terms from Transifex 2016-04-03 02:59:02 +02:00
Odoo Translation Bot f5cc04caa7 [I18N] Update translation terms from Transifex 2016-03-20 02:58:59 +01:00
Odoo Translation Bot 345c83a9d0 [I18N] Update translation terms from Transifex 2016-03-13 02:59:06 +01:00
Denis Ledoux 14282f1659 [FIX] report, website_report: barcode widget
Up to this revision, barcodes set in reports are generated
using the controller `/report/barcode`,
using a `img` HTML tag, e.g. (from `report_location_barcode`)
```
<img t-if="not o.loc_barcode"
     t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s'
     % ('Code128', o.name, 600, 100)" style="width:300px;height:50px"/>
``

This `/report/barcode` route is set as `auth='user'`, meaning
the route can only be accessed by signed in users.

When wkhtmltopdf prints a report containing such a barcode,
it calls this `report/barcode` route, making sure to pass
the request session in the cookies, so wkhtmltopdf
uses the same session than the one of the user. This is
needed, as only users can access this `report/barcode/` route.

This session is passed in `report.py`, in the method
`_run_wkhtmltopdf`, thanks to the --cookie wkhtmltopdf
parameter.

Nevertheless, if a report is printed through the website
front-end, as public (without a signed in user), the request
session is not associated to a signed in user, and therefore
the route `/report/barcode` refuses the access / redirects
to the login, making it impossible to print a report
containing a barcode without being signed in. This even
if the report is printed as `sudo` through a controller
(as this is the session of the not signed in user which is passed,
not a session associated to `sudo).

Fixes #10621
opw-667797
2016-03-03 13:51:44 +01:00
Denis Ledoux 13f1426bf5 [FIX] report: UPC-A barcodes drawing
It looks like reportlab doesn't handle well
UPC-A barcodes.

As UPC-A barcodes became EAN13 barcodes when
adding a `0` to the beginning of the barcode,
and the render is the same, we ask reportlab
a EAN13 barcode type when a UPC-A barcode is asked,
making sure to add the `0` automatically first.

From Wikipedia:
```
The EAN was developed as a superset of UPC,
adding an extra digit to the beginning of every UPC number.
[...]
the original rules for UPC are treated as a '0'
if read as EAN-13.
A UPC barcode XXXXXXXXXXXX therefore is the EAN-13 barcode 0XXXXXXXXXXXX.
It is possible to prefix a UPC barcode with a 0;
they become EAN-13 rather than UPC-A.
This does not change the check digit.
All point-of-sale systems can now understand both equally.
```
opw-670560
2016-03-03 11:08:36 +01:00
Odoo Translation Bot 9f073102ef [I18N] Update translation terms from Transifex 2016-02-28 03:00:41 +01:00
Odoo Translation Bot 488c693109 [I18N] Update translation terms from Transifex 2016-02-21 02:59:19 +01:00
Odoo Translation Bot f35fd798f1 [I18N] Update translation terms from Transifex 2016-02-14 02:59:46 +01:00
Raphael Collet 5763c32a6d [FIX] addons: fix usage of decorators `api.v7`/`api.v8`
Specifically, when one API implementation calls the other one, it has to call
the method *from the same class*.  Otherwise, overriding the method may result
in an infinite recursion.  Consider:

    class A(Model):
        _name = 'stuff'

        @api.v8
        def foo(self):
            return 42

        @api.v7
        def foo(self, cr, uid, context=None):
            return self.browse(cr, uid, [], context).foo()

    class B(Model):
        _inherit = 'stuff'

        def foo(self, cr, uid, context=None):
            return super(B, self).foo(cr, uid, context=context) + 1

and now call: `env['stuff'].foo()`.  This invokes `B.foo` (new-API), which
calls `B.foo` (old-API), which calls `A.foo` (old-API), which calls `B.foo`
(new-API) instead of `A.foo`!

This issue would not be present if old-API `A.foo` was defined as:

        @api.v7
        def foo(self, cr, uid, context=None):
            return A.foo(self.browse(cr, uid, [], context))
2016-02-09 10:01:43 +01:00
Odoo Translation Bot 3ff4dae5b0 [I18N] Update translation terms from Transifex 2016-02-07 02:58:52 +01:00
Odoo Translation Bot dc48744bf7 [I18N] Update translation terms from Transifex 2016-01-24 03:00:37 +01:00
Odoo Translation Bot 2efa359e41 [I18N] Update translation terms from Transifex 2016-01-17 03:01:54 +01:00
Odoo Translation Bot 8000181772 [I18N] Update translation terms from Transifex 2016-01-03 02:54:27 +01:00
Odoo Translation Bot 8fe876cae7 [I18N] Update translation terms from Transifex 2015-12-27 02:54:48 +01:00
Odoo Translation Bot 0093372184 [I18N] Update translation terms from Transifex 2015-12-20 02:54:53 +01:00
Odoo Translation Bot 63414bef54 [I18N] Update translation terms from Transifex 2015-12-13 02:56:20 +01:00
Odoo Translation Bot 0de99dd2c8 [I18N] Update translation terms from Transifex 2015-12-06 02:56:34 +01:00