Commit Graph
123174 Commits
Author SHA1 Message Date
Hiral BhavsarandMohammed Shekha bb6aec1ac3 [FIX] web: several columns in line chart tooltips for large data
Currently tooltip goes out off the screen when the
graph view (in line mode) presents a large number
of groups.
The present commit splits the tooltip content in
three columns when the number of groups exceeds
20. This split is not done in mobile mode because
it is not an appropriate in that situation.

Co-authored-by: Mohammed Shekha <msh@openerp.com>

Related to Task: 1917958

closes odoo/odoo#30288
2019-02-21 13:03:22 +00:00
Hiral BhavsarandMohammed Shekha 4b652ebe8a [IMP] web: properly display min and max abs when less that 3 abs.
In graph line mode, min and max abs are
displayed beyond the screen when there are less
than 3 abs.
This is happening because nvd3 fixes their
text-anchor to 'middle'. The present commit fixes
correctly their text-anchors to start and end
respectively by using the '!important' rule (it
seems difficult to do otherwise).

Co-authored-by: Mohammed Shekha <msh@openerp.com>

Related to Task: 1917958
2019-02-21 13:01:26 +00:00
Jaykishan Solanki 2dd90370cd [FIX] stock: prevent crash if key does not exit in dict
Closes #31049

closes odoo/odoo#31323
2019-02-21 11:49:26 +00:00
Lucas Perais (lpe) 9fc2420ec6 [FIX] l10n_it_edi: cleaned context default_type
On the accounting dashboard, click on the button
"new invoice" on the customer journal.
Validate the invoice

Before this commit, it crashed because, as always
the key "default_type" was propagated all the way down
to the attachment creation

After this commit, we clean the context from that key
to avoid the problem

Note: There is no clean and safe method to clean
the context from keys only useful to `default_get`
in stable...

OPW 1943439

closes odoo/odoo#31319
2019-02-21 10:06:42 +00:00
Lucas Perais (lpe) 84143a34b3 [FIX] hr: tz on user required in view because of resource mixin
In the user preference, change the timezone of the user to blank (False value)
Save

Before this commit, a cryptic error was raised because the field tz in
resource.resource is required
Note that when writing on res.user, we write some fields (including tz)
on hr.employee, which is a resource.mixin, and therefore uses resource.resource

After this commit, we make the field required in the view

OPW 1934462

closes odoo/odoo#31312
2019-02-21 08:33:26 +00:00
keylor2906 faf8c41d80 [FIX] l10n_mx: Fix warnings related to wrong fields names on the creation of tax templates for the mexican coa.
closes odoo/odoo#31296
2019-02-20 20:45:51 +00:00
Arturo Flores 10db0a5052 [CLA] Update Vauxoo's CLA
closes odoo/odoo#31302
2019-02-21 04:03:24 +00:00
Hugo Adan f7fc5bc0d5 [FIX] account: Fix forward-port of ec25b9d
since the fix of the forward-port has missed checking the chart template
too
https://github.com/odoo/odoo/commit/2bba89c4ad5d393a15e02f0b7435ea7c63935bb0

Check the chart template is required because company could have a chart
template and any record at  ['account.move.line', 'account.invoice',
'account.payment', 'account.bank.statement'] models

closes odoo/odoo#31218
2019-02-18 20:18:56 +00:00
Romain Derie edce2fd6d0 [FIX] website: keep only specific views on _views_get recursive calls
Before this commit:
If a view A was doing a t-call on a view B and view B had view C as child.
And view A had view D as child.
And view D also t-call view B (that as mentionned above has view C as child).
And view D was inactive.

Then COWing C to set it as inactive would make `get_related_views()` on A to
return both generic active C and COW inactive C.

This rare case appeared for customize option that were enabled by default, like
wishlist, compare..

Disabling this customize option would show both the generic customize view and
the COW customize view.
Resulting in the customize toggle being shown twice, one enabled and one
disabled.

Detailed explanation:
1. `website_sale.products` would call `_views_get()` with `options=True` for its
   t-call node `website_sale.products_item`, returning the full view tree,
   including COW wishlist.
2. `website_sale.products` would then call `_views_get()` on its child views
   with `options=extension.active`.
   It is the case for `website_sale.products_list_view`, which also has a
   t-call node `website_sale.products_item`.
   It would then perform the same `views_get()` as in step 1. but with
   `options` set to the view active state, in this case False.
   At that point, the `_view_get_inherited_children` method would filter by
   active before filter_duplicate, leaving the generic view over the specific
   one as it should.

closes odoo/odoo#31286
2019-02-20 14:31:02 +00:00
Christophe Simonis f6540c26ff [FIX] stock: correctly correct report view 2019-02-20 18:59:46 +01:00
Christophe Simonis d98bf74579 [FIX] stock: correct report view
Oversight of previous forward-port
2019-02-20 18:31:04 +01:00
Christophe Simonis 7dcbd15278 [FIX] base_import_module: typo in view declaration 2019-02-20 18:25:52 +01:00
Christophe Simonis db1c7765cb [MERGE] forward port branch saas-11.3 up to 2c495502aa 2019-02-20 17:37:22 +01:00
Christophe Simonis 2c495502aa [FIX] hr_holidays: import used function
Oversight of previous forward-port
2019-02-20 13:58:03 +01:00
Christophe Simonis f1ff55bca1 [MERGE] forward port branch 11.0 up to de8cefcef4 2019-02-20 13:40:48 +01:00
Nicolas Martinelli 7151f98358 [FIX] base: _name_search of state
When creating a new customer, the selection list for the state is empty
unless the country is filled in.

This is an issue since users usually fill the address fields in the
sequential order: street, city, state, zip and then country. Since no
state proposal is displayed, users tend to create a new state.

Introduced in 5fcf891e07.

opw-1941579

closes odoo/odoo#31273
2019-02-20 10:41:09 +00:00
Pierre Masereel 7d24d77511 [FIX] sale_stock: display picking in portal
When a picking is linked to a sale order, it is not displayed anymore
ont the user portal.

This comes from a fix in rev: https://github.com/odoo/odoo/commit/7825d008279702b3a5017196aa0345a0e48810c9
that hides the shipping_adress div, which is the one targeted by the
xpath for shoing picking. To fix this behavior, we changed the xpath.

TASK-ID: 1939813

closes odoo/odoo#31267
2019-02-20 09:47:21 +00:00
Nicolas Lempereur d2b55ab607 [FIX] sale_quotation_builder: warn edit product description
On the quote builder, we have a description per product that is either:

- the description of the product on the quotation template
- the quote_description of the product

and if it is empty we can edit it on the quote builder.

But if we have several of them, we only see several empty editing blocks
without knowing which product it refers to: thus if we removed the line
it could have adverse effects by removing something not related.

With this change, there is an alert when editing that explain each
line description being.

opw-1943009
closes #31263
2019-02-20 07:53:13 +00:00
Nicolas Lempereur e8cb9c0e45 [FIX] base: better branding with view inheritance
To edit a view on the website, we use the branding mechanism.

This mechanism adds informations to node which can be edited about how
or where the change should be saved, for example:

```
  <template id="a">
    <div><b>hello</b></div>
  </template>
```

might be rendered to someone that can edit it:

  `<div data-oe-model="ir.ui.view" data-oe-id="5" data-oe-field="arch"
     data-oe-xpath="/div[1]"><b>hello</b></div>`

when something is changed: we will send the modified content, the view
id (eg. 5 for view `a`) and the xpath in this view of what is replaced.

If a view is overridden, there is mechanism to distribute the branding
to children, for example:

```
  <template id="b">
    <div>
      <b>hello</b>
    <div>
  </template>
  <template inherit_id="b">
    <div position="inside">
      <b>world</b>
    </div>
  </template>
```

The branding can't be on the parent div that will contain other content,
because the other content is in another template and should not be saved
in template `b`, so this would be rendered like this:

  `<div><b data-oe-model="ir.ui.view" data-oe-id="6" data-oe-field="arch"
    data-oe-xpath="/div[1]/b[1]">hello</b><b data-oe-model="ir.ui.view"
    data-oe-id="7" data-oe-field="arch" data-oe-xpath="/div[1]/b[1]"><b>
    world</b></div>`

This changeset fixes two issues:

- if we have a primary inheriting view: the xpath are wrong in the
  primary inheriting view part, they are computed on the view applied on
  its inherit_id; the part of the inherit_id view have the primary
  inheriting view ID instead of inherit_id view id.

- if we have `<div t-call="..."/>` in a view, the branding of view
  should be distributed to children and not affect t-call part: this was
  done for `<t t-call="..."/>` but not for `<anyothertag t-call/>`.

The added test failed on all assertions before the change:

- "test_branding_primary_inherit" would not distributed
- "test_call_no_branding" would distribute branding on `t-call`

opw-1937757
closes #31039
2019-02-20 12:05:05 +00:00
Lucas Perais (lpe) de8cefcef4 [FIX] web: pivot unload filter, reset, load another filter
On a pivot view with a default filter which has column and row groupbys
Remove the filter
Collapse all columns and rows
Activate another Filter from favorite which has a column groupby at least

Before this commit, the columns were not displayed in the DOM, though RPC's
and internal data were actually correct
This was because we considered the changes had been done "in place"
taking the old tree to build the new one for the columns
when really, we should have recomputed the column tree

After this commit, the columns display the group we want

OPW 1935155

closes odoo/odoo#31247
2019-02-19 15:12:28 +00:00
mgh-odoo 66392a9fff [FIX] pos: encode negative payment for refund
currently, if the user wants to refund amount to the customer
and enter negative payment form keyboard its throws an error. that will fixed.

Task: #1935602

closes odoo/odoo#31061
2019-02-20 07:01:52 +00:00
Olivier Dony 3e5ab60cf2 [FIX] web: avoid long menu dropdown overflow
The Actions/Print dropdowns may overflow the screen in case of very long
lists of menu entries, when based solely on the default BS4 styles for
`dropdown-menu`.

The `o_dropdown_menu` class forces a vertical limit and a scrollbar when
this happens, and should be applied to those control-panel dropdowns to
prevent this UI glitch.

See also 1c1c0897e8 which adapted
dropdowns to BS4.

closes odoo/odoo#31251
2019-02-19 14:56:11 +00:00
Nicolas Martinelli 09bf391f4d [FIX] stock: delivery slip address
After discussion with the Mighty Priestess, the address used in the
Delivery Slip should be the picking partner as a first priority, then
the move lines partner.

And we therefore remove the useless 'Assign Partner' button (but not the
associated method since it is public).

opw-1935039

closes odoo/odoo#31250
2019-02-19 14:48:20 +00:00
Julien (juc) Castiaux 6b7f1ef091 [FIX] digest: remove unnecessary context
The `company` context is explicitly set by `action_send` while the
template previewer doesn't set it. This inconsistency leads to
error when previewing the digest template.

opw-1939007

closes odoo/odoo#31195
2019-02-18 14:42:32 +00:00
Hugo Adan ef618df9e9 [REF] account: Performance improve unreconcile process (_reverse_move):
_reverse_move presents a critical performance issue when
unreconcile moves with a lot of account_move_line.

The issue is that `account.move` and `account.move.line` models are triggering computed fields/methods for each new
`account.move.line` added, computing all lines again and again.

Making a factorial performance issue.

For each line the function try create cash basis entries for tax/base lines and this is combined with all the
fields compute that exists on the model so this introduce a performance problem

The issue is that `account.move` and `account.move.line` models are triggering
computed fields/methods for each new `account.move.line` created isolated,
computing all lines again and again.

e.g.
 _compute_matched_percentage at
https://github.com/odoo/odoo/blob/5e8289cfeaf52a1eac64bcc975b186f0b5f9594b/addons/account/models/account_move.py#L44-L62

Then for each line modified/created this compute is executed for all lines (not just the last one).

Now by using self.env.norecompute() and self.recompute() the problem was reduced.

Unreconciling an 'account.move' with 1576 lines with a payment takes almost 4
minutes when before this changes, the conciliation process seemed not to never
end.

Fix https://github.com/odoo/odoo/issues/30934

closes odoo/odoo#31014
2019-02-17 10:28:21 +00:00
Hugo Adan ce93a949a7 [REF] account: Performance improve for create_tax_cash_basis_entry
create_tax_cash_basis_entry presents a critical performance issue when
reconciling moves with a lot of account_move_line.

The issue is that `account.move` and `account.move.line` models are triggering computed fields/methods for each new
`account.move.line` added, computing all lines again and again.

Making a factorial performance issue.

For each line the function try create cash basis entries for tax/base lines and this is combined with all the
fields compute that exists on the model so this introduce a performance problem

The issue is that `account.move` and `account.move.line` models are triggering
computed fields/methods for each new `account.move.line` created isolated,
computing all lines again and again.

e.g.
 _compute_matched_percentage at
https://github.com/odoo/odoo/blob/5e8289cfeaf52a1eac64bcc975b186f0b5f9594b/addons/account/models/account_move.py#L44-L62

Then for each line created this compute is executed for all lines (not just the last created one).

Now by using self.env.norecompute() and self.recompute() the problem was reduced.

Reconciling an 'account.move' with 1576 lines with a payment takes almost 4
minutes when before this changes, the conciliation process seemed not to never
end.

Fix https://github.com/odoo/odoo/issues/30934
2019-02-17 10:27:50 +00:00
Christophe Simonis 1cb3e7c522 [MERGE] forward port branch saas-15 up to c6c3d73391 2019-02-19 19:14:16 +01:00
Christophe Simonis c6c3d73391 [MERGE] forward port branch saas-14 up to 9b735d0057 2019-02-19 17:09:59 +01:00
Christophe Simonis 9b735d0057 [MERGE] forward port branch 10.0 up to 6cf4f4924b 2019-02-19 17:08:56 +01:00
Nicolas Martinelli bddd53881c [FIX] hr_holidays: numerical error
In some exceptional circumstances, the computation of the remaining
leaves might lead to numerical errors, e.g. a very small but non-zero
number (e.g. 10^-17)

This value will be displayed in the name of the leave type because of
the `%g` used in the string format. To avoid breaking the translation,
we round the value.

opw-1935232

closes odoo/odoo#31245
2019-02-19 12:43:07 +00:00
Nicolas Martinelli 29a3634c1a [FIX] l10n_us: ABA/Routing
When defining an ABA routing number with leading zeros (which is
possible), the value will always be displayed without them.

This is because the field is an integer. Since the ABA routing transit
number must be a nine-digit code, we automatically fill it with leading
zeros.

opw-1940138

closes odoo/odoo#31223
2019-02-19 07:59:25 +00:00
Nicolas Martinelli 3e147220fd [FIX] account_voucher: round globally
- Enable multi-currency. Company currency = USD, another currency = SGD
- Update the exchange rate
- Create a purchase journal. Assign SGD to this journal
- Create a purchase tax of 7.00 %
- Enable tax rounding globally
- Create a purchase receipt with the following values
  62.04 @ 7% tax
  7.29 @ 7% tax

An error occurs: 'Cannot create unbalanced journal entry.'

Each line of the receipt creates its own tax line, which is therefore
rounded => the total of the receipt is computed with a 'round globally'
configuration, while the taxes are computed with a 'round per line'
configuration.

This is because `apply_taxes=True` is set in the context. This creates
the tax line by forcing the rounding. Therefore, we call the method
`_apply_taxes` explicitly in this specific case, and manually round the
taxes once they are merged.

opw-1938623

closes odoo/odoo#31194
2019-02-18 12:55:35 +00:00
Nicolas Martinelli cece8834f9 [IMP] account: apply taxes
We extract the tax creation from the AML creation in an external method,
in order to be able to call it separately.

This is necessary for the subsequent commit.

opw-1938623
2019-02-18 12:53:58 +00:00
Nicolas Martinelli 3a5c50e5c6 [FIX] account: TaxCloud multi-company
The TaxCloud settings are not company-specific.

opw-1933774

closes odoo/odoo#31198
2019-02-18 13:10:22 +00:00
Alexandre Kühn fa2a5055e7 [FIX] im_livechat: instantly receive messages from new livechat
Before this commit, when new messages were posted in a new
livechat, the operator received them after a delay. This
may take up to a minute before receiving the notification.

This behaviour was causing a bigger issue: those notifications
may never be received by the operator. This case happened when
the operator was receiving more recent notifications while
notifications from new livechats were pending.

The delay was caused by the operator not yet subscribed to
notifications on the newly created livechat. It is only on
the next poll of longpolling that the subscription occurred,
then followed by dispatching the notifications to the operator.

This commit fixes the issue by dispatching new messages of new
livechats directly to the operator. This is done by enforcing
the operator to make another polling when a new livechat is created,
so that he is always subscribed to those livechats. As a result,
new messages are received instantaneously.

opw-1933951

closes odoo/odoo#31191
2019-02-18 12:20:40 +00:00
Julien (juc) Castiaux c0847a7bd7 [FIX] project: subtask of duplicate project are linked to original
When duplicating a project, every task linked to the project is
duplicated too but the link between sub-tasks and their parent
task is not updated thus they are left linked to the task of
the original project.

opw-1937371

closes odoo/odoo#31154
2019-02-15 15:03:16 +00:00
Nicolas Martinelli e632e6c5e2 [FIX] account: do not copy alias
When duplicating a journal, the alias is kept. Therefore, when the user
tries to change it, it updates the value on both records.

opw-1941717

closes odoo/odoo#31242
2019-02-19 12:13:28 +00:00
Nicolas Lempereur 4b977f3b7d [FIX] website_crm_partner_assign: stage breadcrumb in order
If the stage breadcrumb on the portal view is too long, it could get on
two lines but since they are righ-aligned in inversed order, the second
line (or more) will be the first stages.

With this fix, the breadcrumbs are left-aligned so on two line the
second line are the last breadcrumbs.

Also there was possibly a different order than backend since the order
is on "sequence, name, id" in backend but was just "sequence" here.

opw-1934497
closes #31237
2019-02-19 11:11:15 +00:00
Christophe Simonis 6cf4f4924b [FIX] stock: remove domain on stock.location of picking types
There is no `company_id` field on `stock.picking.type`.

Partially revert f221936f8b (#30952)

closes odoo/odoo#31121
2019-02-14 20:25:55 +00:00
Christophe Simonis c0f24d54cf [MERGE] forward port branch saas-14 up to c1fe9f18d5 2019-02-14 18:14:08 +01:00
Christophe Simonis c1fe9f18d5 [MERGE] forward port branch 10.0 up to 69719f598a 2019-02-14 18:09:24 +01:00
Denis Ledoux 69719f598a [FIX] google_calendar: case insensitive attendee sync
In Odoo, create a user John@example.com (the cap is on purpose)
In Google Calendar, create an event and invite john@example.com

Sync your Google calendar.

Before this revision,
the event created in Odoo did not add John@example.com,
but created a new attendee, john@example.com, because
of the sensitive casing.

Besides, give the priority to partners having
users, so if there are two partners with the same email,
one of them having a user,
e.g. John@example.com (with user) & john@example.com (without user),
set the partner having the user as attendee,
as its the one with the user who use the Odoo calendar,
and potentially the Google sync as well.

opw-1925592

closes odoo/odoo#31111
2019-02-14 11:07:25 +00:00
Nathan de Pryck db691dbebf [FIX] account: reverse entry when account move line contains 0 in credit or debit
In some case, when the user enter by mistake an account move line
 with an amount of 0,the reverse operation does not works properly.
The issue happenned during the reverse operation because it tries to
reconcile a 0 account move line with no matches (credit or debit).

See opw-1931961
2019-02-14 09:13:24 +01:00
Raphael Collet 716a272480 [FIX] models: check groups on inverse fields
Before this, groups on non-stored inverse fields were not checked upon write.
The impact on existing fields is pretty small, since the inverse methods of
those fields are subject to access rights on the records they use.

closes odoo/odoo#30357
2019-02-13 10:45:04 +00:00
Lucas Perais (lpe) cbdc8d864b [FIX] fields: read/write company-dependent fields without ir.property access
This is the first step to a more comprehensive handling of company-dependent
fields which are ir_properties.

With model-specific access rights, users should be able to read/update a
company-dependent field no matter their access rights on ir_property.

Before this commit, a user having access to res.partner, but not to ir.property
couldn't write on property_account_receivable/payable just because he couldn't
write the corresponding ir.property.  After this commit, he can.

OPW 1923345
2019-02-13 10:43:50 +00:00
Raphael Collet cd3790c4ea [FIX] models: check groups on inverse fields
Before this, groups on non-stored inverse fields were not checked upon write.
The impact on existing fields is pretty small, since the inverse methods of
those fields are subject to access rights on the records they use.

closes odoo/odoo#30356
2019-02-13 10:35:09 +00:00
Lucas Perais (lpe) 61623bd17c [FIX] fields: read/write company-dependent fields without ir.property access
This is the first step to a more comprehensive handling of company-dependent
fields which are ir_properties.

With model-specific access rights, users should be able to read/update a
company-dependent field no matter their access rights on ir_property.

Before this commit, a user having access to res.partner, but not to ir.property
couldn't write on property_account_receivable/payable just because he couldn't
write the corresponding ir.property.  After this commit, he can.

OPW 1923345
2019-02-13 09:34:08 +00:00
Lucas Perais (lpe) b62d720c85 [FIX] l10n_it: change website in manifest
openerp-italia.org or odoo-italia.org are not valid websites

changing it to odoo.com

OPW 1940848

closes odoo/odoo#31110
2019-02-14 10:55:36 +00:00
Nicolas Lempereur 0857737f8c [FIX] web_editor: focus lost with inline editor
When an inline editor is eg. in a form view, the focus is always stolen
by it.

This is because we trigger a mouseup on the editor to update its
toolbars values and informations.

note: backport of 11.0's 7a453b0b7a

In 10.0 this trigger could cause a "blur" which in some instance is not
wanted (eg. inside a newline of a list view).

opw-1906581
closes #31078
2019-02-13 17:21:19 +00:00
Nicolas Lempereur 1e43c73a99 [FIX] web_editor: html widget empty value stay empty
The html widget automatically replace an empty field value by
`<p><br></p>` to be able to add content.

But this may cause unintended "onchange", since the value has "changed"
and the onchange themself could cause error when triggered at the wrong
time (eg. inside a list view with required fields).

With this changeset, the onchange is averted when the value was false
and is now `<p><br></p>`.

opw-1906581
closes #31078
2019-02-13 17:11:13 +00:00