Commit Graph
117156 Commits
Author SHA1 Message Date
Nicolas Martinelli 037cfc9f67 [FIX] delivery: products not shared
- Define 2 companies A and B. Delivery methods are linked to products in
  company A
- Deactivate 'Share product to all companies'
- Create a user B in Company B only
- As user B, create a SO and open the drop-down list for delivery
  methods

An access error is raised.

Delivery methods should follow the same record rules than the products
they are linked to.

opw-1815490
2018-03-06 10:02:44 +01:00
Odoo Translation Bot 38ae172c3b [I18N] Update translation terms from Transifex 2018-03-06 09:33:49 +01:00
Christophe Matthieu 108d22ecdf [FIX] website_form: public user can send attachment
Issue:
An additional information page is part of our shop process to allow
additional information to be submitted. If this form is left blank,
then selecting the next button allows the process to continue.
However, if data is added to the form the form freezes and the process
will not continue when 'next' is selected.

Why:
Public user can not read the field 'model' of 'ir.model' (to save the
attachments)

opw-1818592
2018-03-06 09:26:34 +01:00
Aaron Bohy 16a27c94e0 [FIX] web: create favorite filters in dialogs
This is a manual forwardport of rev. b466b3bc.

Consider the following scenario: open in edit mode a form view
containing a many2many field displayed with widget many2many_tags,
on the many2many field dropdown, click on 'Search More' (it opens
a dialog), and in the dialog, try to save the current search in
the searchview's favorite menu.

Before this rev., it tried to retrieve the context of the active
controller in the closest instance of a ViewManager-like widget
in the SearchView's ancestors.

First, it is wrong as in the given scenario, the requested context
is actually the one of the list controller in the dialog, not the
one of the form controller in the background.

Second, it produces a crash in Studio, when trying to save filters
in the dialog opened by clicking on 'Search More' on the groups
many2many field in the sidebar.

This part of the code can't be tested in this version, but tests
will be added in master.

Fixes #23293
2018-03-06 09:11:11 +01:00
Aaron Bohy b466b3bc60 [FIX] web: create favorite filters in dialogs
Consider the following scenario: open in edit mode a form view
containing a many2many field displayed with widget many2many_tags,
on the many2many field dropdown, click on 'Search More' (it opens
a dialog), and in the dialog, try to save the current search in
the searchview's favorite menu.

Before this rev., it tried to retrieve the context of the active
view in the closest instance of a ViewManager-like widget in the
SearchView's ancestors.

First, it is wrong as in the given scenario, the requested context
is actually the one of the list controller in the dialog, not the
one of the form controller in the background.

Second, it produces a crash in Studio, when trying to save filters
in the dialog opened by clicking on 'Search More' on the groups
many2many field in the sidebar.

This part of the code can't be tested in this version, but tests
will be added in master.

Fixes #23293
2018-03-06 09:06:45 +01:00
Lucas Perais (lpe) 31ad2aa31e [FIX] crm: avoid timezone date change to mess with dashboard stats
Have your OS be in Vancouver with time = 15:59:00
We are on day X
Have a next activity on a lead, scheduled for today
At 15:59:00 the next activity is not overdue

Before this commit:
Past 16:00:00 the next activity becomes overdue
This is because 16:00:00 is 00:00:00 in UTC (+8 hours)
And the next activity is scheduled for day X
But in UTC, we just passed at day X+1
Hence, the next activity being overdue

After this commit:
The next activity is not overdue, since we are actually on day X

OPW 1815323
2018-03-06 08:58:06 +01:00
Christophe Simonis 2534bd19fb [MERGE] forward port branch 9.0 up to 6deed451ee 2018-03-05 18:50:51 +01:00
qdp-odoo 6deed451ee [FIX] account: fix the runbot after commit 0e881fcd3a
The previous commit forbids to change the currency of a company having accounting entries, but there are some created by demo data and some tests were trying to set a different currency (to set up a fix environment). So in order to allow that in tests, we do it via a SQL query directly
2018-03-05 17:39:10 +01:00
Simon Lejeune 6bcf9ac2ee [FIX] stock_account, sale_stock, stock_dropshipping: dropshipping valuation
Following the previous fixes in stock where we had to handle non-valued
move lines inside a valued move, the valuation of the dropshipping was
bypassed because a dropshipping move is not an in move, nor an out move.

We now value the dropshipping move always positively. We adapt the
sale_stock code that generate the anglo saxon entry to use the abs value
of the move, not -1 * value. It was done this way because all out moves
are negative.

We add 8 tests to test all the valuation cases: continental or anglo
saxon, ordered or delivered, fifo or standard.

opw-1817363
fixes #23214
2018-03-05 16:16:05 +01:00
Arnold Moyaux 476b45eb9c [FIX] stock: scheduler run cancel MTO picking
Use case to reproduce:
- Create a sale order with a stockable product.
- Confirm the sale order.
- Validate the pick.
- Validate the pack.
- Cancel the OUT.
- Run the stock scheduler.
-> Picking are created from pick and ship.

The scheduler should not try to create missing pickings
for broken move's chain. Since v11, it's not possible to create
a partial mto chain that means if a chain is broken it's due to
a manual action from a user and thus we won't automatically
repair what he cancelled on purpose. That's why we won't create
a new move out in this case.

It also don't make sense to recreate a new mto chain from a
cancelled picking. Thus we had a condition in domain in order to
only take moves that make sense.

Based on preliminary work from Florent de Labarre <florent.mirieu@gmail.com>

Closes #23441 #23458
OPW-1820226
2018-03-05 16:07:01 +01:00
Martin Trigaux 8b119e2ae9 [FIX] base: skip failed autovaccum
This patch prevents bugs fixed at 5d463d2 to block the database.
It was preventing the autovacuum to properly clean old records.
Failing to unlink (may have various different reasons) should not block the
autovacuum to try on other models

Closes #23455
2018-03-05 16:03:01 +01:00
Christophe Simonis 1bfe147f89 [MERGE] forward port branch 9.0 up to 0e881fcd3a 2018-03-05 15:00:56 +01:00
qdp-odoo 0e881fcd3a [FIX] account: forbid the change of currency_id if the accounting app has already been used 2018-03-05 14:50:22 +01:00
Goffin Simon b771dd8a5c [FIX] web: Impossible to delete a line in a tree view
When creating a record in a form view of model A, and adding a line
in an inside tree view of model B(with a One2Many from A to B), it was impossible
to delete a wrong line even if the record has not been saved because the user had no
right to delete a record on model B.

opw:1819099
2018-03-05 14:40:28 +01:00
Adrien Dieudonne 599f6a762e [FIX] web: qweb: load template with non-http xhr
Since we are able to lazy load Qweb templates, there was
an issue to generate Awesome Timesheet iOS native app with
Cordova properly. It seems that under Cordova, iOS always
returns 0 for the status on a xml http request object.

The problem is that native applications are requesting
a local file from something that isn't a webserver.

The local file is delivered with no http headers that means no
"200 OK" header and no "404 Not Found" errors.

In this case, the request is still be completing as intended even
if the status code used by browsers is 0.

For more info, see:
https://developer.mozilla.org/fr/docs/Web/API/XMLHttpRequest
https://bugzilla.mozilla.org/show_bug.cgi?id=331610
2018-03-05 14:06:23 +01:00
Nicolas Lempereur 1d6e4a6e6b [FIX] website_sale: update when changing quantity
There is several issue happening when changing quantity:

1) if website_sale_stock is installed, the displayed price is not
   updated when changing quantities.

2) if the "Add to Cart" price is not updated, it erroneously displays
   the price multiplied by the quantity.

3) when prices are updated, it only update attribute_value_ids.

4) when variant are displayed as list view, visually the last list item
   is selected instead of the first, also changing quantity doesn't
   update price as it should be given pricelist.

The first issue is caused by invalid JSON in data-attribute_value_ids
attribute. The code modify the `.data('attribute_value_ids')` thinking
it will be permanent. But if the value was invalid JSON we always parse
it on the fly inside a temporary object so the object is never changed.

The second issue is because originally, the "data-attribute_value_ids"
inside "Add to Cart" was set wrongly (when rendering the view) because
get_attribute_value_ids got the website_price multiplied by quantity.

The third issue was even with website_sale_stock is not installed
`.data('attribute_value_ids')` was only updated for one of the possible
multiple ones in the page.

With this change, we had json.dumps to ensure data-attribute_value_ids
is good JSON, and we correct errors so it is fixed for instance only
updating sources without updating website_sale and website_sale_options
modules.

note: when views are updated, this also solves a bigger issue when
python2 is used (because attribute_value_ids contained u'text' strings.

another version will be merged in master with #23467

opw-1816479
closes #23392
2018-03-05 13:02:29 +01:00
len-odoo e710e5df7a [FIX] web: show error when trying to export a report with more than 256 columns
If the user tried to generate a report with more than 256 columns,
he would get a traceback instead of an error message.
Furthermore, if only one measure was selected, then the check was not done
and the user would also get a traceback.

opw-1816931
2018-03-05 12:56:27 +01:00
Christophe Simonis 7c708bc004 [MERGE] forward port branch saas-14 up to df3c33111e 2018-03-05 12:50:58 +01:00
Julien Legros d8014a5a1e [IMP] project: add 3 indexes to project_task
This commit adds 3 indexes targeting project_task which are not only
useful in regular RW use cases, but help tremendously when deleting
tasks.

In a production scenario, deleting a single task record went from 685ms
to 5ms.

Equivalent queries for an existing database:

CREATE INDEX account_analytic_line_task_id_index ON account_analytic_line(task_id);
CREATE INDEX project_task_parent_id_index ON project_task(parent_id);
CREATE INDEX sale_order_line_task_id_index ON sale_order_line(task_id);
2018-03-05 12:12:56 +01:00
Nicolas Martinelli f7307d64b8 [FIX] mail: activities of archived records
- Create an activity for a crm lead
- Set the lead as lost

The activity still appears in the list.

A proper fix would be to have an `active` field on `mail.activity`. In
the meantime, simply delete activites when archiving.

opw-1817703
2018-03-05 11:49:42 +01:00
Raphael Collet b53c017052 [FIX] fields: use copy_cache during onchanges only
This fixes the bug introduced in rev 34c52e9938
that optimizes method `copy_cache`.
2018-03-05 11:25:37 +01:00
sum1201 d67d0caee2 [FIX] web: translate 'External ID' string
Closes #22763
2018-03-05 11:05:00 +01:00
Christophe Simonis df3c33111e [MERGE] forward port branch 10.0 up to 554afff3ac 2018-03-05 10:45:53 +01:00
Christophe Simonis 554afff3ac [MERGE] forward port branch 9.0 up to b8824913a7 2018-03-05 10:38:02 +01:00
Swapnesh Shah 1697ccc183 [FIX] sale: Re-init account.invoice.report view only if it exists
Uninstalling account gets rid of this view and since sale depends on account, it is uninstalled as well, which triggers the uninstall_hook.

Closes #23446
2018-03-05 09:15:53 +01:00
Lucas Perais (lpe) 698dffcef0 [FIX] website_sale: avoid duplicated Thanks message
Configure a thanks message on a payment acquirer which has no automatic confirmation (none value)
(The wire Transfer will do)

Make a website sale with that acquirer

When arriving on the confirmation page on the website:

Before this commit:
The thanks message was duplicated: one at the top, just under "transaction is waiting a manual confirmation"
and one at the bottom, where the actual transaction status is displayed

After this commit:
The thanks message just appears at the bottom location

OPW 1787799
2018-03-05 09:06:56 +01:00
Nicolas Martinelli 4badf49ad0 [FIX] pad, pad_project, note_pad: duplicate object
The duplication of a task crashes at the following:
`content = myPad.getHtml(path).get('html', '')`

The copy mechanism is quite cumbersome:
- In `copy` method, generate an URL of a pad which doesn't exist since
  `object_id` is still undefined.
- The `create` method somehow attempts to fill in the previously created
  pad thanks to `_set_pad_value`.

The logic is made simpler. The pad URL field is set as `copy=False`,
therefore the create mechanism will take care of handling the pad
creation and its synchronization.

opw-1818757
2018-03-05 08:42:11 +01:00
Odoo Translation Bot 566ce21d42 [I18N] Update translation terms from Transifex 2018-03-04 04:19:33 +01:00
Odoo Translation Bot 3527bc004c [I18N] Update translation terms from Transifex 2018-03-04 00:58:51 +01:00
Olivier Dony 7836b8811b [FIX] sale*: properly mark method as @classmethod
When inheriting a @classmethod, the override needs to have the
@classmethod decorator as well, otherwise calls will fail with a
TypeError
2018-03-02 18:27:18 +01:00
Olivier Dony 71ccea35ba [FIX] payment: employees should not edit acquirers 2018-03-02 18:27:18 +01:00
qsm-odoo 80f97fbd19 [FIX] website_slides: load viewer for app's iframes only
The website_slides JS was working on all iframe in all pages while it
should only affect its own ones, which contains a PDF document.
2018-03-02 18:13:22 +01:00
dduarte 99a3ba631e [CLA] PromptEquation / OdooGap signs CCLA
Closes #19223
2018-03-02 17:02:54 +01:00
Denis Zaripov 9d14229767 [CLA] D2C signs Odoo CCLA
Closes #22959
2018-03-02 16:55:44 +01:00
Hilar Ak 9e36f966f1 [FIX] hr_recruitement: remove duplicated view mode
Closes #23129
2018-03-02 16:29:07 +01:00
Hilar Ak ff9801dc69 [CLA] hilarak signs the CLA
Done at #23129
2018-03-02 16:29:07 +01:00
Martin Trigaux 796cc8a6bf [I18N] generate saas-15 translations
based on 11.0 translations
2018-03-02 16:24:13 +01:00
qdp-odoo b8824913a7 [FIX] account: fix _amount_residual() dependencies.
The computation of residual amounts on account.move.line does not use account_id.currency_id... and should not. Never.
The previous implementation was thus stupidly recomputing the amount_residual fields on all journal entries of an account as soon as its currency field was touched, for nothing.
2018-03-02 14:45:15 +01:00
tbe-odoo 4d905070f9 [FIX] payment: Unable to pay if character '/' in reference
- On 'website_payment/pay' if the reference contains a '/' the payment will never succeed.
  It is due to the fact that in the template "payment.pay" were setting "prepare_tx_url" and "form_action" using this reference.
  But having a '/' in the reference breaks the URL to call to create a transaction.
  So when creating a transaction (or even paying in S2S) the payment never succeed and returns a HTTP 404 error.
2018-03-02 14:18:47 +01:00
tbe-odoo aded844129 [FIX] mail: Check if attachment has mimetype
- Check if the attachment has a mimetype before trying to split its value.
2018-03-02 13:16:26 +01:00
Josse Colpaert 3bd2bb7aa1 [FIX] stock: avoid block of schedulers
Avoid block of schedulers when there are confirmed moves of 0 quantity.

Co-authored-by: Nicolas Martinelli <nim@odoo.com>
opw-1817784
2018-03-02 13:07:21 +01:00
Laurent Smet 515160978a [FIX] point_of_sale: don't create invoice with negative amount
When creating an invoice from POS order having a negative amount (due to return products), a credit note must be
generated instead of a customer invoice.

-github issue 23167
2018-03-02 11:57:41 +01:00
Jeremy Kersten 5ad278ac08 [FIX] web_editor: show 'open in new window' on link edit
Before this commit, when a user open an existing link in the editor
he cannot check/uncheck the option "Open in new Window" while he don't
update the url.

The field was hidden while keyup was not called.

After this commit, if the url contains a url, we show directly the checkbox.

This commit fixes opw-1819601
2018-03-02 11:56:07 +01:00
Arnold Moyaux 29f1239d1a [FIX] stock: merge move with a mix RFQ/PO
Use case to reproduce:
- Create a Product MTO that should be buy
- Create a SO with this product and confirm it
- Confirm the RFQ
- Increase the ordered quantity on the SO
- Confirm the new RFQ
- Receive product from the 2 PO
-> Unable to reserve the quantity on the destination moves

It happens because the link between the reception move from the second PO and the delivery move is missing.
Update the quantity on the SO will create a new move with the missing quantity that will generate the new RFQ
then this move is merged in the main move. However the reception move is only created when the RFQ is confirm
and the move_dest_ids is stored on the purchase order line during this time.
Thus merge moves will unlink the new move with its reference on the purchase order line and the link is lost.

This commit do not merge move that have different RFQ/PO in order to avoid losing MTO information.
2018-03-02 11:29:13 +01:00
Arnold Moyaux 738888fc30 [FIX] stock: cancel a move line in planned transfer
Use case to reproduce
- Create a planned transfer with 2 move lines (details operations)
- Leave the form view in order to lose the context then go back on the picking form view
- Delete a move line and save
The picking state change from draft to ready

It happens because planned_transfer is not in the context
then the autoconfirm is triggered.

This commit only autoconfirm if there's at least an intial demand in one of the move.

Closes #22834
2018-03-02 11:28:22 +01:00
Laurent Smet 619ee56f4e [FIX] account_accountant: allow install coa without required transfer account
Create a company, try to install a coa without specify an Interbank Transfer Account (required field):
The COA can't be installed.

-opw: 752928
2018-03-02 11:23:01 +01:00
len-odoo 004ec9d994 [FIX] l10n_in: display taxes with correct rounding
The invoice printout would display taxes as floats instead of monetary
widgets, and as such display numbers such as 3.0500000000000003
instead of 3.05.

opw-1817230
2018-03-02 11:22:13 +01:00
Goffin Simon c2e878e34c [FIX] stock: Delivery Order Issues
When printing the delivery slip of a stock.pick, the message:

"All items couldn't be shipped, the remaining ones will be shipped as soon as they become available."

must be displayed only if there is still a backorder to process for this picking.

opw:1817573
2018-03-01 18:45:55 +01:00
Christophe Simonis 5ad55264e4 [MERGE] forward port branch saas-15 up to b04c8eae6b 2018-03-01 18:02:30 +01:00
Christophe Simonis b04c8eae6b [MERGE] forward port branch saas-14 up to 153ae5e8b8 2018-03-01 17:26:43 +01:00