Commit Graph
124195 Commits
Author SHA1 Message Date
Nicolas Martinelli c819fc69ee [FIX] fields, test_impex: export Datetime
- Set a TZ on the user different from UTC
- Export a record containing a datetime, e.g. the Order Date of a SO
- Import the file

The Order Date is changed on the record.

The data export is always in UTC, but the data import takes into account
the user TZ, which explains the difference.

There is no good way of solving this in stable. We have 3 choices:
1. Do nothing: the flow export then import the same data is broken, as
   explained above.
2. Export in the user TZ: if the file is imported in a third-party
   software, we break the flow.
3. Import in UTC: if the file is generated from a third-party software,
   we break the flow.

Whatever the choice is, we either break a flow or keep an inconsistent
behavior. We choose option 2, assuming that in most cases the user wants
to export the data in his TZ, therefore keeping the values displayed. We
only do it in v12 in order to mitigate the impact on existing
installations. A proper fix should be discussed for v13.

opw-1915631

closes odoo/odoo#29576
2018-12-18 07:13:34 +00:00
Nicolas Martinelli dc9e87baa6 [FIX] test_impex: use context provided
The `export` method accepts a `context` parameter, but doesn't use it.
This actually hides an incorrect test: when exporting in French, `Bar`
should be exported as `titi`.
2018-12-17 13:37:32 +00:00
Lucas Perais (lpe) 8a1f9f09c2 [FIX] account_facturx: pass all fields to compute_all in xml template
continuing commit 8f4b98e67f

OPW 1914928

closes odoo/odoo#29572
2018-12-17 10:16:18 +00:00
Jorge Pinna Puissant 9d0d5b6e8c [FIX] account: change accounting plan access
opw-1916511

When you try to change the accounting plan it sets off an access error.
To change the accounting plan it must delete and create some records in
the model 'ir.property' and none of the current security groups have
access to do it.

This issue was not present in the version 11.0 because in that version
the administrator was also the super-user.
In version 12.0 the administrator and the super-user were dissociated.

This was changed to level-up (sudo) the rights of the administrator
when the ir.property are deleted.

Note that, this fonction have two pre-existing constraints to avoid
issues when configuring an accounting plan: it can only be changed if
there are not alredy existings accounting entries;
and only the administrator can change it.

closes odoo/odoo#29493
2018-12-14 09:23:10 +00:00
Nicolas Martinelli 5f4a945182 [FIX] modules: load demo data fallback
- Create a new DB with `base_automation`, without demo data
- Switch to developer mode
- Go to Settings, then 'Load demo data', validate

A traceback occurs.

An error since the demo data in `base_automation_demo.xml` are pointing
to `model_base_automation_lead_test`, which is a test model. It is
therefore not created whithout demo data. The error is:

```
bad query: b'RELEASE SAVEPOINT "5159....."'
```

However, that's not the real crash. Indeed, in case the installation of
demo data crashes, `demo_failure_todo` is supposed to handle the
situation like a boss. But in this case, the DB cursor seems unusable.
Therefore, the following crashes like a gros caca:

``` python
todo = env.ref('base.demo_failure_todo', raise_if_not_found=False)
```

Solution: use a new cursor.

opw-1916918

closes odoo/odoo#29528
2018-12-13 18:22:34 +00:00
Odoo Translation Bot 3ce5c8bebd [I18N] Update translation terms from Transifex 2018-12-16 01:18:51 +01:00
Lucas Perais (lpe) 8f4b98e67f [FIX] account_facturx: template should compute taxes with partner
Otherwise account_tax_python will crash if 'partner' triggers a condition

OPW 1914928

closes odoo/odoo#29539
2018-12-14 10:09:01 +00:00
Lucas Perais (lpe) 7bc849c3a6 [FIX] account: journal dashboard shows invoices and refund for given journal
Have an invoice and a credit not in one journal
Go on the dashboard for journals

Before this commit, the count of invoices in draft took into account
both invoices and credit notes, while clicking on the button to see the invoices/credit notes
only showed invoices

After this commit, clicking on the button show both invoices and credit notes

It is worth noting that this is the behavior in v11.0
And that the way the dashboard is computed cannot allow to differentiate
within the kanban records, invoices and refunds as two separate buttons

OPW 1916135

closes odoo/odoo#29482
2018-12-12 15:46:30 +00:00
len-odoo f3b341b6b9 [FIX] fleet: make _name_search not override driver_id in domain
The _name_search did override the domain's search
by OR'ing it with a loose condition on the driver_id.
As a result if an upstanding Odooer added a strict filter on the driver_id,
it was ignored in favour of the loose one.

opw 1915639

closes odoo/odoo#29515
2018-12-13 11:57:38 +00:00
Jeremy Kersten 206e0b71ac [IMP] website_sale: add warning when editing billing and shipping address
In case you edit your shipping address (that is the same for billing) you don't always
undersantad that you are editing at the same time the billing address.

opw-1914185

closes odoo/odoo#29484
2018-12-13 10:18:00 +00:00
Nicolas Martinelli fe2dd27dea [FIX] purchase: RFQ vs PO
Set the appropriate label in the portal depending on the PO state.

opw-1915230

closes odoo/odoo#29477
2018-12-13 08:38:36 +00:00
Géry Debongnie e062f89ed5 [FIX] web: prevent crash in some cases (o2m)
Recent works in the orm (see [1] for example) changed the behaviour of
the server in the case of onchanges: it tries to optimize Odoo by
sending a minimal diff to the web client in onchanges.

Concretely, this means that the web client receives commands 4 (link to)
instead of command 1 (update + record data). It also sends a minimal
diff in that case. This is a big issue for the web client, because it relied
on the knowledge of the data from the command 1 to be able to evaluate some
modifiers.

The good news is that we can mitigate the issue in one case: we do not
actually need to evaluate the modifiers in the case of a command 4
(comming from the server), because we can assume that the record is
valid. So, we simply bypass the check in that case.

Note that this should fix most of the problem, but a deeper problem
still remains: a crash can still happen when an onchange modifies a
record in a one2many (but in a different page), and we also have a
modifier which needs to be evaluated.

opw: #1904514

[1] https://github.com/odoo/odoo/pull/29086

closes odoo/odoo#29172

closes odoo/odoo#29086
2018-11-30 13:34:54 +00:00
Raphael Collet a8f4b522a3 [FIX] models: onchange sends all fields upon change in x2many
On a record with a large x2many, the web client does not load all the data of
the lines (because of paging).  If a line is modified by an onchange, at some
point the client will determine whether lines are valid (all required fields
are provided).  It is possible that the client cannot evaluate the validity of
the modified line because of missing fields.  In order to avoid this situaion,
the server sends all fields on modified lines.
2018-11-30 13:34:44 +00:00
Raphael Collet 95f4287b6a [FIX] models: make onchange return a smaller diff
Large diffs (specifically in x2many fields) cause performance issues.  They
overload the web client, which considers all returned fields as dirty.
2018-11-30 13:34:20 +00:00
Christophe Simonis e3323a9b52 [MERGE] forward port branch saas-14 up to ba88252bc0 2018-11-30 12:44:11 +01:00
Christophe Simonis ba88252bc0 [MERGE] forward port branch 10.0 up to 80a11ca27d 2018-11-30 11:58:25 +01:00
len-odoo bfb0f1e2a5 [FIX] mrp: update unit_factor when updating MO quantity
Set a BOM to create 10^k units of Product P, using n units of raw material R.
On R, put rounding to 1 unit.
Create a MO to produce 1 unit of P.
Since it needs n/10^k units and rounding is set to 1,
it sets 1 unit of R to consume.
Now "update" (quantity to produce) to 10^k'.
It correctly updates the quantity to consume.
However, since it doesn't update the unit_factor, when you "produce",
it will consume 10^k' units instead of 1.

We copy the way the unit_factor is initially computed when updating the lines.

opw 1903776

closes odoo/odoo#29067
2018-11-30 09:27:37 +00:00
Nicolas Martinelli 80a11ca27d [FIX] report_intrastat: discount on invoice
- Create an invoice with a discount
- Validate
- Open the Intrastat report

The discount is not taken into account.

opw-1913155

closes odoo/odoo#29161
2018-11-29 17:00:36 +00:00
Christophe Simonis c0eef42711 [MERGE] forward port branch 11.0 up to 962298c920 2018-11-29 16:13:28 +01:00
Richard Mathot 1d553eea7b [FIX] models.py: log the full traceback when record import fails
Without the full stack trace, it is very hard for the developers to know
why and where the record creation has failed.

closes odoo/odoo#29143
2018-11-29 15:12:59 +00:00
Ravi Gohil 8a18ef0c5a [FIX] base: allow property field to be set to False
closes odoo/odoo#29147
2018-11-29 13:46:54 +00:00
Nicolas Lempereur 962298c920 [FIX] website: es_* translation typo
The translation had wrongly `</ i>` which from a report broke some
initialization of some snippet of the website editor.

es_CO, es_DO, es_EC languages are not available in transifex so this
change is done manually for them.

opw-1907752
closes #29135
2018-11-29 10:43:45 +00:00
Goffin Simon 7b20604f2e [FIX] website_sale: Missing fields in the product form
When installing ecommerce app in a fresh v12 database
the fields invoice_policy and description_sale were missing in
the product.template view form

opw:1911612

closes odoo/odoo#29059
2018-11-29 08:40:04 +00:00
Robot Odoo 2bfbcf5245 [FIX] survey: fix various issues in customer view about datetimepicker
Survey has troubles displaying correctly the datetime picker widget
especially when more than one has to be instanciated. This merge fixes
several issues related to the datetime widget when displaying the survey
in customer (front-end like) view.

See sub-commits for more details about each change.

This merge is related to task ID 1912194.

closes odoo/odoo#28966
2018-12-04 12:55:29 +01:00
Goffin Simon 484d335789 [FIX] payment: Manage your payment methods on website
The link "Manage your payment methods" didn't work on the website because
the variable acquirers is a list of records.

This list has been created in function "payment_method" with the route
'/my/payment_method'

opw:1913299

closes odoo/odoo#29142
2018-11-29 16:14:04 +00:00
Gustavo Valverde 8de2025ac5 [FIX] l10n_do: multiple corrections
1. Update tax Groups with N07-2018
   Restrict Tax groups just to the 5 available in Norma 07-2018:
   * ITBIS
   * ISR
   * ISC
   * Propina
   * Otros Impuestos
2. Do not use 'none' to hide taxes
   This affect taxes reports, as those reports evaluate the
   type_tax_use field
3. Rename Taxes and Description for N07-2018
4. Change group taxes name and missing childrens
5. Add account groups to template and CoA
6. Add various missing data

opw-1912626

closes odoo/odoo#27172
2018-11-29 08:14:11 +00:00
Christophe Simonis 4ac0019bc2 [FIX] hr_expense: adapt test to new version 2018-11-28 18:20:09 +01:00
Christophe Simonis efe7ca16b7 [MERGE] forward port branch 11.0 up to bb6f6c57f9 2018-11-28 17:44:46 +01:00
Christophe Simonis bb6f6c57f9 [MERGE] forward port branch saas-15 up to 925210714f 2018-11-28 16:13:24 +01:00
Goffin Simon c2e3d3a779 [FIX] stock_picking_batch: Barcode not displayed in report_picking_batch
The barcode was never displayed in report_picking_batch.

opw:1910478

closes odoo/odoo#29103
2018-11-28 14:52:51 +00:00
Nicolas Martinelli 38f00af5d1 [FIX] event: badge layout
When printing the badge of an attendee, several information are not
shown. This is due to the BS4 migration.

Closes #29195

opw-1912074

closes odoo/odoo#29221
2018-12-03 14:32:56 +00:00
Alexandre Kühn 7cdfe99d44 [FIX] mail: do not auto-focus new open chat window
Revision on https://github.com/odoo/odoo/commit/cd34f6de727d5b3858420cff3c9d3c5995c4e75c

Before this commit, when receiving a new message from a new DM
or livechat, the newly opened chat window was automatically
focused and marking messages as read.

Chat windows that are automatically opened without any user
interaction, such as when receiving a new message from a chat,
should not be focused. Those chat windows are "passive", and
the user must click on them in order to have focus and mark
messages as read (the chat window is no longer passive as a
result). The bug has been introduced by the refactoring from
the commit above.

In fact, there was a very short period of time during which the
chat window was passive. However, due to the way chat window
server-side state synchronization works, the chat window was
automatically closed then re-opened. This resulted in some visual
flickering of the chat window ('open' > 'close' > 'open'), and
the conversation was automatically marked as read. This was a
consequence of the actions 'open' > 'close' > 'open' that removed
the passive property of the chat window.

Chat window server-side synchronization relies on a notification
that tells the state of the conversation. Due to bad design, this
notification had exactly the same format as the one for notifying
all browser tabs of a newly joined conversation.

This commit fixes the issue by distinguishing "channel join"
and "chat window state" notification, so that the former is not
treated as a chat window notification. It fixes the problem
because it was precisely the "channel join" notification that caused
the chat window to close and loose its passive property.

Task-ID 1914735
opw-1914371

closes odoo/odoo#29223
2018-12-03 16:17:59 +00:00
Nicolas Lempereur 3fd009a7a7 [FIX] l10n_ch: style imp and add 0 on account isr
It has been reported that it would be nice to have font OCRB all over
the report and number in boxes (for the ISR version of amount with
boxes).

This commit do some tweaks and adapt positions and font-size to do this.

Also a shortcut for an account number can be used in switzerland
(see d9448d7389), but in the ISR scanline the account number must be
fully printed so this commit do the zero padding (on the middle part of
the account number).

opw-1903608
closes #29000
2018-11-30 15:38:44 +00:00
Xavier Morel bedd4be0ed [FIX] doc: line blocks to literal
closes odoo/odoo#29219
2018-12-03 10:59:34 +00:00
Sébastien Theys 1d45184630 [FIX] website,website_hr_recruitment: fix crawler (job url)
Commit 2ab6ce80d6 introduced an issue where the
URL for new job offer was added in the DOM even when website_hr_recruitment is
not installed.

This is a problem because the crawler tries to navigate that URL and returns an
error because the route does not exist without website_hr_recruitment.

closes odoo/odoo#29217
2018-12-03 10:35:06 +00:00
len-odoo 8f3ac2530f [FIX] base, partner_autocomplete: remove vat from the partner selection field
Commit a6e1eb9f0a
introduced the show_vat context key, that displays the Tax ID of a customer
after its name when present, similarly to show_address.

However it appears on the field when being edited, then disappears at save,
which is confusing.
Other unclean things tended to happen: you would have "name - taxid" on customer
field, but "name" on invoice address and delivery address.
Furthermore a client could edit the name manually to erase the Tax ID, and thus
recreate a new record for the same customer.

We introduce a method to clean the name from the Tax ID, and use it so that it
is directly the client's name that is selected at edit.

Note that we also replace the standard dash in the 'name - taxid'
by a figuredash (‒, U+2012) so as to avoid potential egregious splits
because of legitimate customer names.

Similar to commit: 3cbfc40303
(same thing for show_address)

opw 1911954

closes odoo/odoo#29189
2018-12-03 09:23:33 +00:00
Lucas Perais (lpe) 9d1aa41bfb [FIX] account: randomize invoice reference if no match
Take explanation of
commit d94e8a0
but this time, have a suffix with a flavor of %(year)s

Before this commit, validating the invoice crashes

After this commit it doesn't.

OPW 1912954

closes odoo/odoo#29160
2018-12-03 08:45:05 +00:00
Lucas Perais (lpe) 31d1a62bb3 [FIX] point_of_sale: typo in event handler
OPW 1914014

closes odoo/odoo#29194
2018-11-30 16:26:15 +00:00
Olivier Dony 52a6b1e3af [DOC] mixins: remove message_subscribe_users()
It was dropped from 12.0 some time ago by b6d2351df4 and #23377
2018-12-03 02:22:57 +01:00
Odoo Translation Bot 1208ac6ce3 [I18N] Update translation terms from Transifex 2018-12-02 01:25:05 +01:00
Toufik Ben Jaa f289c9ceef [FIX] payment: set correct payment communication
- When a payment is done through a `payment.transaction` the
  communication should be the transaction's reference instead of its
  invoices reference.

closes odoo/odoo#29187
2018-11-30 12:53:37 +00:00
Raphael Collet 6a71a68046 [FIX] models: onchange sends all fields upon change in x2many
On a record with a large x2many, the web client does not load all the data of
the lines (because of paging).  If a line is modified by an onchange, at some
point the client will determine whether lines are valid (all required fields
are provided).  It is possible that the client cannot evaluate the validity of
the modified line because of missing fields.  In order to avoid this situaion,
the server sends all fields on modified lines.

closes odoo/odoo#29177
2018-11-30 09:57:11 +00:00
William Henrotin a226723e52 [FIX] mrp: avoid accessing empty data
Once we log an exception via next activity in a production, we search moves that have been updated uphill to write the useful information about the change. The issue is by default, the key 'move_orig_id' is searched while some moves could be linked with 'created_purchase_line_id' key.

This commit avoid mapping 'move_orig_id' on empty recordset and so avoid a traceback.

opw:1911399

closes odoo/odoo#29087
2018-11-30 08:47:34 +00:00
Géry Debongnie 25d63eee7c [FIX] web: prevent crash in some cases (o2m)
Recent works in the orm (see [1] for example) changed the behaviour of
the server in the case of onchanges: it tries to optimize Odoo by
sending a minimal diff to the web client in onchanges.

Concretely, this means that the web client receives commands 4 (link to)
instead of command 1 (update + record data). It also sends a minimal
diff in that case. This is a big issue for the web client, because it relied
on the knowledge of the data from the command 1 to be able to evaluate some
modifiers.

The good news is that we can mitigate the issue in one case: we do not
actually need to evaluate the modifiers in the case of a command 4
(comming from the server), because we can assume that the record is
valid. So, we simply bypass the check in that case.

Note that this should fix most of the problem, but a deeper problem
still remains: a crash can still happen when an onchange modifies a
record in a one2many (but in a different page), and we also have a
modifier which needs to be evaluated.

opw: #1904514

[1] https://github.com/odoo/odoo/pull/29086

closes odoo/odoo#29172
2018-11-30 08:56:29 +00:00
goliveirab fd9b2c9f36 [FIX] account: Bad query
Fix Error:

`ERROR: syntax error at or near ")"
LINE 7: ...        WHERE full_reconcile_id IS NULL and account_id IN ()`

This can occurs when:

- using write to some account like:

`some_account.write({'reconcile': True})`

closes odoo/odoo#29164
2018-11-29 21:23:47 +00:00
Christophe Simonis 82a1e1dcc3 [FIX] hr_expense: adapt test to new demo data 2018-11-29 19:18:56 +01:00
Christophe Simonis f5c3dafb04 [MERGE] forward port branch saas-11.3 up to c0eef42711 2018-11-29 18:38:55 +01:00
Denis Ledoux 5644ab53ab [FIX] sale: improve team pipeline dashboard quotation counts performance
Doing the `read_group` on `sale.order` rather than
`sale.report` to get the quotations amount and count
significantly improve the performance (5x faster on big databases).

This is because `sale.report` is a view,
with a bunch of fields taking time to compute / fetch.

Besides, the algorithm to get the number of quotations
was an heuristic based on the "group by name" on the `sale.report`,
which was not as precise,
as multiple quotations could potentially have the same name,
and slowed down the query,
because it returned one line per quotation,
versus one line per team with this revision.

closes odoo/odoo#29139
2018-11-29 11:46:22 +00:00
Denis Ledoux 9fbac5fcbb [IMP] crm: improve team pipeline dashboard leads/opps counts performance
The team pipeline dashboard fields
`unassigned_leads_count`, `opportunities_count`, `opportunities_amount`

do a big search on leads, filtered
by type (lead/opp), team, and unassigned user_id (salesman)

Adding an index on user_id, team_id, type significantly
improves the filtering, and therefore the dashboard rendering,
especially when displaying a few teams only
e.g; the teams you are part or responsible of.

The index on `user_id` is removed,
as it become a duplicate as `user_id` is the first column
of this new index.
2018-11-29 11:46:22 +00:00
Nicolas Lempereur 8e7c255237 [FIX] *: fix % in translation not on transifex +da
Fix issue of %s or %(name)s present in source but not in translation
in language not available on transifex.com/odoo/

Also correct a account danish (da) translation that was reported to be
an issue.

closes #29100
2018-11-29 12:52:45 +00:00