Commit Graph
103766 Commits
Author SHA1 Message Date
Christophe Matthieu 7e1f2eb91e [IMP] ir.qweb: format monetary use field monetary method
(facilitate code maintenance)
2016-07-05 18:43:09 +02:00
qsm-odoo efed10bd9a [FIX] web_tour: tip border use
The border width was still not used correctly to compute the overlay
size, making scrollbars appear for no reason.
2016-07-05 18:05:24 +02:00
qsm-odoo 3d8d2ed50e [FIX] web_tour: ideal location to append tip
The tip was currently placed in the first parent which can scroll.
This is wrong if there is a parent which is position:fixed in that
element which scrolls (as it would not follow the scrolling as it is
fixed).
The ideal location is now the first parent which can scroll or which
is position:fixed.

Note: there are still two cases which may not work but they are
considered rare enough to not handle them :
* A position:fixed element which is overflow:hidden too
* A position:absolute element whose relative ancestor is an ancestor
of the ancestor element which can scroll.
2016-07-05 18:05:24 +02:00
qsm-odoo 73898ccb8b [IMP] web_editor: change image edition toolbar
* Move description button at the end of the toolbar
* Add an "auto" state button for the image width (alongside 100%,
50% and 25%) (when these last three are unchecked, the auto button
becomes checked).
2016-07-05 18:05:24 +02:00
qsm-odoo c259b38ef5 [IMP] web_editor: background + color snippet options
Now, when choosing a background-color when a background-image has
already been selected, the background image is removed on hover/click
of the color option.
However, the opposite operation remains the same. So if you choose a
background-color, you can then choose a background-image and the
colors will be kept.
2016-07-05 18:05:24 +02:00
qsm-odoo 3247400291 [IMP] website(_*): tours
* Adapt modals for new pages/product/... to leave some space for tour
tips on the right
* Remove the "click on add page" step which was the start of each tours
and leave it to be the last of the website tour
* Change position of some tips
* Remove step "click on parent button" in website tour as it is not
necessary anymore
* Remove the possibility to skip the frontend tours
2016-07-05 18:05:24 +02:00
Simon Lejeune b0a25e5b0e [FIX] web: translation: don't reset database on set_bundle
set_bundle is called twice (one time by the session, another time
by the web_editor). As the `set_bundle` actually drop the dict of
translations instead of updating it and as web_editor only load
the terms of its module, depending on which call to `set_bundle`
ends first result on having your translations or not.

This commit update the database of translation instead of dropping
it, which fixe the current issue (the dict of traductions empty of
the traduction you really need) but another fix would be to remove
the useless call by web_editor when launched in the backend  (which
is probably there because it was needed when the web_editor was only
working in the website).
2016-07-05 17:48:33 +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
Simon Lejeune 06770f53bf [FIX] web: allow on_(attach|detach)_callback callbacks to be called
The `on_attach_callback` and `on_detach_callback` callbacks are
called when an a widget is attached / detached according to the
`is_in_DOM` variable. As the community's action manager cannot
be detached from the DOM, we can hardcode this value to true.

This allow to run these callbacks when needed.
2016-07-05 17:44:56 +02:00
Simon Lejeune 2fdf631809 [FIX] web: control_panel: do not trim breadcrumb's title if undefined 2016-07-05 17:44:56 +02:00
Simon Lejeune eed7fdb6fe [REF] web_editor: cancel method of RTE should be async
and return its deferred. This commit makes the behavior consistent with
the `save` method.
2016-07-05 17:44:56 +02:00
Simon Lejeune 5c54571f4e [FIX] web_editor: remove the editable key if no write on the model
The `check_access_rule` call allow to remove the `editable` key from the
rendering context (which will lead to the display of the editor bar) if
an access rule prevents the edition of the ir.ui.view record. Also remove
it in case the user has no write access on the model (i.e. demo user).
2016-07-05 17:44:56 +02:00
rgo-odoo 27787265dd [MIG] crm_partner_assign: Converted yml test cases to python unittest 2016-07-05 17:27:44 +02:00
rgo-odoo 053982f48d [MIG] website_crm_partner_assign: Code migration to new api 2016-07-05 17:27:44 +02:00
rgo-odoo ac94ed70ec [MOV] website_crm_partner_assign: splitted the files according to new api guidelines 2016-07-05 17:27:44 +02:00
rgo-odoo 994ee31a61 [MOV] website_crm_partner_assign: directory restructuring according to new api 2016-07-05 17:27:44 +02:00
Martin Trigaux b5f7864988 [MERGE] website_mail_channel: (un)subscription for non-user subscribers
Closes #12691
2016-07-05 17:24:58 +02:00
Martin Trigaux 2407f793a6 [FIX] website_mail_channel: public user (un)registration
Allows public users to unsubscribe to a mailing list.
Before this patch, a user had to be connected with an account with subscribing.
For public users, a confirmation email is sent to subscribe and unsubscribe to
a list.

Use hmac signatures to prevent fake (un)subscriptions.
2016-07-05 17:24:36 +02:00
Martin Trigaux 26be95592c [IMP] website_mail_channel: better naming of variable
subscribe == True meant to unsubscribe the user...
2016-07-05 17:24:35 +02:00
Martin Trigaux 553954fa82 [ADD] mail: parameter on send_mail method
To avoid to use the context to pass additional arguments just to specify
recipients or other mail.message field values.
2016-07-05 17:24:34 +02:00
Damien Bouvy 17737ed2c1 [IMP] website_event_track: track submitter should follow its track
When submitting a track, you would expect to be follower of the track.

If you are logged in, you are automatically follower, if not and if a
partner with the e-mail given in the form exists, it will be added as
a follower.
2016-07-05 16:46:31 +02:00
Jigar Patel 5f02fe9a67 [MIG] pad_project: Migrate into new api 2016-07-05 16:02:22 +02:00
Jigar Patel 0312063baa [MOV] pad_project: Re-organized file structure 2016-07-05 16:02:22 +02:00
Jigar Patel 66496b89a5 [MIG] pad: Migrate into new api 2016-07-05 14:47:36 +02:00
Jigar Patel d5752d814e [MOV] pad: Re-organized file structure 2016-07-05 14:37:05 +02:00
dut-odoo 7e72de3f2e [MIG] board: migrated to new API 2016-07-05 13:34:12 +02:00
dut-odoo bf0b752817 [REM] board: remove dead code
No longer called, call was removed in #11172.
2016-07-05 13:17:48 +02:00
dut-odoo 3174dcd047 [MOV] board: Moved/Renamed files as per new API guidelines 2016-07-05 13:17:48 +02:00
Aaron Bohy fd9d9ce171 [FIX] crm, project, sale: make tours work in community
The step consisting to go back to the app switcher doesn't work in community,
obviously, so this commit make it active in enterprise only.

Also make the Settings app selector more robust by accessing it through its
xmlid, as we do for other apps and menus.
2016-07-05 12:42:49 +02:00
Aaron Bohy fa8f818991 [IMP] web_tour: filter steps according to edition
Allows to define steps that only apply either in community or enterprise, by
setting the step's attribute 'edition' to 'community' or 'enterprise'.
If the attribute is not set, the step applies on both edition.
2016-07-05 12:42:49 +02:00
Aaron Bohy 5a619d25ef [IMP] *: web_tour: remove 'Skip tour' link in tips 2016-07-05 12:42:49 +02:00
Aaron Bohy dad3e9e928 [FIX] web_kanban: 'create' button
This commit fixes two bugs:
  - 'quick_create' is a special value for the on_create option, it is not an
    action xmlid. So when this option is set either in a ungrouped or in an
    empty grouped Kanban view, we should try to execute 'quick_create'.
  - the 'create' button is muted (btn-default instead of btn-primary) in
    grouped Kanban with no column. This status should be updated at each
    do_search, and each time a column is added/deleted.
2016-07-05 12:42:48 +02:00
Christophe Matthieu 4c76e9a9df [FIX] ir.qweb: use options instead of context to load asset content
The _get_asset_content is cached in function of the template option, don't use context to load content because we must load the asset in function of the compiled caller template.
2016-07-05 11:31:03 +02:00
Christophe Matthieu f1e3ac88f8 [FIX] ir_qweb/website: must adapt AssetsBundle call to nex new syntax
AssetsBundle receive the files list instead of to load the xml content itself (speed up because the file list is cached).
2016-07-05 11:31:03 +02:00
Nicolas Martinelli 51cdffcb9e [FIX] stock_account: default new price if compute from BoM
When the new standard price is computed from the BoM (thanks to module
`product_extended`), the price suggested is still the standard price of
the product.
2016-07-05 09:43:29 +02:00
Jérome Maes bcff661bc6 [FIX] crm : avoid UnboundLocalError in crm log activity wizard 2016-07-04 17:28:07 +02:00
Jérome Maes fd10e60619 [IMP] crm : add test cases for crm activity 2016-07-04 17:28:06 +02:00
Jérome Maes 4f48319207 [FIX] crm : activity should not be a default subtype by default
This aims to prevent everybody to follow the activity
subtype. It prevents the default behavior of
mail.message.subtype.
2016-07-04 17:28:06 +02:00
Xavier Morel d9b2f47fb1 [FIX] crm : apparent bug in handle_partner_assignation
Starting from 32fb2f0940 if a lead is
already assigned to a partner instead of returning the already assigned
partner we ignore that, possibly reassign the lead and return either the
new assignment or ``False`` (if not in action=create and no partner_id
was provided).

This seems like an error which passed through and was never noticed as
the method isn't called much and only from wizards.

Either way, revert that. And remove the comment which apparently was
never updated.
2016-07-04 17:28:06 +02:00
Xavier Morel 5b02825194 [FIX] crm : name_get use
In the new API, ``name_get`` doesn't normally lose sort information
anymore: the result of ``search`` (or ``browse(_search)``) is correctly
ordered and ``name_get`` sequentially resolves record names.

Thus the post-facto re-ordering mess should be unnecessary,
``records.name_get()`` will be ordered as ``records`` is.
2016-07-04 17:28:06 +02:00
Xavier Morel 3e2e1d6b90 [IMP] crm : various code cleaning
- try to make better use of recordsets (and recordset APIs)
- remove pointless decorators
- remove redundant ensure_one
- make 'stage_find' a private method returning a recordset
- etc ...
2016-07-04 17:28:06 +02:00
Jérome Maes 4f899f17d4 [IMP] crm : add related fields from subtype to avoid override create method
Using the field inheritance to avoid patching create method. So the
res_model and iternal field are directly related to subtype.
2016-07-04 17:28:05 +02:00
Jérome Maes f5afa1e2f7 [REF] crm : rename method in base_merge_partner wizard for better understanding 2016-07-04 17:28:05 +02:00
Jérome Maes 1b2ba5707d [IMP] crm : remove try/except from computed fields
Rather adding a group on the view to avoid Access
Error, than adding a try/except catching the
exception for opportunities and mettings count on
partner form view
2016-07-04 17:28:05 +02:00
Jérome Maes 58bd6a848f [IMP] crm : change return values of merge_opportunity method
Since new API works with record, convert the return values from ids
into recordset.
2016-07-04 17:28:05 +02:00
Jérome Maes 1414b3e56e [REF] crm : some code improvements
- remove backward compatibility method `case_mark_won` and `case_mark_lost`
- change signature of `find_stage` method, by setting team_id optional, since
we can get if from `self.team_id`
- remove unused methods in crm_lead.py
- remove unsed code in base_merge_partner.py
- remove unused method in res_partner.py
2016-07-04 17:28:05 +02:00
Jérome Maes f3c1eceae7 [MIG] crm : convert yml tests into testcase python
Convert from yml file into python test cases. Tests are group
according to the scope (crm.lead operation, messaging, business,  ...)
2016-07-04 17:28:04 +02:00
Ravi Gohil aa44700dcc [MIG] crm : migration to new API
Also adapt code in crm_partner_assign according to migration of crm.lead
2016-07-04 17:28:04 +02:00