Commit Graph
126256 Commits
Author SHA1 Message Date
Martin Trigaux 23afec1b8d [FIX] l10n_multilang: avoid module conflicts
In case two modules are using the same local name for their external identifier,
a conflict may occure.
e.g. the templates
- l10n_generic_coa.a_salary_expense
- l10n_be.a_salary_expense

will generate
- l10n_generic_coa.1_a_salary_expense
- l10n_be.2_a_salary_expense

As the previous search for in_xml_ids was using a domain
   ('name', '=', 'a_salary_expense')
both records were returned, making in_ids to have one more record than out_ids

Followup of review made at odoo/odoo#31510

closes odoo/odoo#31604

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-03 11:24:35 +00:00
Lucas Lefèvre 663597b50f [FIX] web: Load correct form view for calendar popup
When creating a record from a calendar view,
the default form view is always used when using the popup mode,
ignoring the `form_view_id` attribute of the <calendar/> tag.

After this commit, the `form_view_id` is no longer ignored.

closes odoo/odoo#32379

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-04-03 10:40:34 +00:00
Nicolas Martinelli 1e558bc79a [FIX] tools: February 28th
- Set your fiscal year end date to 28th February
- Run the P&L a year before a leap year, e.g. anytime between March 1st
  and December 31st 2019.
- Select 'Last Financial Year'

The dates are set from 2019-03-01 to 2019-02-28.

There are actually 2 bugs. The one solved here is the following
inconsistency:

```
current_date = type(date)(2019, 4, 3)
date_utils.get_fiscal_year(current_date, day=28, month=2)
'date_from': datetime.date(2019, 3, 1), 'date_to': datetime.date(2020, 2, 28)

current_date = type(date)(2020, 2, 28)
date_utils.get_fiscal_year(current_date, day=28, month=2)
{'date_from': datetime.date(2019, 3, 1), 'date_to': datetime.date(2020, 2, 29)}
```

Both should return `'date_to': datetime.date(2020, 2, 29)`. This implies
that the period is recognized as `custom`, which is affected by the bug
solved in PR https://github.com/odoo/enterprise/pull/4006

opw-1949628

closes odoo/odoo#32366

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-03 09:29:57 +00:00
Goffin Simon 2c702108b8 [FIX] purchase_stock: Wrong journal entry created from vendor bill
Steps to reproduce:

- Create a storable product P with a vendor V and a purchase price = 100€
- Set the category of the prodcut to automated and AVCO and set a price diff account on it
- Create PO for V with 10 P with a price_unit = 110€
- Confirm the PO and deliver 7 P with no backorder
- Change the ordered quantity of P to 9 on PO (and the unit_price will be set to 100€)
- Go on the delivery order and deliver 2 remainig P
- Create the invoice and validate it

Bug:

The amount due on the invoice was 900.02€ instead of 900.00€

PS: The debit and credit of an aml are computed with the price (defined in function
_anglo_saxon_purchase_move_lines) with the function _convert_prepared_anglosaxon_line
defined on model account.invoice. So rounding the price unit after the computation
of the price allows to keep the same total as the one computed for the PO.

opw:1951465

closes odoo/odoo#32345

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-03 08:49:57 +00:00
Nicolas Lempereur 5d1661e6f4 [FIX] mail: send mail.mail ->nofail updating notif
When we go on a failed mail.mail and do "Retry" -> "Send Now", if there
is an existing notification that is not to the current user, we may get
an error or get the email in error.

This is because on a notification only:

- the superuser
- the targetted user of the notification

have write permission by default in Odoo.

So with existing notifications resending (by the mail.mail views, the
alternative mail.resend.message wizard works as expected) only worked
if they were current user's notifications or if user is superuser.

opw-1957730
closes #32346

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-02 15:03:18 +00:00
Xavier Morel 2430e28e83 [FIX] mrp: test_product_produce_3
Test was relying on qty_to_consume getting saved when the produce form
is saved, a behaviour of the SSF which diverged from the actual
client.

After fixing the SSF to behave more in-line with the actual
client (don't save o2m sub-fields unless they're flagged as
force_save) the test is now visibly broken.

Fix it so qty_done is properly updated during wizard configuration /
edition instead of updating the in-database object directly.

closes odoo/odoo#32047

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-04-03 09:42:04 +00:00
Xavier Morel ef8df8fb4e [FIX] core: don't send readonly fields in o2m in SSF
The SSF would correctly filter out readonly fields when saving a
toplevel form, however it could not remove readonly values when saving
o2m pseudo-records to the parent form (as these would be expected to
remain available for reading upon the next edition and whatnot), so
these values would get sent in 0/1 commands.

Filter out these fields during the parent / toplevel save call.

Complexity notes:

* evaluating readonly modifiers requires the entire record, so
  unchanged fields still have to be written back to the parent form
  and be filtered out when *it* is set up for save, an alternative
  would be to store the `changed` and `readonly` flags alongside the
  record dict, and have the post-process only override the
  pre-computed readonly flag using force_save
* had to fix a test to match the new behaviour, the post-edition
  states turns out to be in line with the client's behaviour (or how
  it looks anyway)

Fixes #32019
2019-04-03 08:44:22 +00:00
Xavier Morel 922d77a291 [FIX] core: infinite recursion in SSF on self-recursive models
The extra setup probably affects any o2m whose edition view itself
contains an o2m, but most likely to blow up entirely on models with
some sort of tree structure (parent/child relationship): the SSF
eagerly loads and setups the o2m's view, and the o2m's o2m's, ... ad
infinitam.

A better / cleaner fix would be to set up the subview on-demand (and
possibly cache it), but the rest of the o2m stuff is unlikely to work
correctly recursively so just don't recurse the o2m view setup at all
for now.

fixes #31458
2019-04-03 08:44:21 +00:00
Nicolas Martinelli fb48e49779 [FIX] account: deprecated accounts
Deprecated accounts are available in the reconciliation widget, while
they shouldn't be.

opw-1949667
opw-1945585

closes odoo/odoo#32304

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-01 13:37:04 +00:00
wan 5eaa4f2967 [IMP] account: remove user_type_id
OPW 1961781
The related field user_type_id on account.move.line was slowing down the ORW when whanging the type of an account. This field was almost never used except in account_reports.

closes odoo/odoo#32303

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-04-01 13:02:38 +00:00
Juhil Somaiya 92685d33a5 [IMP] website_forum: improvement karma error message
Changed the error message when the user hasn't enough karma.
Add link to the FAQ to understand how to get more karma.

Task-ID: 1952473
Closes: #32161

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-10 06:28:48 +00:00
dbh-odoo d5cab8a40d [IMP] website_rating: visual improvements for product rating
Rating Improvements on product page:
  1) Now we display ratings filter in descending order which
     is common behavior for eCommerce/Appstore sites
  2) Stop scrolling to top while removing selected rating filter
  3) UI improvements for mobile/tablet view
  4) Percentage is rounded up to two decimal points so that
     it does not look ugly

task-1850446

closes odoo/odoo#28245

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-04-10 06:27:36 +00:00
Sapan Zaveri 98d4b21437 [IMP] website: properly show navbar on iPad
Currently, when we open the website on iPad, the navbar is not displayed
properly (systray items are overlapping on the website menu). This
commit fixes the issue by using '+' icon on the navbar top menus if
there is not ample space. This commit also converts multi company
selector with 'fa-building' and multi website selector with 'fa-globe'
icons on smaller screens.

task-1945020

closes odoo/odoo#32321

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-04-10 05:39:29 +00:00
Xavier Morel 265926f971 [IMP] website_sale: overhead on every page
website_sale adds a call to sale_get_order to ~every website page (in
order to validate & display the shopping cart).

Before this change, this calls get_pricelist_available() and triggers
two different computations of property_product_pricelist on every page
even for a public user with no cart / SO. This, in turn, generates ~20
queries and adds 20ms (total) / 10ms (sql) to ~every page load.

Fix: early return if the user doesn't have an SO (either in session or
in DB) and we're not in a case where we want to force one.

Loading "/" with just website_sale installed on a new DB,

- before: 53 queries, 31ms ±5 (sql), 75ms ±5 (all)
- after: 32 queries, 21ms ±1 (sql), 53ms ±3 (all)

closes odoo/odoo#32492

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-04-08 11:40:08 +00:00
Sapan Zaveri be8af5dc9c [IMP] sale: Improvement in payment reference for wire transfer
Purpose of this task is,
Default payment ref for wire transfer is confusing and not really helpful as it will induce encoding errors customer side

So, I removed modulo part in payment reference

Task Id : 1946656
Closes : #31853

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-09 10:32:11 +00:00
mgh-odoo 13ed1c6aa0 [IMP] product: pricelists - multiple prices per product
currently, if the user selects Multiple prices per product
in Multiple Product Prices, the user cannot set product
directly from product.pricelist formview.

purpose of this commit is to make multiple prices par product
fromview quick editable and reflect that to the product.product formview.

Task-ID: 1904777
Closes: #30540

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-08 05:02:01 +00:00
Jeremy Kersten 82ea590264 [MRG] website_form[_editor]: merge modules together
closes odoo/odoo#32491

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-08 10:07:49 +00:00
Juhil Somaiya 48b373f8e4 [FIX] payment: font awesome text outside of tag
So text do not inherit from font awesome font style

closes odoo/odoo#31730

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-09 06:46:14 +00:00
Juhil Somaiya 5a9530cdfd [IMP] account, payment, sale, website_sale: added extra fees on payment
Purpose of the task is when extra fee is activated on the payment acquirer,
the customer is no warned about extra cost when choosing the payment acquirer.

so display the extra fees on payment acquirer when doing the payment.

Related Task ID : 1845815
Closes : #31730
2019-04-09 06:44:48 +00:00
Antoine Guenet 028a03b8f1 [FIX] web_editor: do nothing on select all with empty editable
Ctrl-A on an empty editable threw an error. This fixes it.

closes odoo/odoo#32301

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-04-01 12:59:41 +00:00
Nicolas Martinelli ef4aaeb4e7 [FIX] base: res.partner.bank sequence
`res.partner.bank` is ordered by sequence, but:
- there is no default value
- there is no widget handle to set it

Therefore, methods such as `_get_partner_bank_id` might retrieve an
unexpected value.

To avoid this:
- we fallback to sort by ID
- we add a default value
- we add the widget handle

opw-1948964

closes odoo/odoo#32300

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-01 12:48:04 +00:00
Nicolas Martinelli 67ea26460f [FIX] stock_account: inventory with company
- Set a company on the inventory location
- Create a stockable product, FIFO, real-time, with a cost
- Receive a unit

The product stock value remains zero.

The fact that the inventory location has a company set should not impact
the product cost. This is useful when a scrap location as a company set.

The domain of move selection is incomplete. It should be, for the 'in'
moves:
- coming from a location without company, or an inventory location
  within the same company
- going to a location within the same company

For the 'out' moves:
- coming from to a location within the same company
- going to a location without company, or an inventory location within
  the same company

opw-1943384

closes odoo/odoo#31485

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-01 11:00:29 +00:00
Xavier Morel 7e0b29cbcd [FIX] core: backport changes in 12.1/master to 12.0
PRs #28645 and #31494 were not applied to 12.0, but there's no reason
not to, they should only fix things (make behaviours more in-line with
the regular client), and since o2m is an area where more fixes are
needed and it would be nice to have them in 12.0...
2019-04-01 10:34:47 +00:00
Nans Lefebvre 295690ce70 [IMP] mrp: start work orders in the right state
To be able to override the initialisation of the work orders states,
we put that in a function.

opw 1943674

closes odoo/odoo#31774

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-03 08:11:30 +00:00
Yenthe666 556d6d6059 [ADD] mail: add activities menu and views under Settings/Technical
closes odoo/odoo#32287

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-04-01 08:47:36 +00:00
Felix H. Hoßfeld 3a92c2644d [CLA] Thought Gang GmbH Contributor License Aggrement
closes odoo/odoo#32152

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-08 12:18:03 +00:00
Priyanka Kakadiya b82f6fee71 [IMP] hr: display warning when user is not linked to employee
On user form view, when no employee is linked to the user, we want
to display a message to the HR Officer (only) with the possibility
to create the employee profile with prefilled information.

Task-1916925

closes odoo/odoo#29659

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-04-08 07:58:01 +00:00
jem-odoo 3be372cfc4 [FIX] hr: restrict sudoing fields_view_get of res.users
Since d77ce4c2a9, the feature of editing own employee profile was
added. It was complicated with the access rights point of view because the
hr.employee fields are protected (groups="hr.group_hr_user"). To allow editing
its own hr.employee, it was required to `sudo` the field_view_get of res.users
(as the profile form view is a res.users form view, with related field from the
employee).

- Bug
The problem is that calling `fields_view_get` as `sudo` each time breaks the `groups`
mecanism on res.users views (not only form view). For instance, adding a field
on the form view with a group will always make it visible as the `groups`check
is done in sudo mode.

- Solution
This commit tries to fix this matter but reducing the `sudo` usage to
- only form view (we don't want this to applied to every res.users view type)
- only for internal user
- only in the flow of the "self editing profile", by checking the current action
- only for the current user (avoid to get the profile of other res.users by
using the same action)

- Side effect
The `groups` mecanism is still breaking on the "my profile" form view, as the
`sudo` is still applied in that case. We might tolerate this as the view should
only be accessible for the current user.

This is not perfect at all, but cleaning that properly might involve to redevelop
this sensitive feature.

Task-1916925
2019-04-08 07:58:01 +00:00
xtanuiha ea4a782f49 [ADD] base: add Archived filter for ir.rule
To easily find archived rules

closes odoo/odoo#32261

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-08 10:18:31 +00:00
xtanuiha 4c4f79dd73 [CLA] signature for xtanuiha 2019-04-08 10:18:12 +00:00
Aurélien Warnon 4b7fb75bc2 [IMP] survey: improve survey form usability
Task #1949652

Some fields were renamed/moved around to improve the survey.survey
form usability.

closes odoo/odoo#31775

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-08 07:09:01 +00:00
Odoo Translation Bot 2d30bd9698 [I18N] Update translation terms from Transifex 2019-04-01 02:44:26 +02:00
Odoo Translation Bot 18c735361a [I18N] Update translation terms from Transifex 2019-03-31 06:20:38 +02:00
Christophe Simonis 28cce6ce3a [MERGE] forward port branch saas-12.1 up to c0cf4049b2 2019-03-29 19:47:46 +01:00
Christophe Simonis c0cf4049b2 Revert "[FIX] delivery: picking weight not updated sometime"
This commit is not needed (and not wanted) in saas~12.1 due to
07bef887af that convert field
`move_ids_without_package` to a computed field with an invert method.

The invert method writes on `move_lines`, which will recompute the value
of `weight` field correctly.

This reverts commit b2b395467f.
2019-03-29 19:02:51 +01:00
Christophe Simonis 2a06f4dcf3 [MERGE] forward port branch 12.0 up to 09fb2469b4 2019-03-29 18:10:57 +01:00
Nicolas Martinelli f7301a8eef [FIX] website_quote: redirect quotes only
- Create 2 identical SO: one with a quotation template set, the other
  without
- Validate them
- Go to the portal at `/my/orders`, access both orders

The order without template redirects to `/my/orders/<ID>`, while the
order with template redirects to `/quote/<ID>`.

Once the SO is validated, there is no reason to show a different page.
The redirection should only apply to non-validated SO.

opw-1925131

closes odoo/odoo#32262

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-29 15:51:59 +00:00
Odoo Translation Bot 48d88b6e6d [I18N] Update translation terms from Transifex 2019-03-31 03:16:57 +02:00
Pierre Masereel 09fb2469b4 [FIX] payment_paypal: fix tests
Since changes made in this commit https://github.com/odoo/odoo/commit/fc1389f8d881adfb94ea1b784fb7104b9eee5d2d the value of field 'custom'
is now set and wasn't before.

closes odoo/odoo#32258

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-03-29 14:35:23 +00:00
Pierre Masereel 095a539f5c [FIX] payment_buckaroo: fix tests
Some values in the form have been changed in this commit:
https://github.com/odoo/odoo/commit/fc1389f8d881adfb94ea1b784fb7104b9eee5d2d
2019-03-29 14:14:07 +00:00
Nicolas LempereurandRomain Derie a4ce56fe56 [FIX] website_sale: pricelist ecommerce 1st install
Since 2d970942ba it is possible among other improvments to have a
pricelist on all website if it has a "code" or is "selectable" and has
no specified website.

Following this, the default "Public Pricelist" is not associated to a
website but since it is not selectable and has no code, we would get no
pricelist on the website on default installation without demo data.

With this changeset, the "Public Priclist" is set to selectable when
website_sale is installed.

opw-1961069
closes #32254

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>


Co-authored-by: Romain Derie <rdedoo@users.noreply.github.com>
2019-03-29 14:49:02 +00:00
Olivier Colson b344c3c601 [FIX] l10n_jp: fix tax accounts
Forward port of commit https://github.com/odoo/odoo/commit/084246a54ed68e2898e9c713345192b2a33ddd81 (10.0) into https://github.com/odoo/odoo/commit/5e9ebe86bae53f019981361bbcc2f03a5d49e0cb (11.0) had wrongly replaced account code A21809 by its old version, A21807, in tax templates. It made the module uninstallable, as A21807 does not exist anymore.

closes odoo/odoo#32252

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-29 14:01:19 +00:00
Vincent Schippefilt 7b884afbda [FIX] web: fix error handling of _applyChanges
After 5df4746c9a the error handling has
been changed inaccurately. This fix sets the error handling correctly.

closes odoo/odoo#32247

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-29 13:21:10 +00:00
Robot OdooAaron Bohy aab@odoo.comDavid Monjoie dmo@odoo.comMartin Geubelle mge@odoo.comRavi Gadhia rga@odoo.com
9aea7ae162 [MERGE] web,*: list view improvements
This branch brings several improvements related to the list view:

- grouped list views are now editable
- 'expand' attribute can be used to open by default the first level groups
- if there are a lot of groups, a pager is displayed (instead of having all
groups in the same page)
- when grouped on a many2one field, custom buttons (on the many2one
comodel) can be inserted in each group's header
- we can edit several records in a row in editable list views
- editable lists do not flicker anymore when switching a row to edit mode
- we can navigate through the cells in list views with the arrows (in
readonly)

Co-authored-by: Aaron Bohy aab@odoo.com
Co-authored-by: David Monjoie dmo@odoo.com
Co-authored-by: Martin Geubelle mge@odoo.com
Co-authored-by: Ravi Gadhia rga@odoo.com

Task 1915702

closes odoo/odoo#31756

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-04-02 15:46:39 +02:00
David Monjoie 8ea5a40417 [IMP] web: list: directional keys navigation in readonly
With this rev., it is now possible to navigate with arrows in list
views (except when editing, as in this case hitting the arrows moves
the cursor in the input/textarea), and to expand/collapse groups
with keyboard navigation.

Part of task 1915702
2019-04-02 11:57:00 +00:00
Aaron Bohy ca19b17fd3 [IMP] web: fetch records alongside read_group
This rev. adds params to the 'web_read_group' method, allowing to
search_read records inside each groups in a single RPC, instead of
doing a 'web_read_group' RPC followed by n 'search_read' RPCs,
where n is the number of opened groups.

Part of task 1915702
2019-04-02 11:57:00 +00:00
Aaron Bohy d0164d834b [IMP] web,account: editable list: no more position absolute
Before this rev., widgets were absolutely positioned in table
cells. This cause an undesired effect with text fields, as their
textarea overflowed and overlapped the next lines.

With this rev., wigdets are now statically positioned, and the cells
height and width don't change when switching a row to edit mode.

Part of task 1915702
2019-04-02 11:55:57 +00:00
Aaron BohyandMartin Geubelle 9fbb4fb44f [IMP] web: editable list: table-layout: fixed
This rev. changes the layout of *editable* list views to a fixed
layout. This means that we are now responsible of the width of
each column. To do that, we associate with each field type a
factor, and the higher the factor is, the larger the column will
be (w.r.t. the others). This default value can be overriden in the
arch.

The fixed layout allows to remove the absolute positionning of
widgets inside editable lists (done in the next commit).

Part of task 1915702

Co-authored-by: Martin Geubelle <mge@odoo.com>
2019-04-02 11:55:57 +00:00
Martin Geubelle a75fa7e377 [IMP] web: allow mass update in editable lists
From an editable list view, if you select several lines then change
a field, you are now asked if you want to apply the same change on
all selected lines. If you accept, a write is directly performed
(without applying onchange, as the records are reloaded and the view
re-rendered). If you decline, the classic behavior still occurs.

Part of task 1915702
2019-04-02 11:55:57 +00:00
Martin Geubelle 015958dc17 [IMP] web,base: put buttons in list group headers
It is now possible to put buttons in the list view group headers.
When the view is grouped by a many2one field, those buttons
appear next to the header title when the group is opened.

The buttons are specified in the views in a <groupby> tag in the
list arch, with the following structure:
    <groupby name="groupedField"> <!-- must be a many2one -->
        <button type="object" name="my_method" string="Button1"/>
    </groupby>

It is also possible to add `field`, inside the `groupby` which can
be used for modifiers. These fields thus belong on the many2one
comodel, like:
    <groupby name="partner_id">
        <field name="name"/> <!-- name of partner_id -->
        <button type="object" name="my_method" string="Button1"
		attrs="{'invisible': [('name', '=', 'Georges')]}"/>
    </groupby>

These extra fields are fetched in batch when grouping on the field.

Part of task 1915702
2019-04-02 11:55:57 +00:00