Commit Graph
126133 Commits
Author SHA1 Message Date
jpr-odoo cea2a454ae [IMP] account*: update invoice page view on customer portal
*account_payment, l10_in(_sale), sale(_stock), web

With this commit:
The invoice preview in portal (/my/invoices..) is now the HTML version of the
PDF report.
The HTML preview is based on the invoice report to closely match what is
already done in Odoo.

The invoice preview is displayed in an 'iframe', it is mandatory since:
1. Reports are rendered as a separate page as it returns the whole page after
   rendering, which has tag <html>, <head> etc
2. Reports are having their own layouts and their own assets that we we cannot
   load in the page directly or it will break the website layout.
3. We can not use report template with t-call because internally reports are
   using extra params like context_timestamp, company, DateTime, user etc which
   is used in header/footer

--

There will be a chatter (as a modal) to display/see the history of the document

--

For responsive purpose, we use new tables with limited column (Description,
Quantity and Amount) for responsive purpose (small screen).
It also adds some bootstrap classes to reports for responsive purpose.

--

The 'Pay Now' button remains if you already paid with 'wire transfer'.

--

Add margin after the header and before the footer to look like the real printed
document, without alterating the real printed version

Task ID: 39876
2018-06-22 18:32:49 +02:00
jpr-odoo 949ce0278a [IMP] portal: add a generic PortalSidebar widget to be used in customer portal
with this commit, this generic widget allow to basic functionality for portal sidebar like: print btn (direclty print the document),
 set due or delay label of the document (based on given date), used affix to locked to an area on the page for sidebar.
 Purpose is to reuse it in account customer portal and online quotes notably.
 some css code convert to the less file to have working portal sidebar skeleton, which is already used in website_quote

 Task ID: 39876
2018-06-22 18:32:49 +02:00
qsm-odoo a17cd93864 [FIX] web_editor: allow recropping a newly cropped image
Since https://github.com/odoo/odoo/commit/a473453b3166a381130d9bd6ec4851b9e1ecab26,
a newly cropped image gets a base64 src until the user choose to save
the page (where we create an attachment for the cropped picture). The
problem is that when reentering the crop edition at once... it was not
able to be performed because we did not handle base64 images there.

This commit solves this and accidentally adds a feature: allow cropping
base64 images.
2018-06-22 17:09:54 +02:00
qsm-odoo 6209b12937 [FIX] web_editor: do 'reset' crop feature when changing ratio
This reverts commit bf64efb5a0.

Indeed, it was in fact necessary as more complex bugs of the library
can appear if we do not reset before. They even do that themself in
their library demo: https://fengyuanchen.github.io/cropperjs/
2018-06-22 17:09:54 +02:00
Arnold Moyaux 7351a651a7 [FIX] mrp: bom cost report without lines traceback
Usecase to reproduce:
- Create a bom without line
- Add a new line without filling the product_id
Click on bom cost button that appears

It crashes because the xml try to access item dict instead
of using get and 'components' and 'lines' both not exist.
2018-06-22 16:39:21 +02:00
Arnold Moyaux bbafb90e08 [FIX] mrp: bom cost multiplied twice
Use case to reproduce:
- Create a BoM with a bom line that have at least 2 quantity to process and
this line should be a manufacturable product with also a BoM.
- Open the BoM cost report.
The line has its correct BoM cost multiplied by the quantity to consume.
It happens because the price of the BoM line is computed with the right
quantity to consume however it's result is multiply one more time to the
quantity to consume.
2018-06-22 16:39:21 +02:00
Alexandre Kühn e503b0b3a4 [FIX] im_support: fix style of attachment button in discuss composer
Before this commit, there was a visual bug on the attachment button
of a composer in discuss: instead of being next to the emoji button,
it was places below it.

This is due to the intent of displaying the attachment button only
for threads that are not the support channel. To do so, it uses the
jQuery methods `$.show()` and `$.hide()` on the considered DOM element.

The problem is that these methods change the `display` attribute of the
DOM element, so that when `$.show()` is called, it sets the display to
`block`, which causes the visual glitch.

With this commit, we use the classname `o_hidden` instead of the jQuery
methods, so that the attribute `display` is unchanged.
2018-06-22 16:31:54 +02:00
Denis Ledoux 6edf49e36f [IMP] ir_qweb: provide a clean way to ovverride the AssetsBundle to use
This revision follows revisions
- 9cd982bcc8
- df4072b0b4

We noticed modules implementing multi-websites features
override `_get_asset` to be able to provide their
own overriden `AssetsBunble` class.

Private methods are meant for internal usage of the code/module,
overriding is never a good idea given the fact their signature
can change. As this is the case in commit
9cd982bcc8.

That said, we understand their was no other way to go.
We therefore decide to provide one,
by adding a method that can be overriden to pass
their own AssetsBunble class instance.

opw-1860136
2018-06-22 15:36:28 +02:00
Alexandre Kühn e4d3dfba49 [FIX] *: nocontent helper style for form view fields
*: hr_gamification, point_of_sale, web

Before this commit, no content helper in some form view fields were broken,
due to the style of the classname `.o_view_nocontent` that uses an absolute
position.

This is due to some templates that wrongly use this style for displaying a
help message, although this is only valid for views with no record.

This commit solves the issue by using another classname for those fields
with the nocontent helper, namely `.o_field_nocontent`.
2018-06-22 15:30:37 +02:00
Nicolas Lempereur cb047ae69d [FIX] web_editor: keep border when side style differ
Since e94702d8 when transcoding an element for the purpose of sending it
by mail, if the element had:

 border-bottom-style: solid;

in the CSS resulting from classes, it would be simplified to:

 border-style: 0 0 solid 0;

which is wrong since 0 is invalid for border-style, the default being:

 none

opw-1852839
closes #25423
2018-06-22 14:25:36 +02:00
Priyanka Kakadiya 27bbcb45ad [FIX] account: fix traceback in payment matching
when writeoff is involved, there was a traceback
2018-06-22 14:22:33 +02:00
Lucas Perais (lpe) 5de096dbf2 [FIX] account: aged balance shouldn't display fully reconciled on a period
Backport of 5f105d144d from v11.0

Commit 45c5a07d89 deals with displaying on the aged balance reports
the lines that zero out each other: an invoice and a payment of the same amount for the same partner
However, that commit overlooked that when there is a chain of reconciliation
that puts the report line to zero, it was displayed as well.

This present commit corrects this by making sure there are amls that detail the report lines

OPW 1857860

closes #25421
2018-06-22 13:23:59 +02:00
Adrien Dieudonne bd004b8267 [FIX] *: Avoid BlockUI for some rpc
Before this commit, the point of sale displayed a loading message
every 5 secondes if the barcode scanner was configured.

This issue is due to the following commit: @1aacc96
After this commit,some calls may block the interface when they did
not do it before.
It concerns all rpc done with ajax.rpc and all done with a new
session.

We have now to explicitly set shadow property.

opw-1860493
2018-06-22 13:13:18 +02:00
qdp-odoo 07c111fa72 [IMP] account: onboarding improvement
Improves the 'chart of account' step by showing all the accounts in the list instead of the default limit

Was part of task 1838269.
2018-06-22 13:05:19 +02:00
Lucas Perais (lpe) 72003ca530 [FIX] calendar: ok button on notifications should notify ack
Have an event starting *now* with a reminder, let's say 15 minutes

After saving the event, the notification pops up.

Click "OK"

Before this commit no call to the server was done, implying that the notification
will keep on popping up untimely
This was because, the widget was destroyed, hence its parents got removed
before the triggering up of rpc call

After this commit, we make sure we destroy the widget *after* the rpc

OPW 1860169
closes #25399
2018-06-22 11:19:00 +02:00
Jeremy Kersten df4072b0b4 [FIX] base: keep _get_asset for retro compatibility
Return of _get_assets has been altered with commit 9cd982bcc8
We keep it for retro compatibility, but devs that override it before need to
override now _get_asset_node to be called correctly by t-call-asset.
2018-06-22 11:10:50 +02:00
Swapnesh Shah 55e2d249a6 [FIX] hr_payroll: Ad missing ValidationError import 2018-06-22 10:55:43 +02:00
Nicolas Lempereur 06d89a8440 [FIX] web: onchange on not loaded inline list view
Let's assume a one2many A inside a form view, such that the one2many
views (list, not editable, and form) are defined inline, and there is an
onchange on A. There is another inline one2many B editable list
displayed in the inner form view (and B isn't in the list). There are
two records on the one2many A, both of them having one record in their
one2many B. Edit the first record of A, and edit it's subrecord in B.
Click on save. This triggers an onchange on A and the onchange returns a
command 5 (DELETE_ALL), and two commands 1 (UPDATE). Now edit the second
record of A, and simply close the dialog (e.g. 'Discard'). Save the main
record: the record in one2many B of the second record of A has been duplicated.

This occured because the code in BasicModel messed up information coming
from the onchange (UPDATE command) and from the read (performed when
opening the second record), thus producing a CREATE command instead of
an UPDATE one.

This rev. ensures to properly mix the read data with the onchange
result, by transfering the changes over the list datapoint created after
the read.

opw-1836785
closes #25330
2018-06-22 10:19:51 +02:00
eco-odoo 52a0395040 [IMP] account: update dashboard sales and purchase journal graph
The sales journal graph  should show the cash-in forecast of invoices.
In order to do that we need to display residual amount to be received
based on the invoice due date.

The purchase journal graph should show the cash-out forecast from
invoices. In order to do that we need to display the residual amount to
be paid based on the invoice du date.

Was task: 1855081
Was PR #25344
2018-06-22 10:10:18 +02:00
Nicolas Martinelli adeb570b5a [FIX] mass_mailing_event: stat button overlap
In some languages (e.g. German), the text on the stat button overlaps
the button next to it.

opw-1858981
2018-06-22 09:58:59 +02:00
Nicolas Martinelli 7cd13f3b55 [FIX] point_of_sale: settings access
Make settings accessible to POS manager only.

opw-1857771
2018-06-22 09:55:11 +02:00
Adrian Torres 9ddf2c6932 [FIX] crm: reset dashboard_graph_model on uninstall
Before this commit:
    * Install `sale_management`, `crm`
    * Uninstall `crm`
    * Go to sales -> sales channels
    * Boom! The view is broken

This happens because both CRM and Sales share the sales teams view, yet
CRM's override of the model adds a selection_add to the
dashboard_graph_model selection field, when it is uninstalled, records
whose dashboard_graph_model field are set to one of the values
introduced by CRM keep this no-longer-valid value and upon accessing the
view it crashes.

This is a known limitation of selection fields and the selection_add
feature.

To solve this, an uninstallation hook has been created for CRM which
will fetch all records whose dashboard_graph_model is set to
`crm.opportunity.report`, and update the field of all these records to
None (NULL).

Fixes #25363
2018-06-22 09:18:51 +02:00
len-odoo f557f34b75 [FIX] website_sale: set confirmation mail template setting to readonly
In website_sale setting, there is a field 'Confirmation Email' that is not used,
and which purpose is to have a conveninent link to edit the mail templates.
Since it is an editable setting, this confuses the users.
It was in readonly before commit:
https://github.com/odoo/odoo/commit/65a7531c8b5c713969e49a5fab9d4672524c3ba8#diff-3f25fe0e27881e9c6655bbb6974c84abR59
which removed the readonly without any apparent reason.

We put it back into readonly mode.

opw 1860167
2018-06-22 08:24:26 +02:00
Goffin Simon 16fb8f0a75 [FIX] web_calendar: Calendar date format incorrect
Steps to reproduce the bug:
- Set a language on your user
- Change the date format in this language and set '%d/%m/%y' (two digit year)
- Open the calendar and select day or week view

Bug:
- The date displayed on the column headings has 'y' where it should have the year.

To check the right date format: http://fullcalendar.io/docs1/utilities/formatDate/

opw:185924
2018-06-21 16:50:51 +02:00
Arnold Moyaux 1740b179bf [FIX] stock: resupply propagate pull rules
Use case to reproduce:
- Create a production warehouse that manufacture and a supply warehouse that deliver your product (manufacture and supply dist. WH checked on prod WH.)
- Create a product with a BoM and resupply, MTO and manufacture checked on its routes.
- Modify the resupply pull rule that go from prod/WH to transit location
from MTS to propagate
- Create a Quotation and confirm it.
The user error 'no procurement rule found' is raise.

It happens because the move from customer to Prod/WH are correctly
created but the rule manufacture is not found. It couldn't be find
due to a wrong warehouse on the stock.move. The pull rule use the
supply warehouse instead the warehouse that they serve when they
generate the stock move value.

This commit remove the propagate_warehouse_id on the second rule between
the stock location and the transit location.
2018-06-21 16:21:54 +02:00
qdp-odoo d1a148a2ba [IMP] account: better order of details in aged partner balance report 2018-06-21 16:00:01 +02:00
Denis Ledoux 5c70cc24b3 [FIX] point_of_sale: performance improvement to read one session
The fact the pos config name get was doing
`config.session_ids[0].state`
led to the prefetch of fields of all the session_ids of this config
on reading `config_id` for the session form

Therefore, if a pos config had 1000 sessions,
it was prefetching fields of 1000 sessions when you actually
wanted only one session to display in the form.
Among others, the `picking_count` field which is
not stored and quite heavy to compute

In term of time, it went from 1 minute to 1 second
to open the form view of one pos session.
2018-06-21 15:07:24 +02:00
Aaron Bohy 8ace39f8bc [FIX] web: onchange in non inline one2many list
Let's assume a one2many list with two fields A and B, and an
onchange on A that sets B. Before this rev., on new records, the
onchange was only triggered if the one2many list was defined
inline.

Rev. 13c885195 was an attempt to fix the onchange issue in x2manys
with non inline views, but it only worked on existing records. This
rev. fixes the problem for both cases (existing and new records),
and thus reverts the fix of 13c885195.

The idea of this fix is to make both cases behave similarly, w.r.t.
fields and viewFields stuff in the fieldsView. In the inline case
(like in the main view case), fields and viewFields are the same.
In the non inline case, viewFields contained more information than
fields. As fields is used everywhere in BasicModel (and viewFields
is basically ignored), the fix is to set fields to viewFields.
2018-06-21 13:58:52 +02:00
Aaron Bohy fdf615a551 [FIX] web: onchange in non inline one2many list
Let's assume a one2many list with two fields A and B, and an
onchange on A that sets B. Before this rev., on new records, the
onchange was only triggered if the one2many list was defined
inline.

Rev. 13c885195 was an attempt to fix the onchange issue in x2manys
with non inline views, but it only worked on existing records. This
rev. fixes the problem for both cases (existing and new records),
and thus reverts the fix of 13c885195.

The idea of this fix is to make both cases behave similarly, w.r.t.
fields and viewFields stuff in the fieldsView. In the inline case
(like in the main view case), fields and viewFields are the same.
In the non inline case, viewFields contained more information than
fields. As fields is used everywhere in BasicModel (and viewFields
is basically ignored), the fix is to set fields to viewFields.
2018-06-21 13:57:58 +02:00
Aaron Bohy 239d460ae5 [FIX] bus: correctly forwardport 10161f9d61 2018-06-21 13:57:57 +02:00
Aaron Bohy b188d1fc1f [ADD] im_support: test suite
This revs. add a new test suite for the im_support module. Defining
a new suite was necessary as the im_support JS feature needs
specific keys to be defined in the session, otherwise its files are
simply skipped.
2018-06-21 13:55:10 +02:00
Aaron Bohy ffe9bb501b [FIX] mail: test utils: mock is_odoo_focused
In the mocked version of the longpolling bus used in tests, the
is_odoo_focused function should be defined to prevent crashes when
we simulate incoming messages.
2018-06-21 13:55:10 +02:00
Aaron Bohy cf3cc98f1c [FIX] mail: set correct parent to ChatWindows
Since the ChatWindowManager is a service, this is no longer
necessary to set the webclient as parent of ChatWindow's instances.

This rev. sets the ChatWindowManager itself as parent, which makes
much more sense, and which allows to properly mock the whole
ChatManager-ChatWindowManager environment in tests.
2018-06-21 13:55:10 +02:00
Aaron Bohy 5d943c38c9 [FIX] mail: tests: move utils in correct bundle
Those test utils files should be in the test assets bundle such
that they are available for potential other test suites (e.g. the
new im_support suite).
2018-06-21 13:55:10 +02:00
Lucas Perais (lpe) f0efcbe592 [FIX] web: actions target=new should transmit their on_close
Have an action that opens a dialog, with a specific callback
to execute when the dialog closes
In the dialog, have a button linked to an action that opens
another dialog in target = new
Close this 2nd dialog

Before this commit, the callback was not executed

After this commit the callback is executed

OPW 1853136
closes #25180
2018-06-21 13:13:36 +02:00
qsm-odoo a473453b31 [FIX] web_editor: review crop attachment creation/discard
Previous implementation was wrong as it did not care about the ability
to discard a crop edition. Indeed, whenever a crop dialog was saved,
a crop attachment was created or updated at once. Discarding the editor
would then either:

- Seem to discard a first-time cropped image but would have created an
  attachment for nothing (just the image src was reset)

OR

- Fail to discard a second-time cropped image as the cropped attachment
  would have been directly updated and the image src would not have
  changed

This commit changes the way it works:

- On crop dialog save, the image is marked with required data for a
  potential future save of the cropped image (as a DB attachment) and
  the src is set to the base64 cropped image directly.

Note that the code ends up being clearer and efficient that way too.
2018-06-21 12:59:16 +02:00
qsm-odoo cd812bd6f4 [FIX] web_editor: fix saving and restoring of crop aspect ratio
When an image was cropped and saved with a specific aspect ratio,
it was not restored properly on further crop editions.
2018-06-21 12:58:33 +02:00
qsm-odoo a9366de8f9 [FIX] web_editor: do not show cropped images in media dialog
Cropped image attachment were not meant to appear in the media dialog,
only original ones.
2018-06-21 12:58:03 +02:00
qsm-odoo bf64efb5a0 [FIX] web_editor: do not 'reset' crop feature when changing ratio
Before this commit, when the user changed the ratio option in the crop
dialog, the image zoom/rotation were reset for no apparent reason.
2018-06-21 12:56:38 +02:00
qsm-odoo a04b79a205 [FIX] web_editor, *: properly remove DOM portions in a snippet
* website, website_mail_channel

Before this commit, when using the 'number of columns' option from a
column's snippet editor, the snippet overlay remained floating in the
void if the current column was removed by the option. This was because
the option did a simple "destroy" on the column without caring about
the snippet editors.

This commit introduces a new event which can be trigger_up'ed to ask
the editor to properly remove a DOM portion (destroy related editors,
call the 'onRemove' callbacks, ...).
2018-06-21 12:54:17 +02:00
qsm-odoo f6bbc40fbe [FIX] web_editor: reset snippet editors on snippet move
As indicated in a code comment, destroying and rebuilding all snippet
editors when a snippet is moved is more accurate as the snippet options
may depend on the new locations in a way the 'onMove' callback cannot
handle. That operation seemed however too costly for no visual benefit
at the time. Now, not implementing it is a source of bugs and redundant
code (as with the new "number of columns" option which is not properly
updated once a column is moved in another row), so this commit
implements the feature.

This also allows for some improvement: the 'cleanForSave' part of
snippet editors is always performed when they are destroyed.

If this proves to be ok and safe, we might want to backport this in
previous versions.
2018-06-21 12:54:17 +02:00
Christophe Simonis 226230952a [FIX] base: use relative import when it makes sense
Oversight of previous forward-port
2018-06-21 12:33:45 +02:00
Christophe Simonis 68326b15f9 [MERGE] forward port branch 11.0 up to c5ed372970 2018-06-21 12:18:40 +02:00
nla-odoo fd5062eb63 [FIX] payment_stripe: fix usage of removed 'refunding' state on payment.transaction
Since 0121634#diff-dc63c46ab28cd7b4ad9c17f2ccc3fbc7L491, the 'refunding' state no longer exists.
2018-06-21 12:13:40 +02:00
Christophe Simonis c5ed372970 [MERGE] forward port branch saas-15 up to 152d42041e 2018-06-21 10:57:42 +02:00
Nicolas Martinelli 22084bc52e [FIX] website_quote: token assignation
Speed up assignation of initial access tokens for large databases.

opw-1856946
2018-06-21 10:45:14 +02:00
Nicolas Martinelli 1fe119da3b [FIX] barcodes: nomenclature
Loads the barcode nomenclature only if one has been is defined. Indeed,
from commit 80e89c7a11, the POS config unset the
`barcode_nomenclature_id` field if the barcode support is not activated.

opw-1859928
2018-06-21 10:40:59 +02:00
Nicolas Martinelli c70db5d5df [FIX] stock_account: product on AML
When changing the standard price of of a product set in perpetual
valuation, the AML does not contain the corresponding product_id.

opw-1859777
2018-06-21 10:37:32 +02:00
Nicolas Martinelli 25b6dd6e88 [FIX] sale_mrp, sale_stock: sort moves
`sorted` returns a new sorted recordset, but doesn't modify the actual
one. Therefore, the current code doesn't work as expected.

opw-1824734
2018-06-21 10:34:49 +02:00
Nicolas Martinelli f8fc006e1e [FIX] sale_mrp, sale_stock: sort moves
`sorted` returns a new sorted recordset, but doesn't modify the actual
one. Therefore, the current code doesn't work as expected.

opw-1824734
2018-06-21 10:32:39 +02:00