Commit Graph
104130 Commits
Author SHA1 Message Date
Christophe Simonis 64e73b8352 [MERGE] forward port branch 9.0 up to 290601e 2016-11-22 12:39:02 +01:00
Pierre Masereel 290601e28f [FIX] purchase: update order_lines date_planned
When we are trying to use the button 'set date to all order lines, we
get a traceback saying, that update cannot be done, because it ensure
that there's only one record. (After 9.0, there is no more this
'ensure_one').

This bug has been introduced in rev: https://github.com/odoo/odoo/commit/401a3cfaf6fd09f594e45c181e908900acba3777

To fix it, we iterate over the order lines, and do the update of each
line.
2016-11-22 12:13:23 +01:00
Martin Trigaux c3756b7d9a [FIX] base: avoid duplicated translations after update
This commits fixes the following scenario:

1. load the translations for any language
2. modify the source of a translated record (e.g. email template body)
3. click on 'load translations' button (flag)
4. execute the translation wizard for the same language (to refresh)
The translation of the modified record was duplicated.

This was due to the field src in the database being different than the msgid in
the po file. The src value is updated on the insert_missing call.

The matching on src for type='model' translations is only needed due to the
translations that are split (e.g. xml views or html content). For the other
translations, matching on the rec_id is enough.

Detects the xml_translate and html_translate fields to avoid matching on src for
these translations.

opw-691752
Closes #14310
2016-11-22 11:33:32 +01:00
Christophe Simonis 00bdac7280 [MERGE] forward port branch saas-6 up to 67c9e4f 2016-11-22 11:29:08 +01:00
Christophe Simonis 67c9e4f643 [MERGE] forward port branch 8.0 up to 954fb6d 2016-11-22 11:26:59 +01:00
Richard Mathot 1adedfa977 [FIX] ir.actions.server: Vous bluffez, Martoni! 2016-11-22 11:20:02 +01:00
Goffin Simon 37c1070495 [FIX]account: customer invoices with analytic account
-amount_currency in model account.analytic.line is a related field to move_id.amount_currency
where move_id is an account.move.line

-amount_currency is computed in function create on model account.move.line by considering that
amount = debit - credit (since 8.0)

-amount in model account.analytic.line is computed by considering that
amount = credit - debit (since 8.0) in the function _prepare_analytic_line.

So when creating a customer invoice with an analytic account in another currency, the created
analytic line has an amount which is the opposite of its currency_amount.

This commit also reverts the commit 7fca8ad89e to keep the same
behavior as in 8.0 for the creation of an analytic line from:

- an expense
- an invoice
- a task

The computed not stored field analytic_amount_currency displays the currency amount with the right sign.

opw:694085
2016-11-22 10:37:25 +01:00
Jairo Llopis 954fb6da3c [FIX] website_event_sale: Preserve context when updating cart
Without this patch, when a product was added to cart, if this addon
was installed, it always landed in English in the SO.

This happened because the context, containing the current language,
was being aborted here (`context=None` instead of `context=context`).

This commit closes #14340
2016-11-21 22:18:48 +01:00
Wolfgang Taferner 3ea4fb92b3 [FIX] base: user partner must be kept global on company switch
Introduced when migrating base to new API with 7eab8e2.

closes #14374
opw-694319
2016-11-21 16:28:55 +01:00
Pierre Masereel 849911154f [FIX] stock: recheck quants availbility when partially available
When a picking is partially available, and the company works in 'just in
time', they often need to re-check the availability of some products
just before sending them.

In 8.0, it was totally possible, to recheck the availabilty of products.

To fix this, we just add a button when the picking state is 'partially
availbale', which does exactly the same as 'Reserve', but is secondary
and contains the label 'Recheck availability'.
2016-11-21 16:16:30 +01:00
Nicolas Lempereur a6e3ae6b8c Revert "[IMP] web_editor: don't lose modified code view content"
This reverts commit 897290dd3f.

It seems it breaks other use case, since this was fixing more a
usability thing (need to click back on code view to save code view
changes) it is better to revert than to add drawback.

A better fix should be introduced, or the solution would be to not fix
it and have a warning indicating what needs to be done.

opw-693052
2016-11-21 14:22:14 +01:00
Nicolas Martinelli 401a3cfaf6 [IMP] purchase: set scheduled date of lines
Commit a572b8115c removes the inverse function of the `date_planned`. This
is necessary to avoid unexpected changes of the scheduled dates.
However, this removes the ability to set the scheduled dates of all
lines at once.

This commit introduces back the functionality thanks to a new button.
This way, the functionality remains without unexpected behavior.

Backport of rev: https://github.com/odoo/odoo/commit/2cf80e00752c68e443b0cd442ee50f7d6daaa455

opw-692873
2016-11-21 13:52:10 +01:00
Nicolas Martinelli a572b8115c [FIX] purchase: do not reset expected date
A misleading behavior occurs with the recomputation of scheduled date.
Here is the use case:
- Create a PO with 2 products
- For the product 1, set the scheduled date to today + 7 days
- For the product 2, set the scheduled date to today + 14 days

When saving, the scheduled date of product 2 is reset to today + 7 days.

This is of course unexpected, but moreover, a different behavior can
happen depending on how the scheduled dates are modified. In the
previous case (both products have now the same scheduled date), one can
observe 2 situations.

Case 1.
For the product 2, set the scheduled date to today + 14 days and save.
In this case, the scheduled date of product 2 is not reset.

Case 2.
- For the product 1, set the scheduled date to today + 8 days
- For the product 2, set the scheduled date to today + 14 days

In this case, the scheduled date of product 2 is reset to today + 8 days
when saving

The reason of a different behavior in the 2 situations is that the
scheduled date of the PO is changed in case 2 and not in case 1. Since
the scheduled date of the PO is changed, it triggers the inverse
function `_inverse_date_planned`.

When saving, it is not possible to know whether the scheduled date of
the PO was changed on purpose by the user or recomputed. There are 2
solutions to get a consistent behavior:

- Force the scheduled date of each line to be the same than the
  scheduled date of the PO. However, this makes the scheduled date of
  the line useless.
- Do not change the scheduled date of the lines when the schedued date
  of the PO is changed. However, this removes the ability to reset
  automatically the scheduled date of the all lines at once.

This is the second solution which is chosen with this commit.

opw-682934
opw-684063

Closes #12904

Backport of rev: https://github.com/odoo/odoo/commit/4326d864d83125abc8f82dfb0089021abf22f9ca

opw-692873
2016-11-21 13:50:52 +01:00
Denis Ledoux 10b730af8a [FIX] stock: fix stock picking done quantity computation
This is an oversight during the port of
3de53fa165
in the forward port revision
3a2147d95c

In the revision 3de53fa165,
the code has not only been moved,
but the variable passed to the method `rereserve_quants`
argument `move_ids` changed as well.
This has been missed during the port of the revision.

This leads to the invalid computation of the `done` quantity
in the pickings in some cases were the quants need to be
re-reserved.

opw-690244
2016-11-21 13:23:22 +01:00
Nicolas Martinelli bcf1e38af8 [FIX] stock_account: refund supplier invoice
When Anglo-Saxon accounting is activated:
- Use two different accounts for Input/Output for Stock Valuation
- Create a vendor bill ==> by default, the Input Account for Stock
  Valuation is used
- Validate the vendor bill
- Refund the vendor bill

When the refund is created, the Output Account for Stock Valuation is
used. There is actually no obvious reason to use this account instead of
the account originally used.

opw-691571
2016-11-21 12:43:02 +01:00
Goffin Simon ab279d9cea [FIX] stock_account: _get_anglo_saxon_price_unit
When getting the price from a account.move.line, the uom set
on the line must be taken into account.

Before the fix:

-Set anglo-saxon accounting
-Create two units of measure Box and Mot where 1Mot = 10Box
-Create a stockable product with Box as unit of reference and set with
real price and perpetual
-Create a SO with a Mot of this product
-Confirm the SO and create the invoice
-Validate the invoice

Bug:
In the journal of entries, only one box was counted for the debit and the credit
instead of 10.

NB: The function _get_anglo_saxon_price_unit must return the price unit of the
product in the unit of measure of the account.invoice.line.

opw:693075
2016-11-21 10:50:12 +01:00
Odoo Translation Bot f9f562339f [I18N] Update translation terms from Transifex 2016-11-20 02:58:43 +01:00
Odoo Translation Bot 6b55032e1a [I18N] Update translation terms from Transifex 2016-11-20 00:39:36 +01:00
Christophe Simonis 4e7eda8b85 [MERGE] forward port branch 9.0 up to 95abb22 2016-11-18 16:46:53 +01:00
Christophe Simonis 95abb2224d [MERGE] forward port branch saas-6 up to f163f76 2016-11-18 16:34:52 +01:00
Christophe Simonis f163f76b85 [MERGE] forward port branch 8.0 up to 205b554 2016-11-18 16:06:49 +01:00
Richard Mathot 07de6ad491 [FIX] website_livechat: don't crash if user has no image set 2016-11-18 14:58:45 +01:00
Odoo Translation Bot eed11c57bb [I18N] fetch es_AR terms
The translations have been removed but was not fetch due to --minimum-perc argument
2016-11-18 12:54:21 +01:00
Damien Bouvy 205b5542ca [FIX] payment_paypal: accept PDT requests on /dpn route
It seems Paypal does not always send the same responses on auto-return
even when PDT is off. Although not reproducible on a Paypal sandbox,
sometimes the system auto-return to /payment/paypal/dpn without any
meaningful POST data. This seems to only happen with new accounts
that use the 'Hermes' web application of Paypal.

The correct thing to do would be to add a new field on the paypal
payment provider for PDT token and make the PDT flow available
to users; but this is a stable branch and this fix is already
sufficiently delicate. This shall be done in master though.

From this revision on, users can then activate PDT on their paypal
account, set the PDT token as an ir.config_parameter value (WITH
GROUP RESTRICTION SET TO ADMIN/SETTINGS GROUP!!!) and the system
will process these requests correctly.
2016-11-18 09:46:37 +01:00
Denis Ledoux 4769ed4eb7 [FIX] base: unique bank account number constraint too restrictive
There is a multi-company record rule on `res.partner.bank`,
meaning you cannot see the bank accounts of other companies.

Making a constraint on `sanitized_acc_number` alone prevent
to create a same bank account into different companies,
while you cannot see this bank account from the other
companies.

In this case, the user tries to import its bank statement,
and it contains a bank account which already exists
in the database but for another company than the one
he is currently importing the statement, and,
 - it cannot find it because of the multi-company rule,
 - it cannot create it because of the constraint

The constraint must take into account the company

opw-690969
2016-11-17 19:05:00 +01:00
Goffin Simon 8a767512c7 [FIX] sale, sale_margin, website_quote: Quotation template doesn't set purchase_price
When making a SO line manualy, the purchase price is automaticaly set but with a quotation
template, the purchase price was not set.

opw:693751
2016-11-17 16:15:20 +01:00
Christophe Simonis 3b2f4e244f [MERGE] forward port branch 9.0 up to 7ee09ed 2016-11-17 14:37:19 +01:00
Christophe Simonis 7ee09ed0c1 [MERGE] forward port branch saas-6 up to 6d8d7a5 2016-11-17 13:11:04 +01:00
Christophe Simonis 6d8d7a5970 [MERGE] forward port branch 8.0 up to 8e8b792 2016-11-17 12:41:45 +01:00
fwi-odoo 25888f4195 [FIX] web: Deleting items in list view does not reset min to 1
When all the items of the first list view page were deleted,
the list view was not reloaded correctly and no records were displayed.
2016-11-17 11:31:35 +01:00
Goffin Simon 84d5216a73 [FIX] sale: vendor bill with a SO reference
If the PO and SO have the same sequence, the source document of
vendor bills and customer invoices could be the same.

opw:693991
2016-11-17 09:21:41 +01:00
Denis Ledoux 232b0d18ac [FIX] account: oversight in forward-port.
The revision
a1d6c2d631
has been ported with an oversight:
except_orm is no longer imported in this file,
besides, the new way to raise these warnings is to
use "UserError" instead.

opw-693779
2016-11-16 17:38:06 +01:00
qsm-odoo 8625242884 [FIX] web: properly destroy nvtooltips when switching views
If the graph view was left while a nvtooltip was shown (thanks to
keyboard shortcuts or during loading time), the nvtooltip remained
and was only destroyed when leaving the action.

Now they are automatically removed with the view as they are now
placed inside of them instead of inside the body element.
2016-11-16 17:27:40 +01:00
Goffin Simon 164b8ed01a [FIX] website_sale: Set the selected state in the visible select tag
When there is a shipping address, this is the second select tag which
is used(defined in website_same_delivery/views/website_same_delivery.xml)

opw:693127
2016-11-16 17:11:10 +01:00
Denis Ledoux 51882ea70c [FIX] account: force to choose a refund sequence
On an accounting journal, when checking "Dedicated refund sequence",
choosing the refund sequence is mandatory. This is the subject of the
below revision:
d94c449547

Since the refund sequence field was available only for with the debug
mode, the user was not forced to choose the sequence, while he must be.

This is not possible to use the dedicated refund sequence if you do not
choose it there.

opw-693955
2016-11-16 16:26:29 +01:00
Olivier Dony 8e8b7925d2 [FIX] hw_escpos: auto-detect endpoint address
Instead of hardcoding the IN & OUT endpoint
addresses for the ESC/POS printers, we now
attempt to auto-detect them.

This should increase compatibility with many
compatible thermal printers that are simply
using a different address, such as the
- STMicroelectronics POS58 Printer USB
- HU HAI SUNCSW Receipt Printer Co.,Ltd. Gprinter USB Printer

Fixes #12890
2016-11-16 14:52:34 +01:00
Nicolas Lempereur 897290dd3f [IMP] web_editor: don't lose modified code view content
The scenario when using the code view is the following :

- click on code view button to use code view
- make changes
- click on code view button to get back to wysiwyg view
- save from the wysiwyg view

If the 3rd step is not done:

- for the inline editor, we lose the changes that have been done in code
  view,
- for the iframe editor, we lose the entirety of the content.

At one time the user was forced to go back to wysiwyg before being able
to save, but this have been removed hence the present usability issue.

With this fix, when the editor content is saved, if the user is in code
view he is automatically set back to wysiwyg view.

closes #14339
opw-693052
2016-11-16 14:06:01 +01:00
qsm-odoo 2e0a300016 [FIX] web_calendar, web_kanban: open form view in edit mode after edit button
Some buttons in kanban records or event records allowed to open a form
view in edit mode. The feature was lost with commit
https://github.com/odoo/odoo/commit/46857d26#diff-fc48ba68abe25af0106d66b6ea2ec73eL116

Indeed the "do_switch_view" method signature changed but some calls
still used three arguments instead of two, losing the options param.
2016-11-16 13:40:37 +01:00
Josse Colpaert 1de37862d6 [FIX] stock: when matching moves with pack operations through quants, it did not match the packages correctly. Courtesy of Pedro Baeza
Before, it did a search to see if the package existed,
but the only thing it needs to do is see if the package
on the pack operation corresponds to that of the quant.  (no need to check children also)

There is a test added:
A picking with 120 pieces incoming, 120 in pack 1, 80 in pack2
When we deliver those in a picking out, with product pack operations: (by taking them out of the pack)

120 from pack 1 and 80 from pack2,
we should only have 2 quants and links between moves in the end

And before, it generated 3 because it matched the wrong quants and made the wrong links.

opw 693760 closes #13836
2016-11-16 11:26:20 +01:00
Raphael Collet 51680426a6 [FIX] fields: convert_to_cache() on cached values for relational fields (#14328) 2016-11-15 14:45:46 +01:00
Christophe Simonis 58f68ccb72 [MERGE] forward port branch 9.0 up to 3bad13d 2016-11-15 11:06:15 +01:00
Leonardo Donelli 814c2e83cc [FIX] hr_timesheet: AccessError editing timesheets
Make department_id of account_analytic_line readonly, so that when the field is written it is not also propagated to the employee, which
may fail when the user has write access to timesheets but not to employees.

Fixes #14084
2016-11-15 10:56:23 +01:00
Kumar Aberer 9f172a61e0 [FIX] Check accounting lock date before cancel account moves
Error message is shown when trying to cancel account moves that are
prior to the accounting lock date.

opw:693083
2016-11-15 10:15:24 +01:00
Goffin Simon 3bad13d650 [FIX] point_of_sale: closing balance access rights
In 9.0 when the pos user was not at least in the group Accountant
(group_account_user), he was not allow to close or open the balance
when the pos session was configured in cash control.

ps:be carefull with the old rule: Point Of Sale Cashbox Line POS User
deleted with a26b805f5e

opw:69251
2016-11-15 09:30:10 +01:00
Nicolas Lempereur f2abde5659 [FIX] base: binary url attachment on windows
On windows when opening a binary file a 'b' flag is to be used:
 https://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files

Before this commit, /web/image/* and /web/content/* routes serving
an ir.attachment with url could return empty or truncated content.

opw-693306
2016-11-14 22:44:34 +01:00
Christophe Simonis 1c21faafb9 [MERGE] forward port branch 9.0 up to 7be6c74 2016-11-14 17:26:28 +01:00
Olivier Dony 46ce74cdde [FIX] hw_posbox_homepage: update links and version
Also added a direct link to the remote connect page to
grant remote SSH access via ngrok.
2016-11-14 17:11:57 +01:00
Olivier Dony 265c9f7b06 [IMP] hw_proxy: add lsusb full output to hw status page 2016-11-14 17:11:57 +01:00
Olivier Dony d1b0b9e656 [FIX] point_of_sale: check required commands before building POSBox image 2016-11-14 17:11:57 +01:00
Olivier Dony f579acf02f [FIX] hw_scale: update driver for rs232_devices map and support AdamAZExtra scale
This commit fixes the driver to respect the new device
registration mechanism via hw_proxy.rs232_devices.

It also refactors the code to more easily support multiple
scale protocols, and introduces support for the ADAM Equipment
AZExtra scale protocol. (Might be compatible with other ADAM
Equipment scales)

Support for th AZExtra scale is experimental at the moment,
especially given two annoying problems with this model:
 -  they do not support proper probing (stays mute until a
    non-zero weight is measured), so they have to be probed
    last and *assumed* to work
 -  the scale beeps when a read attempt is made and the
    weight is not stable yet, or the weight has been already
    read previously. This constant beeping during operation
    is mitigated by extra delays between readings, but might
    still prove to be a major issue for supporting this scale.
2016-11-14 17:11:57 +01:00