Commit Graph
123074 Commits
Author SHA1 Message Date
Odoo Translation Bot a463a87189 [I18N] Update translation terms from Transifex 2019-02-17 01:33:04 +01:00
wan e136a8e746 [FIX] account: fix rpc concurency in reconciliation widget
When there are lots of lines to be considered, the rpc can come in the wrong order, causing the client to not display the wanted lines. By asking the user to hit enter or leave the input field, we reduce the number of requests and we get rid of the concurency of rpc

closes odoo/odoo#30280
2019-02-15 10:24:09 +00:00
Mathieu Duckerts-Antoine 24b0f092b4 [FIX] web: remove human_number limitations
The formatting of very big numbers (like
1.0045e+22) was not handled adequately by
the function 'human_number' in web.utils.
For those numbers, it seems more appropriate
to use the scientific format. The only
difference introduced here is the following.
Beyond a magnitude of e+21, we represent the
numbers by themselves but we keep the
number of decimals provided as parameter
(or zero by default) and we remove useless
zero decimals like in the other cases.
For instance, 1.0045e+22 is replaced by 1e+22
instead of 1.00e+22 if ask 2 decimals of
precision (and by 1.005e+22 for 3 decimals).

We have also fixed a small bug occuring in the
previous version of the function: the symbol
'E' was never used. So by the past the above
number would have be represented as
10045000P and, even worse, 1.01e+45 by
1.012e+28P.

closes odoo/odoo#31140
2019-02-15 10:51:01 +00:00
Nicolas Lempereur 03e80650c7 [FIX] website_sale_stock: no edit out of stock msg
On a product page on the website, with website_sale_stock there may be
an information about the product being out of stock or not.

This information is loaded on the fly for the current variant (switching
variant will reload it) and so this should not be modified with the
editor because:

- the saved edition would appear on all product (even if those in stock)
- the saved edition is replace quickly with the real state

So if we want to change the content, there is no other way than a custom
change on JS template website_sale_stock.product_availability or
modifying translations.

opw-1936179
closes #31135
2019-02-15 10:23:43 +00:00
Xavier Morel bb7b121206 [FIX] core: various issues & deviations from client's behaviour in Form
* Form would entirely mis-interpret the server's response to some
  results: for unmodified o2m records the server sends a (4), which was
  un-interpreted by Form, leading to the o2m record being lost entirely
  (as it rebuilds the entire o2m on setting)
* on record creation, every field (except id) is considered modified not
  just the fields set by default_get
* Form diverged from actual client in that it would send (1, id, {}) for
  unmodified o2m records, actual client sends (4, id, False)
* datetimes should be sent stringified
* onchange should not be triggered when none of the modified fields is
  flagged as an onchange trigger
* the default value for numerical fields is 0 not False
* convert m2m onchange results to (6, False, ids) instead of (6, 0, ids)
  for ease of diffing with actual client's data

There are still a few odd divergences in the actual invocation of
onchange when attempted on an SO, but they look to be of low relevance
/ risk.

Note: making integer fields "required" has pretty much no effect
      anymore. This is in line with (my understanding of) the client's
      behaviour, but required the alteration of test models as the
      specific test on required... was using an integer field.

closes odoo/odoo#31064
2019-02-15 10:54:44 +00:00
Mathieu Duckerts-Antoine 84abddfe90 [FIX] web: quotes and backslashes in search view
The commit 6d3ada1
aimed to solve problems occuring whith (single or
double) quotes when creating new custom filters.
Unfortunately, the point was missed and bugs were
still present. The present commit solves the
orginial problem satisfactorily.
There was also a problem in the management of
backslashes. Type '\\' in the search bar would
lead to a domain like
[('...', 'ilike', '\\\\\\\\\\\\\\\\')].
This has also been fixed. Note that it is
necessary to input "\\" if one is looking for a
backslash in db (as before).

A remark on the _formatAST function (py_utils.js):

We deescape only the chars `'`, `"`, and `\`
because it does not seem possible to produce a
string in the search view that would intend a
search for a line return or a tab for example.

A general remark:

Domains should always be in normalized form.
In that way they could be manipulated and combined
together without a tokenization/parsing!

closes odoo/odoo#31025
2019-02-15 12:38:22 +00:00
Julien (juc) Castiaux 988e769073 [FIX] mail: non translated field when posting emails from crons
1) Configure both an incoming mail server and an outgoing one.
2) Install CRM.
3) Create a sale team, use the incoming mail address as mail alias.
4) Add a user with a valid email as follower of that team in the
   chatter.
5) Enable developer mode, become super user via the developer tools.
6) Change the language of the super user to french.
7) You may want to modify the default gather/post time interval.
   to receive/post email more regulary in the scheduled action.
8) Using an external mail client, send a mail to the incoming mail
   address.
9) Let the two scheduled actions run by themselves.
10) The mail sent to the user has the "Lead/Opportunity" in english
    wheras the rest of the email is in french.

opw-1917993

closes odoo/odoo#31034
2019-02-15 12:41:50 +00:00
Lucas Perais (lpe) 24b771f16a [FIX] account: no chart tests with minimum 1 journal
This is a fixup of:
- original commit: 0d48056d63
Fixed the execution of no-chart tests in sale_timesheet standalone
i.e. launching odoo with `-i sale_timesheet --test-enable`

- commit 6eed6a503b omitted those fixes

This commit put them in the parent class, since it is always useful to have
sale journals

OPW 1939361

closes odoo/odoo#31119
2019-02-15 08:21:27 +00:00
Nicolas Martinelli 43ce83974b [FIX] sale: blocking message
- Set a blocking message on a product
- Buy this product from the eCommerce

A 500 error is raised.

The underlying error is a SQL constrain raised because the `name` field
of the SO line is empty.

It happens because the warning is returned too early.

opw-1934386

closes odoo/odoo#31120
2019-02-14 17:19:42 +00:00
qsm-odoo 3375822d46 [FIX] website: restore mobile preview header colors
Part of https://github.com/odoo/odoo/pull/31117
task-1941156

closes odoo/odoo#31117
2019-02-14 16:24:34 +00:00
qsm-odoo 473c954aa8 [FIX] web_editor: fix switch design (website publish btn)
Using chrome, the design was not pixel perfect (letting a white bar
appear around the switch). Replacing the linear gradient color by a
simple color fixes that particular problem. The design is still not
pixel perfect but those are meant to be replaced in master anyway.

Part of https://github.com/odoo/odoo/pull/31117
task-1941156
2019-02-14 16:24:34 +00:00
qsm-odoo bbc24e3f76 [FIX] website, *: restore and enforce Odoo UI design
* web_editor

BS conflicts with our UI again: btn sizes and form controls are
more difficult to force with BS4, this commit adapts the controls to
use less problematic sizes, and adds/adapts some more forcing rules.

Part of https://github.com/odoo/odoo/pull/31117
task-1941156
2019-02-14 16:24:35 +00:00
Nicolas Lempereur e2e0135a75 [FIX] web: first and last line chart x label shown
The graph view displaying a line chart has had some recent changes in
b23a981320. Now it is of the full width of container but when there is
less than 4 labels (thanks to c4937132a3) the first and last labels may
be cut because they are by default aligned on the middle with its tick
(so for the first label, the half left may be missing, and the last the
half right may be missing).

With this change, we align labels as expected. This could be done in CSS
sheet (with `.nv-axisMin-x > text { text-transform: start!important; }`)
but here it is done only in the given instance.

opw-1917560
closes #31116
2019-02-14 14:40:13 +00:00
Nans Lefebvre 014bab1076 [FIX] crm: do not track the description field
Commit ec35eca7c6 added the tracking on CRM description field.
However the description field changes frequently, making the tracking generate
too much (noise) messages.
Furthermore, the description field tends to be very long, cluttering the chatter
to the point of unusability.

opw 1936070

closes odoo/odoo#31112
2019-02-14 08:40:23 +00:00
Luis González d1b9c2f377 [FIX] account: Journal is overwritteng in payments by onchange
There is an onchange on payments that, when the currency is modified,
sets the journal to the first available one whose currency matches the
selected one. However, if a journal is already set, its value is
overwritten, even if its currency matches the new one.

To replicate:
- Create two banks in EUR
- Create an internal transfer from the second bank
- Set the payment currency to EUR

When you follow the above steps, the payment journal will be incorrectly
set to the first bank.

Other possible ways to replicate the issue are:
- When editing a payment already created whose journal is correct but
  whose currency is not
- When creating a payment and the journal is set before the currency

This commit fixes that issue by preventing the onchange from modifying
the journal, when it's already set.

Closes odoo/odoo#30967

closes odoo/odoo#30969
2019-02-11 15:59:09 +00:00
Lucas Perais (lpe) 7ecd750a77 [FIX] web: moment lib: update es locale
The parsing/formatting of abbreviated month name was broken.
The locale es in its version for moment 2.22.0 fixes it

OPW 1931272

closes odoo/odoo#31104
2019-02-13 13:01:04 +00:00
Jeremy Kersten 8eb1abf760 [FIX] website: reset template
Create new env with current user instead of admin.
Avoid to show odoo bot as connected into the exceptions pages.
2019-02-14 12:15:48 +01:00
Romain Derie"Romain Derie <rde@odoo.com>""Jérémy Kersten <jke@openerp.com>"
ef03db9edd [FIX] website: restore reset_templates functionality
Since AST was introduced to compile Qweb templates, the reset templates
functionality is not working anymore.
Actually, it does not even appear anymore as the conditions to trigger and show
the reset view behavior can't be True anymore.
Indeed, the code is still importing the old QWebException from odoo.exceptions
which is now just an empty class.
The QWebException that should now be used is the one from odoo.base.models.qweb

More than just a wrong import, the QWebException properties have completely
changed.

Since its last working version (Odoo 9.0), a lot of changes occured, mostly:
  - Odoo 11.0: new model website.page, which completely changed the pages
    behavior and changed the models.
  - Odoo 12.0: multi-website, which introduced the Copy On Write (COW) that
    redefined how we write on view in a website context. We now need to reset
    copied/specific views that have no model_data_id.

This fix is for a stable version. There is some flows that can't be fixed
without a refactoring or new fields (mainly because of the arch_fs being
erased when writing on `arch`, plus we can't introduce a module reload in
stable).
The goal of this commit is to fix the basic and standard case of broken views,
which is when non-technical users are breaking the views through HTML editor.

To reset the views, we will read the original arch in the XML file, as the
dev mode is doing.
To be eligible for the reset, the broken view need an `arch_fs` set. If the
view arch has been modified anywhere else than the frontend, the `arch_fs`
will be erased and the view wont be able to be reset.
As the broken views will be specific views, we will simply read the generic
view in the XML file and write it on the specific. We can't simply remove the
specific view as we might be on a specific tree.

Specific case, in case of custom views create dropping a snippet in an oe_struc
we just delete this inehrited view to allow end user to have their page back.

In some case of bad compilation in sub template, we try to guess which inherited
view, t-called view is broken by string matching based on 'last_path_node' xpath.

Add new module test_website to add tests, it will be usefull for futur test of
install/uninstall and ...

Todo in master:
  - try to track on QWebException the real template that is broken and not only
    the last node from the main template.

Co-authored-by: "Romain Derie <rde@odoo.com>"
Co-authored-by: "Jérémy Kersten <jke@openerp.com>"

closes odoo/odoo#29957
2019-02-13 20:33:18 +00:00
Romain Derie 01d925e052 [FIX] website: don't flag generic view as noupdate when COWing
Once `website` module is installed, the `save` method will always write on the
specific view or create it if it does not exist yet.
This means that actually, the generic view will never have his `arch` modified
through the `save` method.
Thus, there is no need to flag it as noupdate as we want to receive update for
that view (that might be used by other website without a specific view).
2019-02-12 15:48:24 +00:00
Sébastien Theys 5a692c3417 [FIX] website_sale: correctly set access token for cart recovery
The access token is automatically generated when calling `_get_share_url` but
for the cart recovery we don't use that standard method because we need to send
the user to a specific route, so we need to generate the access token manually.

Without this fix, the user will receive the link with access_token=False which
would lead to a 404 page.

Also added a test for the cart recovery flow.

PR: #30000
2019-02-06 09:50:46 +00:00
Sébastien Theys 4a202440b8 [FIX] website: allow scheme and port on domain (multi-website)
Before this commit, the website selection was not working when a scheme or port
was encoded in the domain field. This was not obvious or natural for the user,
because the easiest way to fill it was to copy/paste the URL from the browser.

Now it works when scheme or port are encoded, it is even strongly recommended to
actually encode them if they don't take a default value because they will be
used when creating full URL to the website (typically when sending emails to
clients where a link back is necessary).

PR: #30000
2019-02-06 09:50:42 +00:00
Sébastien Theys c1be1993f9 [FIX] *: share URL on the correct website if possible
* = base, auth_signup, mail, portal, sale, website, website_sale

Before this commit, sending an object by email would always link to web.base.url
even if the object was created from a specific website.

Now if the object has a website, we use the URL of that website if it is set.
The fallback will always be on the web.base.url.

opw-1921030
PR: #30000
2019-02-06 09:50:38 +00:00
Nans Lefebvre 3b256ba487 [FIX] sale_margin: make sale.order.line create override handle section lines
The sale.order.line model has a 'display_type' field since 762adedece
that specify if the line is a dummy line used for presentation purposes.
These dummy lines are 'section' lines or 'note' lines.
If it is the case, the line does not have a product_id.
The sale_margin module overrides the create method of lines to add the margin
computation, assuming there are no dummy lines since that part of the code
is older than the new feature.
As a result the line creation would crash on a key error on dummy lines.

We now skip the margin computation if the line has a display_type.

opw 1939881

closes odoo/odoo#31035
2019-02-13 08:24:59 +00:00
Martin Trigaux f0b3e847d8 [I18N] l10n_ch: update translations for 12.0
Some changes were not reflected in German
opw-1932126

closes odoo/odoo#31012
2019-02-12 06:38:47 +00:00
jbm-odoo 3684c8a62e [ADD] l10n_it_edi: Electronic invoicing Italy
- Generate e-invoice in xml when validating invoice
- e-invoice is sent via PEC mail and attached to the invoice
- electronic vendor bills and error/receipt messages can
be received through an IMAP incoming pec server
(configured in settings > technical)

We use the pec mail system to send invoices.  We don't manage
signed invoices for B2G.

Configuration is done on the company and the receiving partners
should have the correct codice fiscale / TVA.  On the taxes,
you might need to configure the exonerations.

You will need to configure the government mail address on the
company.  (sdi01...)  You might need to modify after the first
incoming message.

closes odoo/odoo#30845
2019-02-13 08:33:06 +00:00
Nicolas Martinelli 06cfdbaab8 [FIX] base: barcode fallback
- Set a product barcode to a 8 letters value, e.g. 'AAAAAAAA'
- Print 'Product Barcode (PDF)' (or any other report containing the
  barcode)

The barcode doesn't print.

All templates assume that:
- a 13 characters barcode is EAN13
- a 8 characters barcode is EAN8

But this assumption is too restrictive: one could want to generate
barcodes with such length without following the EAN13 or EAN8 structure.

We fall back on Code128 when the barcode generation fails.

opw-1937858

closes odoo/odoo#30912
2019-02-07 10:08:26 +00:00
Martin Trigaux 1a4f3114a7 [FIX] web: translate pivot value
"Variation" was not translated

opw-1940086

closes odoo/odoo#31050
2019-02-13 07:17:47 +00:00
mreficent 85110ce347 [FIX] account_voucher: correct api.multi in action_move_line_create
closes odoo/odoo#30924
2019-02-07 14:44:25 +00:00
Nicolas Martinelli 11dc4ec487 [FIX] project: default context key
- Activate Sub-tasks in projects
- Create a sub-task

An `AccessError` is raised in `check_access_rule` of `mail.message`.

The context is 'polluted' with a `default_parent_id` key, which is not
necessary anymore at this point.

opw-1924899

closes odoo/odoo#31022
2019-02-12 11:21:21 +00:00
Lucas Perais (lpe) 7afdfc5046 [FIX] mail: retrieve mail (sent by OdooBot) failure notification in multicompany
Let the database be in multi-company without a shared contact book.
Have user U in company B, OdooBot in company A.
From a record R created by U, have a message sent by OdooBot fail to be sent.
A new failure notification failure should be displayed for U in company B.
Have U switch from and to company B.
The failure notifications are fetched, with their info.
Commit 10d558ef2b made sure that the user had access to the record
before trying to display the notification.
However in that case U has access to R, but trying to access the mail sender
violates the inter-company record rule, since OdooBot is in another company (A).

opw 1928100
opw 1935303
opw 1939352

closes odoo/odoo#30364
2019-02-12 13:04:30 +00:00
mreficent 8c3fa3dd3e [FIX] website_event_track: correct api.multi in _toggle_create_website_menus
closes odoo/odoo#31023
2019-02-12 11:58:29 +00:00
Nicolas Martinelli 014d61c875 [FIX] hr_expense: multi-currency
- Set your company to USD
- Create an expense in EUR:
  Amount: 100
  Tax: 15% Excluded
- Validate, post the journal entries

It crashes because of a missing `.id`, but on top of that... not a
single AML is correct.

opw-1938570

closes odoo/odoo#30959
2019-02-12 09:08:32 +00:00
Nans Lefebvre 6af5051e29 [FIX] account: fix model security for multi-company
In multi-company, create a new company C.
Set the chart of account in settings, save.
You get an access right violation on account.reconcile.model.template
because you need account_user.
Since this group is supposedly dependent on another module,
a user is supposedly never in this group without that module.
Obviously, this should supposedly not happen.

opw 1938539

closes odoo/odoo#31003
2019-02-12 09:56:16 +00:00
Lucas Perais (lpe) 12cca6a5fd [FIX] web: timerange menu: descriptions are strings
On a view, define a timerange for fetching data
Save as favorite

Before this commit, the time range description were not transmitted as
strings for the creation of the filter
So, when loading the filter back, there was no description for column headers
resulting in displaying "Object [Object]" as their title

After this commit, we save in the context of the filter the description of the title

OPW 1930582

closes odoo/odoo#30992
2019-02-11 12:22:47 +00:00
Jose Morales 2d2fe7f555 [FIX] account: reconcile over-amount bank statements in foreign currencies
When a bank statement reconciles its lines with payment using a foreign currency,
there is a mix up of values between the currency set in bank statement and payment against the company currency.

Current Behavior

Company Currency: MXN
Bank Statement Currency: USD
Payment Currency: USD
Current Rate 0.05130836

1) Generate a bank statement with 990 USD.
2) Generate a payment with 1000 USD.
3) Reconcile the bank statement against the payment.

The reconcile process generates a payment with the difference (10 USD)
Before this commit, this automatically created payment took an erroneous amount,
Taking a currency-converted amount where it should not have

It was happening because the reconcile process uses the debit or credit value(Local Currency)
against bank statement line amount (Foreign Currency).

After this commit, the amount set in the generated payment because of the difference is 10 USD.

closed odoo#30623

closes odoo/odoo#30779
2019-02-11 17:06:14 +00:00
edy1192 2503a89e9e [I18N] web: Add new terms to .pot file
-There were two missing terms from the `.pot` file of the module web.

closes odoo/odoo#31008
2019-02-11 22:28:48 +00:00
Laurent Smet f8379352df [FIX] account_facturx: Fix partner detection / price_unit
- price_unit is wrong because Facturx only provide the price_total and then,
we need to divide this amount by the quantity.

- the partner detection using its name was buggy due to the 'elements' variable
that was overrided.

-opw: 1938648

closes odoo/odoo#30998
2019-02-11 14:02:10 +00:00
Martin Trigaux 3915c2d236 [I18N] point_of_sale: export source terms
Following changes made at #29269
2019-02-11 11:25:15 +00:00
Mohammed Shekha 675c26587c [FIX] point_of_sale: do not load chat windows on the POS
When the mail_service is started, if there are any running chat sessions,
Chat_windows are created and opened on the point_of_sale frontend.
They also appear in the printed receipt.

To remove them from display we create a new pos_assets_backend template,
which inherits the web.assets_backend and removes the odoobot related assets.

opw 1878185
2019-02-11 11:25:15 +00:00
Dhaval Panchal ef59e59aeb [IMP] point_of_sale: raise error instead of traceback when no journal is set
If no journal is set for the POS, the session creation would crash.
We add raise an explicit error asking the user to configure either the payment
method or the chart of accounts.

opw 1878185
2019-02-11 11:25:15 +00:00
Christophe Simonis 6e8dff1952 [FIX] purchase: correctly extract date from datetime
Oversight of previous forward-port
2019-02-11 14:23:33 +01:00
Christophe Simonis 75eec26da3 [MERGE] forward port branch saas-11.3 up to 728bb2a28e 2019-02-11 12:47:52 +01:00
Christophe Simonis 728bb2a28e [MERGE] forward port branch 11.0 up to 9553240adc 2019-02-08 19:19:57 +01:00
Christophe Simonis 9553240adc [MERGE] forward port branch saas-15 up to 9773be345e 2019-02-08 16:53:11 +01:00
Florent de Labarre d260c53d12 [FIX] l10n_fr_fec: wrong formatting
The exported CSV contains unexpected `b` characters.

opw-1937282

closes odoo/odoo#30838
2019-02-08 13:33:03 +00:00
Christophe Simonis 9773be345e [MERGE] forward port branch saas-14 up to 18228f9c4e 2019-02-08 13:28:46 +01:00
Christophe Simonis 18228f9c4e [MERGE] forward port branch 10.0 up to be689c53c1 2019-02-08 11:40:01 +01:00
Martin Trigaux b6d62f8ce3 [FIX] mail: translate activity name
This commit fixes two untranslated terms in the activity view.
From the cohort view, when clicking on a cell to see details, the title was not
translated (missing _t call).

The content was not translated either as the language was not present in the
context.
36d45175b0 was a first step to fix it but while self.record contained data,
self.record.getContext() returns an empty dictionnary (no context is set in the
cohort view).

When computing the context, check that it is not empty, otherwise, fallback on
the session context.

opw-1936855

closes odoo/odoo#30942
2019-02-08 05:34:44 +00:00
Humberto Arocha 785e5f149c [FIX] account: Reconciling multi-currency lines with fx difference
journal items does not create Tax Cash Basis Journal Entries.
[IMP] Test Case for Fully reconciling multi-currency lines and one or
more are Exchange Rate Differences which are not creating Tax Cash
Basis Journal Entries if there were any Taxed line.

Main
-

Tax Cash Basis Journal Entry creation shall not be prompted by the
reconciliation of exchange rate difference journal items.

Explanation
-

    Company's Currency EUR

    Having issued an invoice at date Nov-21-2018 as:

    Accounts         Amount Currency         Debit(EUR)       Credit(EUR)
    ---------------------------------------------------------------------
    Expenses            5,301.00 USD         106,841.65              0.00
    Taxes                 848.16 USD          17,094.66              0.00
        Payables       -6,149.16 USD               0.00        123,936.31

    On Dec-20-2018 user issues an FX Journal Entry as:

    Accounts         Amount Currency         Debit(EUR)       Credit(EUR)
    ---------------------------------------------------------------------
    Payables                0.00 USD             167.86             0.00
        FX Gains            0.00 USD               0.00           167.86

    On Same day user records a payment for:

    Accounts         Amount Currency         Debit(EUR)       Credit(EUR)
    ---------------------------------------------------------------------
    Payables            6,149.16 USD         123,768.45              0.00
        Bank           -6,149.16 USD               0.00        123,768.45

    And then reconciles the Payables Items which shall render only one Tax
    Cash Basis Journal Entry because of the actual payment, i.e.
    amount_currency != 0:

    Accounts         Amount Currency         Debit(EUR)       Credit(EUR)
    ---------------------------------------------------------------------
    Tax Base Acc.           0.00 USD         106,841.65              0.00
        Tax Base Acc.       0.00 USD               0.00        106,841.65
    Creditable Taxes      848.16 USD          17,094.66              0.00
        Taxes            -848.16 USD               0.00         17,094.66

closes odoo/odoo#30130
2019-02-08 18:24:39 +00:00
Odoo Translation Bot 1bec017c15 [I18N] Update translation terms from Transifex 2019-02-10 01:32:20 +01:00