Commit Graph
396 Commits
Author SHA1 Message Date
Christophe Simonis 05e0bf3f1b [MERGE] forward port of branch saas-11 up to e7190cb 2016-07-06 00:03:49 +02:00
Christophe Simonis e7190cbbbf [MERGE] forward port of branch saas-10 up to 74b51d3 2016-07-05 23:42:12 +02:00
Christophe Simonis 74b51d3d97 [MERGE] forward port of branch 9.0 up to 489ea42 2016-07-05 23:19:50 +02:00
Christophe Matthieu 032122484e [TYPO] qweb: use the same option attribute for t-esc t-raw and t-field
t-options instead of t-field-options
2016-07-05 18:44:58 +02:00
Christophe Matthieu 3407fb70e4 [IMP] qweb: add t-options on t-esc and t-raw who use 'ir.qweb.field' models
Remove 'field' from 'value_to_html' method attributes
't-esc' escape the result of the widget.
(Added 'remove_span' as option for monetary widget)

E.g.: <t t-esc="32" t-options='t-options='{"widget": "monetary", "display_currency": website.currency_id, "remove_span": True}'>
result: $ 365.00
2016-07-05 18:43:09 +02:00
Simon Lejeune 95a391f815 [FIX] report: more precise routes in the controller
ie, make `converter` argument not a path but a string. Converter
in our codebase are one-word string anyway (html, pdf).

This is done because a less asset in the report module is not reachable
in debug mode (it is a fake file that is reachable by a fallback in the
http dispatching and the fallback is not done because the `/report/converter
` matched the route of the fake file).
2016-07-05 17:48:32 +02:00
Simon Lejeune b7de723b8c [ADD] report: improve client action to allow sending do_action commands 2016-07-05 17:44:56 +02:00
Simon Lejeune 752cd0a482 [REF] report: replace the popup with an iframe in a client action
This change concerns reports of `qweb-html` type. Previously, they were
openned in a popup and it was not very practical. We chose to open these
reports in an iframe (as opposed to what's done in `account_report`) in
order to be the most close to the pdf version in terms of apperance.

The client action allows an integration with the control panel. Apart from
the breadcrumbs integration, we also add buttons to handle the web_editor
(save, discard, etc). We also add a button to print the pdf version.

As there is some security concern to communicate with an iframe, we use
the postMessage[1] technology and we fix the `targetOrigin` to the
`web.base.url` parameter, that means that if the window to which we send
the message does not match the `web.base.url` origin, the event is not
even dispatched.

In order to to that, the report module uses the ir_http `session_info`
override mechanism to add the `web.base.url` in the DOM of the webclient,
 and the report module adds to the DOM of report the `web.base.url`
content. This way, both scripts (in the webclient and in the iframe)
have the information of the trusted origin.

The client action does not have a complicated logic: it opens the
report's url in an iframe to show the report or open the web_editor
(the editor is activated by using the `enable_editor` query string.
If you click on the control panel button (save/discard) it'll send
message to the web_editor in the iframe to ask for save and discard.
It also waits for messages to know if the edition is done / cancelled
and toggle buttons of the control panel accordingly.

To allow that, we override the web_editor mechanism if it's opened in
an iframe and we chain to the `save` and `cancel` method deferred that
send message to the client action's window. We also make the web_editor
waits for message to start and stop the edition (controlled by the
control panel buttons).

The override of the action manager has been refactored / improved in
order to open the clien action and not the popup anymore. This way
we are able to, in the client action, return the current action with
the type `qweb-pdf` and the report is downloaded.

[1] https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
2016-07-05 17:44:56 +02:00
Christophe Simonis 5a3a06f26f [MERGE] forward port of branch saas-11 up to d4d09df 2016-07-04 13:16:34 +02:00
Odoo Translation Bot e349692ede [I18N] Update translation terms from Transifex 2016-07-03 00:32:09 +02:00
Olivier Dony d4d09df143 [MERGE] Forward-port saas-10 up to f76f4cd0b6 2016-07-01 20:14:28 +02:00
Olivier Dony f76f4cd0b6 [MERGE] Forward-port 9.0 up to 7f2e748a22 2016-07-01 18:36:24 +02:00
Yannick Tivisse 692d41c686 [IMP] Classified each module in its category to display them correctly on odoo/apps
To be displayed correctly on odoo app (In a given category and not only in all or hidden)
the module category in the __openerp__.py file should be one of these:

    "Accounting",
    "Discuss",
    "Document Management",
    "eCommerce",
    "Human Resources",
    "Industries",
    "Localization",
    "Manufacturing",
    "Marketing",
    "Point of Sale",
    "Productivity",
    "Project",
    "Purchases",
    "Sales",
    "Warehouse",
    "Website",
    "Extra Tools",

'Accounting & Finance' will not work, as 'Project Management', ...
2016-06-30 13:27:46 +02:00
Christophe Simonis 93e6316029 [MERGE] forward port of branch saas-11 up to 7153077 2016-06-28 18:05:25 +02:00
Christophe Simonis 5166fbd21b [MERGE] forward port of branch saas-10 up to 6d51bce 2016-06-28 15:12:06 +02:00
Christophe Simonis 841aa4e208 [MERGE] forward port of branch 9.0 up to 3e15b86 2016-06-28 14:10:35 +02:00
Odoo Translation Bot d14efd562b [I18N] Update translation terms from Transifex 2016-06-22 21:14:56 +02:00
Christophe Simonis 9fe4cf5f72 [MERGE] forward port of branch saas-11 up to dda0d3d
# Conflicts:
#	addons/product_uos/i18n/lo.po
#	addons/sales_team/models/__init__.py
#	addons/website_payment/views/website_payment_templates.xml
#	addons/website_portal_sale/views/templates.xml
#	openerp/addons/base/ir/ir_qweb.py
2016-06-15 13:10:45 +02:00
Christophe Simonis dda0d3d62d [MERGE] forward port of branch saas-10 up to baf494c
# Conflicts:
#	addons/hr_timesheet/project_timesheet.py
#	addons/sale_layout/i18n/es_PE.po
#	addons/sale_layout/i18n/hu.po
#	addons/sale_layout/i18n/lo.po
#	addons/sale_layout/i18n/pl.po
#	addons/sale_service/i18n/es_MX.po
#	addons/sale_service/i18n/es_PE.po
#	addons/sale_service/i18n/lo.po
#	addons/stock/stock.py
#	addons/stock/stock_view.xml
#	addons/warning/i18n/es_PE.po
#	addons/warning/i18n/lo.po
#	addons/warning/i18n/ru.po
#	addons/web/i18n/cs.po
#	addons/web/i18n/ja.po
#	addons/web/i18n/lo.po
#	addons/web/i18n/th.po
2016-06-15 12:59:39 +02:00
Christophe Simonis baf494c67b [MERGE] forward port of branch saas-9 up to 1d81bb0
# Conflicts:
#	addons/account_extra_reports/i18n/ca.po
#	addons/account_extra_reports/i18n/fi.po
#	addons/account_extra_reports/i18n/pl.po
#	addons/account_extra_reports/i18n/te.po
#	addons/account_extra_reports/i18n/zh_CN.po
#	addons/account_full_reconcile/i18n/hu.po
#	addons/account_full_reconcile/i18n/pl.po
#	addons/crm/crm_lead_menu.xml
#	addons/crm_claim/i18n/es_PE.po
#	addons/crm_claim/i18n/hu.po
#	addons/crm_claim/i18n/ja.po
#	addons/crm_claim/i18n/pl.po
#	addons/delivery/views/delivery_view.xml
#	addons/product/product_view.xml
#	addons/project_timesheet/i18n/es_PE.po
#	addons/stock/stock_view.xml
2016-06-15 12:40:59 +02:00
Christophe Simonis f9072c789d [MERGE] forward port of branch 9.0 up to bfbe2d6
# Conflicts:
#	addons/marketing/i18n/es_PE.po
#	addons/marketing/i18n/hu.po
2016-06-14 19:27:16 +02:00
Christophe Matthieu 78b52fb637 [FIX] templates: remplace true by True for t-field-options
t-field-options is a python dictionary.
'true' is evaluated as None because the qweb did not find any value for 'true' key.
2016-06-14 14:26:42 +02:00
Christophe Matthieu d159aec83d [IMP] qweb: remove decode('utf-8') in report because qweb return unicode 2016-06-14 09:46:26 +02:00
Christophe Matthieu 7ede9bcb2d [IMP] base ir.qweb: compile template (and use ast) to improve rendering speed
* The compiled templates are cached per user, lang, inherit context values
* ir.ui.fields: attributes method return an dict, and record_to_html return only the content value of the field
* all rendered text use build_text and all attributes use build_attribute
* t-esc-options is removed and replace by format_value method
* AssetsBundle receive the list files and remains
2016-06-14 09:46:25 +02:00
Odoo Translation Bot 596398a759 [I18N] Update translation terms from Transifex 2016-06-12 00:39:18 +02:00
xmo-odoo b466a9eea0 [FIX] report: Backport of 6d73087d to 9.0
Closes #12131
[FIX] report: don't hide errors in custom reports

If a custom report's render_html raises a KeyError for some
reason, Report.get_html would swallow the exception and fallback
on generic HTML rendering, usually blowing up with unfathomable
errors of missing rendering context data.

Check if a custom report object exists instead of waiting for a
KeyError.
2016-06-10 16:31:23 +02:00
Simon Lejeune 02484f899a [FIX] report: thread-safe barcode generation
A lock occurs when the user wants to print a report having multiple barcode while the server is
started in threaded-mode. The reason is that reportlab has to build a cache of the T1 fonts
before rendering a barcode (done in a C extension) and this part is not thread safe. We attempt
here to init the T1 fonts cache at the start-up of Odoo so that rendering of barcode in multiple
thread does not lock the server.

Another workaround was to set an explicit lock around the reportlab's function call, but it's
more dangerous as it may introduce undetectable lock between python and postgresql.

Thanks to @odony and @KangOl.

Fixes #12236
2016-06-10 11:26:01 +02:00
Denis Ledoux 291561a197 [FIX] report, account: invoice reset to draft attachments
When cancelling and resetting to draft an invoice,
delete only the invoice report attachment from the
attachment, not all of them.

The reason why the report is removed from the
attachments on the invoice resetted to draft
is explained in
db0def38cc

opw-680295
2016-06-09 17:37:55 +02:00
Christophe Simonis 7306e888a6 [MERGE] forward port of branch saas-11 up to ac50230 2016-06-08 12:28:16 +02:00
Christophe Simonis ac5023060c [MERGE] forward port of branch saas-10 up to 2f948c7 2016-06-08 12:19:23 +02:00
Christophe Simonis 2f948c76aa [MERGE] forward port of branch saas-9 up to 3ed483c 2016-06-07 19:45:02 +02:00
Christophe Simonis 3ed483caa1 [MERGE] forward port of branch 9.0 up to fa4a371 2016-06-07 19:21:18 +02:00
Odoo Translation Bot d1fa3350bb [I18N] Update translation terms from Transifex 2016-06-05 00:30:55 +02:00
Ravi Patel 9c012ad07e [FIX] report: Traceback on print report from wizard.
Go to Product Variant  >> Select any Product Variant >> Print Report Of Price List >> select any Price List
and Click on print button it's gives traceback like:
http://www.awesomescreenshot.com/image/1288867/b6639baf8cb94e3a90ce9d347b3f4f35

Introduced by https://github.com/odoo/odoo/commit/da3d2fb1dc76654e630fba27ca3dcf03002d9431
2016-06-02 14:46:12 +02:00
Géry Debongnie b107b14e6b [REF] report,web(_editor): services extracted in their own files
session_instance.js moved from framework/ to services/ and renamed into
session.js, which required to change the bundles in report and web_editor
addons.
2016-05-27 16:08:41 +02:00
Mohammed Shekha da3d2fb1dc [IMP] report: Printed Report names customization
PURPOSE
=======

I've seen this new improvement regarding the naming of the printed reports:
https://www.odoo.com/web?#id=10870&view_type=form&model=project.task&menu_id=3942&action=327

This makes the report have the pdf name being the name instead of the report_name of
the ir.actions.report.xml, which is already an improvement.

But why don't we allow the users to have their own naming conventions?
I mean, we could allow our client to create and name their pdf the way they want, as
they do regarding the attachment.

Not only when it's about saving it as an attachment on the record, but also when downloading
directly the pdf, such that the modification in the previous screenshot, would give the following
result when downloaded:

People need to have their pdf named automatically according to a convention. When you print 10 sales
order during an hour, you don't want to get lost in having the following:
Devis / Commande.pdf
Devis / Commande(1).pdf
Devis / Commande(2).pdf
Devis / Commande(3).pdf
Devis / Commande(4).pdf
Devis / Commande(5).pdf
Devis / Commande(6).pdf
Devis / Commande(7).pdf

especially when those are for different partners.
2016-05-27 09:44:01 +02:00
Christophe Simonis e4500d06fc [MERGE] forward port of branch saas-10 up to 57944db 2016-05-26 16:55:37 +02:00
Christophe Simonis 44fd6a55f3 [MERGE] forward port of branch saas-9 up to 413ba94 2016-05-26 14:10:55 +02:00
Christophe Simonis 413ba9445c [MERGE] forward port of branch 9.0 up to 24eebbd 2016-05-26 14:06:36 +02:00
Christophe Matthieu fe348e280d [FIX] report: some Wkhtmltopdf installation can return an empty version 2016-05-26 08:02:14 +02:00
Christophe Simonis e641d740d7 [MERGE] forward port of branch saas-10 up to fac4cc7 2016-05-24 14:08:42 +02:00
Christophe Simonis fac4cc7006 [MERGE] forward port of branch saas-9 up to f8e6bb7 2016-05-24 13:19:19 +02:00
Christophe Simonis f8e6bb73b3 [MERGE] forward port of branch 9.0 up to 4c07faf 2016-05-24 12:33:23 +02:00
Odoo Translation Bot ebc0206ab5 [I18N] Update translation terms from Transifex 2016-05-22 00:28:27 +02:00
Christophe Simonis e38ddcfeae [MERGE] forward port of branch saas-10 up to b26fd22 2016-05-17 14:39:05 +02:00
Christophe Simonis b26fd22584 [MERGE] forward port of branch saas-9 up to 6d6a90f 2016-05-17 14:12:07 +02:00
Christophe Simonis 6d6a90f385 [MERGE] forward port of branch 9.0 up to 128d58f 2016-05-17 14:04:26 +02:00
Odoo Translation Bot 610d462740 [I18N] Update translation terms from Transifex 2016-05-15 00:29:02 +02:00
xmo-odoo 6d73087d96 [FIX] report: don't hide errors in custom reports
If a custom report's render_html raises a KeyError for some
reason, Report.get_html would swallow the exception and fallback
on generic HTML rendering, usually blowing up with unfathomable
errors of missing rendering context data.

Check if a custom report object exists instead of waiting for a
KeyError.
2016-05-13 17:28:19 +02:00
Christophe Simonis 91c9284951 [MERGE] forward port of branch saas-10 up to 5aa0bae 2016-05-13 16:33:51 +02:00