Commit Graph
116149 Commits
Author SHA1 Message Date
Nicolas Martinelli 7693ba2d35 [FIX] purchase: qty updated
- Create a PO with 2 different product lines (A & B), confirm.
- Change quantity of B and save

The chatter message mentions A, while the quantity of B was changed.

opw-1849258
2018-06-08 09:41:19 +02:00
Swapnesh Shah 59bfef4c27 [Fix] hr_holidays: do not copy parent_id
When creating an allocation by employee tag if you copied any allocation
made, it was still linked to the parent allocation, hence when
confirming/refusing the parent allocation it would confirm/refuse the
copied one too.

Closes: #25106
2018-06-07 17:02:09 +02:00
jem-odoo a7d9d966a5 [FIX] models: m2o display name as sudo in read_group
In 10.0, the resolution of the m2o field in a read group was
done with a `read` (which sudo the name_get). So, the access
rights were bypassed to get the display_name of the related
records.
In 11.0, a call to `name_get` but not as `sudo` causing access
error in some case. For instance;
- a user has read access on project
- he log some timesheets
- its access to project is removed, but not the timesheet ones
- trying to access its own timesheet via the grid view (which does
a read_group)
- the user gets the access error for project.

The read_group should reproduce the behavior of the `read` method,
so the `name_get` for m2o field during a read_group is now sudoed
to restore previous behavior.

opw-1855942
2018-06-07 16:52:00 +02:00
Nicolas Lempereur f6a74f40b5 [FIX] portal: typo in domain portal_message_fetch
In bd4f09f there was a typo in the domain portal message fetch (two `&`
instead of one), luckily this did not cause an error in 11.0

But in master expression.AND normalizes the domain, thus we got an error.

opw-1819702
closes #25131
2018-06-07 15:17:05 +02:00
Nicolas Martinelli 9d85fea1c3 [FIX] board: add extra info
When an element is added to the dashboard, it is unclear to the user
that he needs to refresh the browser for the changes to take effect.

opw-1853242
2018-06-07 13:19:17 +02:00
Katherine Zaoral 2c91f37e38 [CLA] Update adhoc CCLA
To add zaoral

Closes #25110
2018-06-07 09:38:02 +02:00
Nicolas Martinelli 21099f3eaf [FIX] stock, stock_account: valuation with owner
Issue 1
-------

- Set a product with:
  Inventory Valuation: Manual
  Costing Method: Average Cost (or Standard Price)
- Receive 1 unit @ 10, set an owner

In the 'Inventory Valuation' report, the product is valued @ 10 while no
accounting entry was created.

The system simply multiplies the available quantity by the cost price,
without taking into account the ownership of the quants.

Issue 2
-------

- Set a product with:
  Inventory Valuation: Automated
  Costing Method: Average Cost (or Standard Price)
- Receive 1 unit @ 10, set an owner

In the 'Inventory Valuation' report, the product is valued @ 10 while no
accounting entry was created.

Once again, the system simply multiplies the available quantity by the
cost price, without taking into account the AML.

Solution
--------

A slight refactoring of the `_compute_stock_value` method is necessary
to make consistent the the FIFO computation and the Standard / Average
method:
- in case of manual valuation, the quantity on stock moves are taken
  into account
- in case of perpetual valuation, the quantity on AMLs is taken into
  account

The method `_compute_quantities_dict` needs a minor change so a `False`
value can be handled correctly.

The FIFO method is slightly changed:
- the quantity at date takes into account the owner
- in case of perpetual valuation, AMLs are used instead of stock moves

Bonus point: an error was discovered in `_create_account_move_line`
thanks to the test `test_change_cost_method_1`. The forced quantity
should follow the same sign logic than the product quantity.

opw-1849535
2018-06-07 08:30:04 +02:00
Nicolas Martinelli ab1690b3de [FIX] mass_mailing: URI too long
Since commit 6494f51171, all images in mass mailing are created as
attachments. This can lead to URI too long to be handled by some proxy,
e.g. Nginx.

opw-1853188
2018-06-06 14:49:25 +02:00
Nicolas Martinelli 10da9045a6 [FIX] purchase: fix test
The `price_unit` on `stock.move` is not rounded since it is a technical
field. Therefore, the comparison might fail depending on the rate (which
happens after June 6th because of `base.rateUSDbis`).
2018-06-06 13:45:00 +02:00
Martin Trigaux e7aff3775f [FIX] calendar: shows the event failing
When importing many events (e.g. google synchronisation), it is not clear which
one is failing

opw-1855471
2018-06-06 10:21:23 +02:00
Lucas Perais (lpe) 087dd851a2 [FIX] event: events smartbutton on partner display if user has rights
With a user that do not have access to the the Event module,
go into Contacts > open a contact

Before this commit, a ACL error was thrown. This was because of the presence of
a smartbutton refering to events in the form view of the partner

After this commit, the form view of the partner displays correctly

OPW 1851783
closes #24931
2018-06-06 10:12:02 +02:00
Goffin Simon 9d943f7a99 [FIX] web: Button delete on SO line unclickable
Due to ef540eb006, the button delete was not clickable on a SO line
on safari.

opw:1848652
2018-06-06 09:59:49 +02:00
Tomas Alvarez 1db6c8d0ad [FIX] mail, web_editor: allow tel links in email templates (#24926)
Before this commit: links like `tel:+1-555-555-5555` were being replaced
both in javascript (prefixing `http`, when using the summernote editor)
and python (prefixing the base url, when they were added directly to the template).

After this commit: the replacement is avoided on links with `tel` scheme.

This is related to commit: 8b97a39
2018-06-06 09:57:53 +02:00
Lucas Perais (lpe) 654ee788d9 [FIX] web: new record with o2m also with new records prevent name_get
Have a model A with a o2m to B.
In the list have a field  B > m2o > C

Also have a sequence field (widget handle) on B

Then Create a record A
Arrange yourself to have two new records B popping right away (through an onchange)
in the o2m. Their C field have to be empty

Resequence those two B lines with the handle

Before this commit, there was a traceback when trying to do an name_get on the C fields
Since both of them are empty, there is no record in the localData
Hence, no model. And also no records anyway, so no need to do a name_get

After this commit, there is no traceback, the name_get is avoided when no data is to be fetched

OPW 1853088
closes #24988
2018-06-06 09:51:56 +02:00
Martin Trigaux 6ad1a36b6e [FIX] google_calendar: correct migration to requests
Introduced at 01e3514
.code was on the previous urllib2 version but on requests, the code is accessed
through status_code

opw-1855471
2018-06-05 16:45:47 +02:00
len-odoo 1b272a2050 [FIX] web: display correct week number in calendar views
To compute the week number, the fullcalendar.js library uses the locale.
It depends on the day on which the week starts (usually Sunday in the Americas,
Monday in Europe), as well as which week is considered the first of the year.
In commit:
https://github.com/odoo/odoo/commit/717b472ef9ad6d2998cbefb4aafe2d1199e6235d
the starting day was explicitly added, however it was computed as isoWeekday.
The ISO first day of the week is always on Monday.
It resulted that if the locale used Sunday as first day of the week, the
calendar would consider it to be of the previous week, and thus displayed
(weeknumber - 1).
The fix does the same thing as was done in v10, taking the locale into account:
https://github.com/odoo/odoo/commit/df124080b624a8bdb86fec352fe690725ed36bac

opw 1853745
2018-06-05 16:01:19 +02:00
Christophe Simonis e7f0dffb6a [MERGE] forward port branch saas-15 up to c301122b5f 2018-06-05 15:10:45 +02:00
Christophe Simonis c301122b5f [MERGE] forward port branch saas-14 up to a002210d93 2018-06-05 12:00:11 +02:00
Christophe Simonis a002210d93 [MERGE] forward port branch 10.0 up to c25b68f324 2018-06-05 11:50:03 +02:00
Goffin Simon a5e6afe559 [FIX] purchase: Drop shipping with no access to Purchase
Let's consider a Sales user U with no access to Purhcase

Steps to reproduce the bug:
- Create a SO with one line with the drop shipping route
- Validate the SO

Bug:

 A access error was raised because the user has no access right on
Purchase.

opw:1851301
2018-06-05 11:29:26 +02:00
Adrian Torres c25b68f324 [FIX] orm: re-create constraints of extended fields
Before this commit:

* Module A defines a field X of model M
* Module B inherits from model M without touching field X
* Module C inherits from model M and extends field X by giving an INDEX
/ NOT NULL constraint.
* Module B and C depend from Module A, but not each other

If all three modules are installed and Module B is updated, the INDEX /
NOT NULL constraint could be dropped.

This happens because Module B can be loaded before Module C is loaded,
if that's the case, then after the upgrade of Module B, during the
schema checking, we verify that the field object we have and the field
on the DB are the same, since Module B doesn't introduce the index then
this check is false and we drop the index. When we get to loading Module
C, we do not do any schema checking because the module is not marked as
`to upgrade`, therefore the index is lost forever.

To solve this, we re-init the models that belong to the set of the intersection
between upgraded and modified models and loaded and modified models.

Fixes #24958
2018-06-05 11:07:33 +02:00
Christophe Simonis bc8f5c5e42 [MERGE] forward port branch 9.0 up to 0046bf7292 2018-06-05 10:54:09 +02:00
Goffin Simon d91c0a2013 [FIX] sale: Number of SO linked to an archived article
When archiving a product template P with one SO linked to it,

- Going to P by Accounting > Configuration > Products > P shows 1 sale
in smart button

- Going to P by Accounting > Sellable products > P showed 0 sale in smart
button

Now it shows 1 sale in these two cases.

opw:1852948
2018-06-05 09:58:28 +02:00
Lucas Perais (lpe) 0046bf7292 [FIX] web_editor: disable button when html field loading
Backporting bed33e1 and 472c5a4f9f from v10.0

OPW 1853150
closes #25043
2018-06-05 09:52:09 +02:00
Lucas Perais (lpe) 2039753ef4 [FIX] account: reconcile in liquidity accounts.
Make one Payment
Reverse the entry of this payment.

Before this commit, only the lines in the receivable were reconciled.
The lines in the liquidity were'nt, leaving the two entries appearing
in some reports

After this commit, the four lines are reconciled two by two, even in the liquidity
account

OPW 1816641
closes #25026
2018-06-05 09:47:28 +02:00
Nicolas Martinelli d2b7be055a [FIX] delivery: tracking reference
- Create a picking, set as 'Carrier': 'Free delivery charges'
- Enter a 'Tracking Reference'
- Validate the picking

The tracking reference is removed.

opw-1849279
2018-06-05 08:38:38 +02:00
Nicolas Martinelli b837bbdd8b [FIX] mass_mailing: unsubscribe if trailing '/'
If the `web.base.url` contains a trailing `/`, the replacement of the
`/unsubscribe_from_list` link won't work since the string to replace
will be `my_url//unsubscribe_from_list` instead of
`my_url/unsubscribe_from_list`.

Fixes #24731
opw-1848572
2018-06-05 08:35:50 +02:00
Christophe Simonis 97d611fcd4 [MERGE] forward port branch 9.0 up to 66a60c70f3 2018-06-04 18:06:44 +02:00
Denis Ledoux 579f67166a [FIX] websiste: determinist homepage for portal users
In the portal module,
the `index` method from the `web` module controllers
is overriden to redirect `/`
to the portal `/my` for the portal users,
instead of the regular backend `/web`.

However, when `website` is installed,
this behavior should not happen,
as you would like the signed in portal users to
be able to see the website homepage,
and not to be redirected to `my` when
they try to access `/` root path of the website.

Because the override in the website module was done on the
`index` method coming from the `web` module instead of the `portal`,
according in which way the Python module were loaded,
it sometimes redirected to `/my`, sometimes it correctly
displayed the homepage. This is because the modules are not
loaded in a determinist order.

To summarize, on runbot, if you logged as portal/portal,
one time on two you were redirected to `/my`, and the other
time you saw the homepage correctly.

As `website` depends on `portal`,
we have the possibility to override the `index` method
of `portal` instead of the one of `web`,
to force the determinist order,
and therefore the determinist behavior of the homepage for
portal users.
2018-06-04 15:57:56 +02:00
Nicolas Martinelli 6b0c7a33d6 [FIX] stock_account: do not display to_refund on return picking as toggle
The original issue was fixed at 2f5e44d40b

This reverts commit 0b1b860d97.

opw-1854613
2018-06-04 11:31:22 +02:00
Adrian Torres 661542a4a7 [FIX] account, l10n_generic_coa: remove unused master data
When installing the `account` module, some of its master data is
installed as `l10n_generic_coa` data.

During the uninstallation of `account`, `l10n_generic_coa` is
uninstalled first since its a dependency of `account`, but some of its
master data cannot be uninstalled yet as its still being referenced in
some `account` et al tables.

When `account` is being reinstalled, the datas will be updated instead
of created since they were left intact in the database, this proves
troublesome as the code YAML interpreter adds some context variables
when creating records but not when updating records, these context
variables are necessary in order to trigger some onchanges and defaults
for fields that are required, since this does not happen we get a `NOT
NULL CONSTRAINT` error when re-installing the `account` module.

This patch solves this issue by adding an uninstall_hook that will
delete all ir_model_data that belongs to the module `l10n_generic_coa`
upon its uninstallation.

Fixes #25005
2018-06-04 11:30:49 +02:00
Odoo Translation Bot 75c44c4778 [I18N] Update translation terms from Transifex 2018-06-04 11:08:02 +02:00
Lucas Perais (lpe) 79f0658c10 [FIX] point_of_sale: pos_config write should be @multi compliant
Avoid "expected singleton" when writing on multiple pos_config

closes #24953
2018-06-04 11:06:09 +02:00
Nicolas Martinelli dae6efa9a5 [FIX] stock: Stock Level Forecast
- Create the following BOM for Product A:
  Comp 1: 1 Unit(s)
  Comp 2: 5 Unit(s)
- Update on-hand quantity:
  Comp 1: 10 Unit(s)
  Comp 2: 30 Unit(s)
- Create a MO for 10 Unit(s) of A
- Check the Quantity on report 'Stock Level Forecast':
  Comp 1:   0 Unit(s)
  Comp 2: -20 Unit(s)
- 'Check Availability' on the MO
- Check the Quantity on report 'Stock Level Forecast':
  Comp 1:  0 Unit(s)
  Comp 2: 30 Unit(s)

The `partially_available` state has been added with Inventory
refactoring in v11, and needs to be taken into account.

opw-1849556
2018-06-04 10:51:06 +02:00
Nicolas Lempereur 57a64bbc86 [FIX] website_event: unblock button when no reserve
In 11.0, this change e9454e79 solved the use case of:

- opening the registration of a ticket
- discard

=> the page must be reloaded to register a ticket

A new report is that since 9.0, if we try to register 0 ticket we would
also have to reload the page.

This commit backports e9454e79 and solves the 0 ticket registration.

10.0 version of 9.0's #24966
opw-1851622
closes #24991
2018-06-04 10:20:27 +02:00
Lucas Perais (lpe) a1d5f32296 [FIX] base: res.config.settings discard should actually discard changes
Before this commit, some values of res.config.settings were saved
(e.g case of website settings were some fields are related)

After this commit, they are not saved

OPW 1853230
closes #24972
closes #25028
2018-06-04 09:13:58 +02:00
Nicolas Martinelli 8dbaaf896e [FIX] stock: assign move
- Create a BOM for Product A, using Component B
  1 Unit of a is built with 1 Unit of B
- Update on hand quantity for B to 3.0
- Create a MO for 5 Units of A
- Update the quantity to produce to 3.0

The button 'Check Availability' never disappears.

The core of the problem is that the move remains "Partially Available".
Indeed, if there is no product available (`available_quantity <= 0`),
the stock move is skipped and its availability status is not updated.

We slightly change the logic by first checking if we need any quantity.
If not, the move can be considered as assigned.

opw-1850499
2018-06-04 08:32:39 +02:00
Odoo Translation Bot 395459d077 [I18N] Update translation terms from Transifex 2018-06-03 04:41:19 +02:00
Odoo Translation Bot d88dd23ae2 [I18N] Update translation terms from Transifex 2018-06-03 00:27:35 +02:00
Nicolas Lempereur f71b934ce6 [FIX] website_event: unblock button when no reserve
The website_event_questions override EventRegistrationForm's method
on_click and expects the returns is a deferred.

This commit provides a deferred in all instances avoiding an error.

Also what was done in e9454e79 and enables back the Register Now
button if no ticket was selected.

opw-1850527

In 11.0, this change e9454e79 solved the use case of:

- opening the registration of a ticket
- discard

=> the page must be reloaded to register a ticket

A new report is that since 9.0, if we try to register 0 ticket we would
also have to reload the page.

This commit backports e9454e79 and solves the 0 ticket registration.
Also if website_event_questions was installed there was an error
preventing an error message to be displayed.

saas-15 version of 9.0's #24966
opw-1851622
closes #24967
2018-06-01 15:55:56 +02:00
len-odoo 42aff92a4e [FIX] account, purchase, sale: properly quote the name of the email sender
formataddr (from the email python library) writes email_from as '"name" <email>'
in the email_from field of the mail.compose.message record.
When the mail is rendered, onchange_template_id is triggered.
This then overwrites the values of email_from among other fields.
What happens is that it uses the email_from field from the template to render
the email_from, bypassing what was put by formataddr before.
What happens in some cases is that it is rendered as 'name <email>'
(note the quotes have been stripped away).
If name contains arbitrary symbols, e.g. name = 'pépé [company] <pdg>, ohlala',
then getaddresses which is supposed to parse the (name, email) pairs gets thrown
off (in particular, <pdg> will be interpreted as an email address, and many
other problems with the various special symbols).
It then gives these wrong elements as email addresses, which will usually crash
when getting non-ascii symbols (i.e. these strings don't respect the relevant
RFC for email addresses).

Closes:
https://github.com/odoo/odoo/issues/23502
https://github.com/odoo/odoo/pull/2311823118

opw 815202
opw 1824243
2018-06-01 13:06:09 +02:00
Adrian Torres a5ccc1b6b5 [FIX] orm: re-create constraints of extended fields
Before this commit:

* Module A defines a field X of model M
* Module B inherits from model M without touching field X
* Module C inherits from model M and extends field X by giving an INDEX
/ NOT NULL constraint.
* Module B and C depend from Module A, but not each other

If all three modules are installed and Module B is updated, the INDEX /
NOT NULL constraint could be dropped.

This happens because Module B can be loaded before Module C is loaded,
if that's the case, then after the upgrade of Module B, during the
schema checking, we verify that the field object we have and the field
on the DB are the same, since Module B doesn't introduce the index then
this check is false and we drop the index. When we get to loading Module
C, we do not do any schema checking because the module is not marked as
`to upgrade`, therefore the index is lost forever.

To solve this, we re-init the models that belong to the set of the intersection
between upgraded and modified models and loaded and modified models.

Fixes #24958
2018-06-01 10:55:35 +02:00
Nicolas Lempereur 66a60c70f3 [FIX] website_event: unblock button when no reserve
In 11.0, this change e9454e79 solved the use case of:

- opening the registration of a ticket
- discard

=> the page must be reloaded to register a ticket

A new report is that since 9.0, if we try to register 0 ticket we would
also have to reload the page.

This commit backports e9454e79 and solves the 0 ticket registration.

opw-1851622
closes #24966
2018-06-01 10:53:30 +02:00
Nicolas Martinelli 195c2fc05f [FIX] website_sale: performance with carousel
When the carousel is activated, the following will load all variant ids
in the cache (cf. `_in_cache_without`):
```
<t t-set="variant_img" t-value="any(product.mapped('product_variant_ids.image_variant'))"/>
```

When accessing the `image` field at:
```
<div t-if="variant_img" class="..." itemprop="image" t-field="product.product_variant_id.image" t-options="..."/>
```
All variants in cache will have their image resized by the method
`_compute_images` on `product.product`. In case of a product with
hundreds of variants with images, this will take a major amount of time.

If we replace by `product[:1]`, the system uses another cache, and
doesn't fetch the image of all variants.

opw-1844783
2018-06-01 09:00:26 +02:00
Odoo Translation Bot ea3b895589 [I18N] Update translation terms from Transifex 2018-06-01 02:39:45 +02:00
qdp-odoo 579b233d38 [FIX] l10n_fr_certification: can't change module dependancies on stable version
Commit https://github.com/odoo/odoo/commit/2eb344f23b3a9daa8e7c7ddaead145a8b05b39bf changed the dependancies of l10n_fr_certification which is not acceptable on stable. Instead, the method to check is now moved in account module (to avoid duplicated) and it is called by l10n_fr_certification and account_lock module.
2018-05-31 14:37:24 +02:00
Laurent Smet fb59b56014 [FIX] account: fix test on closed period since account_lock module
Module account_lock has been introduced by:
https://github.com/odoo/odoo/commit/2eb344f23b3a9daa8e7c7ddaead145a8b05b39bf

A new constrains appears on the lock dates: their must not be set
after the last day of the previous month.
Then, it breaks the test on closed period that set the lock date 'yesterday'.
2018-05-31 13:13:14 +02:00
Laurent Smet 2eb344f23b [ADD] account_lock: new module making the lock date irreversible
Was task: https://www.odoo.com/web#id=38178&view_type=form&model=project.task&action=333&active_id=967&menu_id=4720
Was PR #22094
2018-05-31 10:06:19 +02:00
Nicolas Martinelli 074ec1aeae [FIX] account: manual payment method
Commit 5439e72a4e introduces the automatic creation of a journal
for a payment provider. However, the journal created doesn't have a
default payment method, to avoid showing it in the backend.

In the case of the eCommerce with automatic invoice creation, this
set-up returns a 500 error after an online payment. Solving the problem
is not obvious for the end-user.

The error comes from the fact that the 'Manual' payment method is not
available on the journal. We can remove this check.

opw-1853011
2018-05-31 08:23:39 +02:00
Lucas Perais (lpe) 16a8459a2e [FIX] sale_mrp: allow production without finished products
Have a mrp.production that you cancel, and delete the finished products lines

Before this commit, the computation of the sale_name crashed because we did
an index selection on an empty recordset

After this commit, there is no crash

opw 1851217
closes #24923
2018-05-30 14:14:09 +02:00