Commit Graph
111482 Commits
Author SHA1 Message Date
Cedric Snauwaert 8fdac4b6b2 [FIX] account: payment blue lines in reconciliation were in wrong column
The problem was because in case of payment we take the abs value which should not be the case.
2017-10-27 12:29:57 +02:00
Géry Debongnie c163351e8a [FIX] web: revert to previous state when onchange fails
When an onchange fails (for example, because the onchange python code
raised a ValidationError, it is convenient to revert the form view to a
valid state, which is the previous state.

To do that, we keep in the _applyChange function the initial state, and
restore it in the case the onchange fails.
2017-10-27 11:49:19 +02:00
Géry Debongnie 416f8f6316 [FIX] web: mock server should add a __last_update field
A recent fix in web changed the field FieldImage to make sure it also
loads a __last_update field.  This is fine, except that a test in
enterprise (web_clearbit_tests) was using a field image, and failed
because it could not find the __last_update field in the demo data.

With this commit, we make sure that the mock server is always aware of
the __last_update field.
2017-10-27 11:04:40 +02:00
Christophe Simonis 4873aeb501 [MERGE] forward port branch saas-15 up to 991ba1d861 2017-10-26 20:07:36 +02:00
Christophe Simonis 991ba1d861 [MERGE] forward port branch saas-14 up to a2890c1e76 2017-10-26 19:36:23 +02:00
Christophe Simonis a2890c1e76 [MERGE] forward port branch 10.0 up to bbc226cd6c 2017-10-26 19:03:19 +02:00
Christophe Simonis bbc226cd6c [MERGE] forward port branch 9.0 up to 809aaf9e7b 2017-10-26 18:33:33 +02:00
Jeremy Kersten 809aaf9e7b [FIX] website_event: avoid double subscription
Before this commit, you was able to double click on the button when
are in registration flow. In this case, you subscribe 2 times and so
take 2x more seats, what can be annoying when you have a limited room.

In the same time, we fix the form in the form that generate
strange behaviour like some events not bubbled correctly.

The attendee form (into the modal) was inside the registration form.
$'attendee_form).on('submit') obviously failed due to this bad dom.

This commit closes opw-778191
2017-10-26 17:52:21 +02:00
Christophe Simonis 7a03426826 [MERGE] forward port branch 9.0 up to ab9b5a13e4 2017-10-26 17:47:49 +02:00
Denis Ledoux ab9b5a13e4 [FIX] l10n_ca: default stock input account for products categories
Since Odoo 8.0,
the default stock input account for product categories
in the Canadian localization is set to
`214100 CANADA REVENUE AGENCY`

This is the case since this commit:
https://github.com/odoo/odoo/commit/13dacd11c10dac853def763432829b8976604a7d#diff-2e65e26a4efc4ab95e72dbe2033141ecL294
In which the account with the XML ID 2141_en
214100 Stock Received But Not Billed
has been renamed
214100 CANADA REVENUE AGENCY

In this very same commit, the account "Stock Received But Not Billed" has been moved to the account 217100,
under the XML ID chart2171_en:
https://github.com/odoo/odoo/commit/13dacd11c10dac853def763432829b8976604a7d#diff-2e65e26a4efc4ab95e72dbe2033141ecR447

While the default value for the products categories stock input account remained the same, the account with as code 2141:
https://github.com/odoo/odoo/blob/8.0/addons/l10n_ca/account_chart_template_en.xml#L8

This is an oversight. It was not meant that way. The default stock input account for products
should well be "Stock Received But Not Billed".

In addition, a stock account is supposed to be of type assets, and not of type liabilities.

I contacted @max3903, who was a contributor of the l10n_ca localization,
and who is therefore a better expert than me regarding the Canadian localization.
He confirmed me all the above findings.

opw-775413
2017-10-26 17:31:25 +02:00
Denis Vermylen 9dee7d1e58 [FIX] sale: pricelist without_discount included taxes
When having a product with included taxes that are changed/removed with
a fiscal position, the price changes depending on if the pricelist's
discount_policy is with_discount or without_discount.

This commit aligns the without_discount behavior to the with_discount
behavior.

Note: the behaviour isn't 100% correct. The applied discount will be
      computed on the list_price, instead of the tax excluded
      list_price. If a price_surcharge is set, it will be wrong.
2017-10-26 16:11:55 +02:00
Denis Vermylen a44954b625 [FIX] sale: pricelist recursion in without_discount
Supplements https://github.com/odoo/odoo/commit/0d56dca

When basing a pricelist on another pricelist in different currency
conversion was not being made correctly, since commit https://github.com/odoo/odoo/commit/6b3a808
that changes the pricelist_item on which the currency_id is set in
_get_real_price_currency.

Also align the _get_display_price's base_price to the
_onchange_discount's new_list_price in the case where the pricelist
depends on other pricelists that are in without_discount mode as well.
2017-10-26 16:11:55 +02:00
Benjamin Willig (ACSONE) e653798d5c [FIX] hr_expense: allow inheritance when adding followers (#20319) 2017-10-26 16:01:56 +02:00
Pierre Rousseau b80b13a572 [FIX] l10n_fr_fec: change EcritureNum
opw-777652
2017-10-26 15:54:04 +02:00
Jeremy Kersten 4a3801bc58 [FIX] google_calendar: allow to use the function number_of_week for synchro
get_param return string, but timedelta wait a integer
2017-10-26 11:10:13 +02:00
Cedric Snauwaert 1c367e32d6 [FIX] account: reconciliation: fix trouble with reconciliation in multi-currency
This fixes several problems with the reconciliation widget when used with multi-currency.
- company in EUR, create invoice 25 USD, statement of 25 USD (in journal USD), try to reconcile, the amount is not correctly converted, we see two different values, can't reconcile
- company in EUR, create invoice in EUR, statement in USD journal, the amount displayed for the EUR invoice is not correct
2017-10-26 10:45:58 +02:00
qsm-odoo 6b767c8b1f [FIX] web_editor: properly show error line when saving wrong XML
When using the HTML editor, when attempting to save a syntax-invalid
XML, the error line is supposed to be displayed in red. This was not
the case anymore since saas-15. This was a simple mistake of comparison
between a stringified integer ID and its integer equivalent.
2017-10-26 10:44:07 +02:00
Josse Colpaert 365362a4a0 [FIX] mrp: on rereserve of mo, we can unlink stock.move.lots
On rereservation of an mo, it will remove the existing stock.move.lots
if no quantity was done on them.  We wanted to avoid however that it
 would remove the temporary stock.move.lots on the workorder.  On the normal
 ones however, there is also a workorder_id.  That way it would
 not unlink stock.move.lots when you had workorders.  By checking the temporary or
 not flag (done_wo) instead of workorder_id, we solve the issue.

 Courtesy of blaggacao fixes #19422
2017-10-26 09:50:33 +02:00
Christophe Matthieu e2190860a6 [FIX] web: calendar tests are good in US timezone
Calendar tests did not go into US for a timezone problem, making it more difficult to correct errors.
To do: pass all the tests js in US (with simplification for the calculations of the times)
2017-10-26 09:12:23 +02:00
Christophe Matthieu ffa4646af7 [FIX] web: calendar don't return to month mode in US
When click on the mini calendar, the calendar does not return to month
mode.
2017-10-26 09:12:11 +02:00
Christophe Matthieu 0c0fb63b0d [FIX] web: Calendar view of project tasks are displaying on the wrong day
Tasks are showing up on Wednesday when they are Thursday. Checked the dates
on the tasks and my timezone preferences are set to Americas-New York.

fix: Do not apply timezone for all day mode.
2017-10-26 09:12:11 +02:00
Aaron Bohy 6fa63eb15c [FIX] web: default value for o2m inside o2m
A traceback was raised when opening a new record for a model with a
one2many displayed inside a one2many (e.g. simply displaying the
number of records in the relation), and with an onchange setting a
default value to the inner one2many (for example, linking it to
existing records).

As the inner o2m has no subviews, it has no fieldsInfo, and the
code assumed that fieldsInfo was always set.

This was for example reproducible from v11 as follows:
  - create a product (with MTO/Buy and call for tender (need
    purchase agreement module))
  - create an SO with this product and confirm it
  - go to purchase order form view and add a move_dest_ids field in
    the tree definition of field order_line
  - go to menu purchase agreement and choose the PA generated by
    your SO
  - add a vendor, confirm the PA and click on 'New Quotation'.
2017-10-26 08:19:43 +02:00
Aaron Bohy 7b8001a847 [FIX] hr_expense,web: explicit link_to command for o2m
The ORM doesn't automatically link subrecords when it receives an
update command for a one2many. However, it may be necessary when
the default_get returns existing records for a one2many field. It
only worked before this rev. for the hr_expense model because of an
hack from 2016 (to reproduce: go to Expenses, check some expenses
from the list view, in Actions, click on 'Submit to Manager', the
new hr_expense_sheet contains the checked expenses (one2many), and
the webclient only sent an update command by linked subrecord).

This rev. fixes the problem properly: when the default_get returns
existing subrecords for a one2many field, a link_to command (4) is
generated alongside the update (1) command.
2017-10-26 08:19:43 +02:00
Géry Debongnie 0b41f21c16 [FIX] web: buttons with confirm attribute works properly
Before this commit, buttons in form view with the confirm attributes had
a peculiar behaviour:
- < saas-16: they saved the record as soon as you clicked on them, so
  the warning was basically ignored
- in saas-16+ (the new views): the button did not save the record before
  calling the method, at all.

This can be a problem, obviously.  Also, it does not seem consistent to
have a different behaviour when the user clicks on OK in the confirm
dialog, compared to a button without the confirm attribute.

So, with this commit, we just make sure that such buttons save the
record before calling the method, just like other buttons.
2017-10-25 21:51:36 +02:00
Lucas Perais (lpe) f45edfbe6d [FIX] web: image widget is dependent on its record's last_update
As a way to optimize loading, images are not necessarily fetched in db.
They have, in their url a "unique" parameter, which is the last_update date on **the record** and controls on the python-side whether it should get the image from a cache or from the db.

Before this commit, this __last_update field wasn't present in the view, so it wasn't fetched, and writes on a model's image worked but did not refresh.
The image displayed was the old one.

After this commit, when the image field widget is present, we force the loading of the __last_update field of the record.
Upon update, the image displayed is the new one.

OPW 777552

closes #20457
2017-10-25 16:39:52 +02:00
Laurent Smet 505a7f853f [ADD] account_tax_cash_basis: add hook to change the cash basis base amount account
To be able to retrieve the base amount of cash basis taxes lines, an additional move is created.
However, this additional move contains a several lines that are considered as pollution in reports.
This hook allows to move these additional lines to an another account if needed.

-task: https://www.odoo.com/web#id=35605&view_type=form&model=project.task&action=333&active_id=967&menu_id=4720
2017-10-25 15:44:50 +02:00
xmo-odoo f13cab6aa6 [FIX] website_mail_channel: unsubscription
Fixes 27280fefa9:

* `partner_id` is an `int` not a recordset
* qweb Response is lazy (the template is only looked up and rendered
  when we actually need to send the content over the wire) => the error
  would occur outside of the try..except block. Force rendering
  (`Response.flatten`) so we can handle the issue here
* Uses the HttpCase interface to contact the server over a new socket
  (same as tours & al) because using `werkzeug.test.Client` would not
  use the correct cursor (?) and so the test data would not be visible
2017-10-25 15:31:58 +02:00
Lucas Perais (lpe) 6fc0793c30 [FIX] web: column aggregates should recompute when no records
1- When viewing for example journal items.
2- Now activate a filter that would display no record

Before this commit, the column aggregates of case 2 were the same as case 1.
After this commit, we recompute the aggregate, which ever case we are in.

OPW 777660

closes #20452
2017-10-25 15:02:13 +02:00
Christophe Simonis 7bfde6e05d [MERGE] forward port branch saas-15 up to d516d39948 2017-10-25 14:20:51 +02:00
Géry Debongnie c739bcf0d1 [FIX] web: update column aggregate when field changes (list)
A list view can display the sum of all values for one field, using the
'sum' attribute.  Before this commit, this sum was not updated whenever
a field was changed (but it worked when adding a line).
2017-10-25 14:13:14 +02:00
Christophe Simonis d516d39948 [MERGE] forward port branch saas-14 up to f86141aac2 2017-10-25 13:41:16 +02:00
Christophe Simonis f86141aac2 [MERGE] forward port branch 10.0 up to 598ac60a77 2017-10-25 12:52:00 +02:00
Richard Mathot 598ac60a77 [FIX] account_voucher: fix SyntaxError introduced by e69fb3f82d 2017-10-25 12:15:53 +02:00
qdp-odoo e69fb3f82d [FIX] account_voucher: fix missing payment_id in "Pay Directly" voucher
Create an accout.voucher with "Pay Directly" as payment.
    You get something like:

                D  |  C
    --------------------
    Expenses:   x  |
    Cash:          |  x

    However, the expense line doesn't appear in the reconciliation widget
    because the payment_id is missing in the account.move.line and then, doesn't match
    the search domain for the reconciliation.

    To solve it, a payment_id is created for this line in case of "Pay Directly" payment.

    -opw: 775167
2017-10-25 12:04:38 +02:00
Christophe Simonis ea9b574ac6 [MERGE] forward port branch 9.0 up to 6366150484 2017-10-25 11:28:25 +02:00
Nicolas Martinelli afccad3578 [FIX] stock: consumable in inventory valuation
Hide consumable products from the inventory valuation view since they
are skipped when generating accounting entries.
2017-10-25 10:52:09 +02:00
Denis Vermylen 33a04354eb [FIX] product,sale: allow negative discounts in pricelist advanced formula
Between v9.0 and v10.0 a pricelist refactoring made it so negative
discounts no longer worked correctly. They should always be
included in the unit price of the product (not to be displayed as a
negative discount even if the option to display the discount is
enabled).

This commit also corrects currency conversion issues when basing the
price on another pricelist with a differnt currency, and when making
the sales order in a company with a different currency than the
pricelists currency.
2017-10-25 10:35:12 +02:00
amoyaux b7d2bb3a8b [FIX] sale: impossible to validate SO
This reverts commit a5c82b0c57.
Since can_be_expense is only available when hr_expense
2017-10-25 10:31:39 +02:00
Nicolas Martinelli 6366150484 [FIX] point_of_sale: apply fiscal position
Commit https://github.com/odoo/odoo/commit/5afb5ecd04cf49be6bedb655b187b19a65e1e02d#diff-1c14accbe350f7a177b3e81e5846861bL1363
removed the call to `_map_tax_fiscal_position`. Fiscal positions are not
applied anymore...

Instead of applying the fiscal position in the `compute_all` method as
it used to be, we apply it just before the call. This mimics the
behavior of SO/PO/Invoices, where the taxes are changed directly on the
order line.
2017-10-25 09:37:32 +02:00
Christophe Matthieu 9d7f9cc38c [FIX] calendar: don't display the created or updated record
If the user change a filtered field, the record is not always displayed.
Wrong domain construction. The automatic filter must be use to filter and
remove items from the view for the unselected and not display the selected.
2017-10-24 17:26:48 +02:00
Géry Debongnie 616eedb7e4 [FIX] web: allow onchange to modify origin field
With this commit, we allow an onchange coming from a field to modify the
same field.  This was not working for field widgets derived from an
input field.
2017-10-24 15:39:14 +02:00
Géry Debongnie d58d6e270f [FIX] web: propagate view context in all x2m operations
It could happen in some cases that a rpc coming from a view was not made
with the context of the view (and from the action).  For example,

- enable "Lots & Serial Numbers" in the inventory settings
- create a stockable product tracked by lot
- go to the inventory dashboard, on the "receipts" card click on the
  three dots and then on "planned transfer"
this link forces the context key "planned_transfer" in the action
https://github.com/odoo/odoo/blob/11.0/addons/stock/views/stock_picking_views.xml#L725
- now add a stock move to move some quantity of the product you just
  created
- see that no button appears on the one2many list
- save
- see that a button appears on the one2many list

This is an issue because the read on the o2m at the end is made with the
wrong context.  The reason is that when we fetch x2m, we create a new
datapoint of type 'list' which did not reuse the context of its parent.
2017-10-24 15:38:55 +02:00
Goffin Simon d6d901c7bc [FIX] stock: updating quantity on hand changes the source name of a product
When a stock.inventory.line was created, it changed the src translation of the
product if the user was not in english US.

opw:776528
2017-10-24 15:30:01 +02:00
amoyaux a5c82b0c57 [FIX] sale_stock: delivered quantity blocked by expense policy
Use case to reproduce
- Set a product to be expensed
- set the expense_policy to something else than no
- Do a delivery order with a picking
- Validate the picking
-> Delivered quantity to 0 and impossible to create an invoice
if the invoice_policy is delivered_quantity

It happens due to this commit 48ea59d46e
What does it do:
- The move could be generated by an expense.
- If the move has 'no' as expense policy thus we won't add it in the invoice
Problem we can't guess if the move come from an expense or not (limitation).

This commit increments the delivered quanity if the product can
not be expense anymore

opw-777139
2017-10-24 14:34:36 +02:00
Khoi Nguyen a0fad8ba6d [FIX] web: show tooltips on status bar widgets
The 'new views' refactoring introduced the usage of the "disabled"
attribute in addition to the associated bootstrap class. As a
side-effect, tooltips are never rendered when the mouse is on a disabled
button, since disabled elements do not fire mouse events.

In particular, no tooltip is shown when hovering over a disabled button
of the statusbar in debug mode. This can be observed when opening the
form view of a Manufacturing Order.

We fix this issue by requiring that disabled buttons in a status bar
never be the target of mouse events, triggering them on their
respective parent elements instead.
2017-10-24 14:03:12 +02:00
Christophe Simonis 2130478cda [MERGE] forward port branch saas-15 up to 71f6e9c6ab 2017-10-24 14:01:58 +02:00
Adrian Torres 38f1875e0b [FIX] base_action_rule: ignore uninstalled models
Before this commit, creating a base_action_rule with model X from module
A and then uninstalling module A would make the database crash because
the algorithm would look for an uninstalled model during the Registry
reinitialization.

i.e. Install project and base_action_rule, create a base_action_rule
depending on model project.task, try to uninstall Project -> BOOM!

This is fixed by checking if the model obtained is None, in which case
we log a warning (for cleanup) and skip to the next iteration (continue)

opw-777301
2017-10-24 13:36:41 +02:00
Leonardo Donelli 37003c89ef [FIX] sql_db: typo in exception message
Closes #20315
2017-10-24 13:31:29 +02:00
Christophe Simonis 71f6e9c6ab [MERGE] forward port branch saas-14 up to 9aa5f7e3d9 2017-10-24 12:38:42 +02:00
Odoo Translation Bot b26e0b9292 [I18N] Update translation terms from Transifex 2017-10-24 12:38:17 +02:00