Commit Graph
115128 Commits
Author SHA1 Message Date
Nicolas Lempereur 1bf25fc018 [FIX] stock_account: no creating 2 def ir.property
property_stock_account_input_categ_id,
property_stock_account_output_categ_id,
property_stock_valuation_account_id ir.property default values on
product.category could be duplicated eg. if l10n_generic_coa was
installed before stock_account.

This did not happen in enterprise but happened in enterprise breaking
the test added in odoo/odoo@6bcf9ac2e.
2018-03-06 10:25:24 +01:00
Odoo Translation Bot 38ae172c3b [I18N] Update translation terms from Transifex 2018-03-06 09:33:49 +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
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
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
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
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
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
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
Denis Zaripov 9d14229767 [CLA] D2C signs Odoo CCLA
Closes #22959
2018-03-02 16:55:44 +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
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
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
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
Christophe Simonis 153ae5e8b8 [MERGE] forward port branch 10.0 up to a6855b31c9 2018-03-01 16:51:37 +01:00
Thibault Delavallée 5cd0dba0aa [FIX][IMP] project: set unusable group by as invisible
This commit is a better implementation 9b2450e8b6 for stable as it has less
impact on existing data.
2018-03-01 16:25:51 +01:00
Nicolas Martinelli 2d6c2a7dca [FIX] website_crm_partner_assign: modify lead
- As admin, create an opportunity
- Under the tab Assigned partner set the portal user
- As portal user go to My account > My opportunities > Edit opportunity
- Change something

Confirm button doesn't work. In fact, an access error is raised silently
in the JS console.

The issue is raised in `update_lead_portal`, at `lead.activity_ids...`.
This is because the field `activity_ids` has
`groups="base.group_user"`.

opw-1817935
opw-1818629
2018-03-01 16:18:57 +01:00
Géry Debongnie 132137939c [FIX] web: prevent footer from being rerendered
In some cases, the footer in a form view dialog could be duplicated.
The reason was that the form view was rerendered completely, footer
included, by the renderer, out of the formcontroller control (it is the
formcontroller's job to move the footer buttons to the footer).

A possible fix is to work on the form renderer to make it aware that the footer
buttons are expected to be only rendered once, but it has the disadvantage to
be a fix specific to this issue, and any other form view behaviour with some
side effects may have the same issue.

This commit tries to prevent the form view from rerendering itself
completely in those cases. This also has the disadvantage of possibly
not being a complete fix, if some edge cases are missed.  However, I
have the feeling that we still want to avoid rerendering the full view
if possible.
2018-03-01 16:08:22 +01:00
Aaron Bohy 3ad3e450e4 [FIX] web: Calendar: only highlight today
Before this rev., in week and month modes, when navigating through
weeks or months, the weekday/monthday of today was still
highlighted in other weeks and months than the current ones.

This rev. ensures to only highlight today in the main calendar
view (this doesn't impact the mini calendar).
2018-03-01 15:31:16 +01:00
Christophe Matthieu f4bca15520 [FIX] account: Reconciliation display correct display_name in many2one
Issue: When using many2one select dialog, the the field (eg. Account)
display the previous value.

opw-1819832
2018-03-01 13:45:19 +01:00
Christophe Matthieu ad57bfd2e8 [FIX] web: mock_server name_search use limit kwarg
We need support the limit arguments for name_search in unit tests.
2018-03-01 13:45:19 +01:00
Nicolas Martinelli 9dfe2ef391 [FIX] website_quote: view quote
- Create 2 SO for the same customer
- Send them
- As the customer, click on 'Accept and sign online' for both quotes.

The message 'Quotation viewed by customer' is only posted on the first
quote.

opw-1815082
2018-03-01 13:41:30 +01:00
Christophe Simonis a6855b31c9 [MERGE] forward port branch 9.0 up to d4ec6b75ac 2018-03-01 13:25:10 +01:00
Thibault Delavallée 9b2450e8b6 [FIX][IMP] project: remove message_last_post groupby in task
This filter groups tasks based on a message_last_post field that is not
updated anymore since quite a long time. It has been implemented for some
internal custom use and not supported since.

As this field has no use and lead to wrong result it has to be removed. Its
purpose can still be achieved in custom using server actions activating the
message_last_post context key and adding the field in custom views.

Done after feedback from internal migration.
2018-03-01 12:11:16 +01:00
Thibault Delavallée c574490a66 [FIX][IMP] project: include emails in customer portal
Customer portal has a widget to display a chatter-like communication
history. However only user comments are displayed. It seems interesting
for documents like tasks that also include tickets and support to
display incoming emails. Indeed most customers will use their email
to discuss with the responsible.

Done after feedback from internal migration.
2018-03-01 11:56:22 +01:00
Thibault Delavallée 66984ab90a [FIX][IMP] project: add task # in portal view
As tasks are now used for a lot of use cases including tickets and support
it seems fair to include the task ID as reference in the portal view
for customers. It eases the communication process as people can directly
give the reference (aka ID).

This commit therefore adds a column in portal list view with the task ID
as reference. It also adds it in the portal form view, just after the
task name.

Done after feedback from internal migration.
2018-03-01 11:56:14 +01:00
Swapnesh Shah 685f4eff50 [FIX] purchase: set date_approve on order confirmation
Restore behaviour before the workflow removal

Closes #23306
Fixes #23273
2018-03-01 11:55:42 +01:00
tbe-odoo d4ec6b75ac [FIX] yaml tests: Allow use of context inside context evaluation 2018-03-01 11:03:40 +01:00
len-odoo 3ca9661ab4 [FIX] event: move calendar block in the template
The `location` variable was used before it was set in the event reminder in
the email template.
Introduced at f8c6c76

When rendered, the links to add the event to a Google/Yahoo/Outlook calendar
were not set the event to the correct location

opw-1818699
2018-03-01 10:18:50 +01:00
Goffin Simon bb6039369c [FIX] delivery, website_sale_delivery: Delivery Methods and multicurrency
Steps to reproduce the bug:

- Set your company currency to USD
- Set multicurrency on your user
- Create a delivery method with a fixed price to 50$
- Create a SO with a pricelist in EUR
- Set the delivery method and check the price

Bug: It displayed 50€ while this amount should be converted

opw:1817666
2018-03-01 09:37:44 +01:00
Laurent Smet 0b0fdb9bd1 [REF] base: improve User error message when duplicating company 2018-03-01 09:13:37 +01:00
Odoo Translation Bot fd032df4d1 [I18N] Update translation terms from Transifex 2018-03-01 02:39:27 +01:00
Joren Van Onder 0060e86858 [FIX] pos_mercury: don't attempt negative transactions
Normally Vantiv should return an 'Invalid Purchase Amount' error. But
sometimes they will process the transaction anyway as if it had a
positive amount. We're sure the amount we send is negative. After
communicating with Vantiv it's unclear why that sometimes
happens. They recommend to explicitly prevent negative charges and to
not rely on them throwing an error.

Since we have to display an error message to the user anyway we take
the opportunity to explain the correct full flow to handle refunds.

opw-805302
2018-02-28 10:42:18 -08:00
Joren Van Onder 9049e53d21 [FIX] pos_mercury: don't 'Wait for swipe' for negative payments
We don't support refunds this way. Instead these should be handled
separately through the Vantiv backend.

opw-805302
2018-02-28 10:42:15 -08:00
Christophe Simonis 9d25cc3429 [FIX] *: correcly format amounts in mail templates 2018-02-28 19:01:35 +01:00
qsm-odoo 6693e3181a [FIX] doc: adapt theme tutorial with new page records
Before this commit, the theme tutorial was still creating pages using
`<template page="true"/>`. This was not just outdated, it was also
making the whole created theme fail to load.

Closes https://github.com/odoo/odoo/issues/21243
2018-02-28 18:14:47 +01:00
tbe-odoo 49255e7d76 [FIX] sale_timesheet: Multicompany invoices with timesheet
- Assuming a sale order invoiced in a different company.
  The sale order line's invoice_lines fields will be empty, which causes issues with sale_timesheet.
  The code assumes that if the sale order line invoice status is set to 'invoice', it has at least one invoice line, which is not true.
  This patch address a fix for this issue.
2018-02-28 17:19:22 +01:00
qsm-odoo b9d217c4f5 [FIX] website_form: button seemed buggy while it was actually disabled
Thank you to @Yajo
Closes https://github.com/odoo/odoo/pull/21628
2018-02-28 17:09:17 +01:00