Commit Graph
117975 Commits
Author SHA1 Message Date
jem-odoo 09658b041a [FIX] purchase_stock: display form view
Since the split of stock and purchase, some
field are badly displayed on PO form view.
This is due to a bad xpath. This commits
fixes the issue.
2018-06-05 14:55:13 +02:00
Christophe Simonis 279d928693 [FIX] core: always load base and web as server wide modules
Since 285ead28e3, `base` should be loaded
as a server wide module to enable rpc routes.
2018-06-05 14:46:24 +02:00
RomainLibert 83aa86d658 [IMP] website_event: avoid reading of emails
The new route make_event_ics_file received a list of attendee ids and was sending
the emails associated with these in an ics file, this could potentially
give out some information about the attendees.

(see commit 7862b2b71c)

Also the method get_ics_file had no reason to be public and so is now
private.

Closes #24711
2018-06-05 12:22:30 +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
Laurent Smet 02bc8e8c7f [FIX] l10n_*: fix broken res.country.state master data
The installation of l10n_de, l10n_nl and l10n_vn failed since:
https://github.com/odoo/odoo/commit/7dc30bf735a1d7898f5298204e3afdcdb37994a4
https://github.com/odoo/odoo/commit/101e0a7ef792c5b1af95a08931647fb485af2ec6
https://github.com/odoo/odoo/commit/dc99a666f81e6c4c86b9e5b835947be2ab2100d9
2018-06-05 10:56:15 +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
Pierre Masereel 675ed5d9dd [FIX] expression: interpret (X, 'child_of', False) as false
Interpret such domains that do not really make sense as falsy, and log a
warning when it occurs.
2018-06-04 17:07:50 +02:00
XavierDo 3a2c87674b [FIX] web: getFocusableElement error in tree view
When a line in a editable tree view has no acivable element
(readonly or toggle_bollean fields only) the currentFieldIndex
will be null after selecting the row, and when trying to edit a
field (boolean field_toggle in this example) an error will be
thrown when trying to put focus on currentWidget.
We need to check that the currentWidget is not undefined.
2018-06-04 16:49:24 +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
Martin Geubelle aabe35c76c [DOC] add documentation for position='move'
Feature merged in odoo/odoo@eee245c
2018-06-04 09:52:08 +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 fc5e61b63d [I18N] Update translation terms from Transifex 2018-06-03 07:04:06 +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
Raphael Collet a058bf18d3 [FIX] resource: field tz defaults to UTC if no timezone found 2018-06-01 18:27:52 +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
jem-odoo a0546578ee [MERGE] sale_timesheet: invoice from project overview
These commit allows users to create sales order, and invoice
from the project overview. To do, the overview is now refreshed
when naviguating throught the breadcrumb, and supports action
buttons on its control panel.
Also, some stat buttons are added on the overview (sales order
and invoices).

The process of invoice creation is the same wizard than the one
from the sale order.
Thoses actions are only available when there is no ambiguity
to determine the SO from the project, or for non billable project
(to create the SO).

Task #49213
Closes #24280
2018-06-01 15:47:16 +02:00
jem-odoo 72e3ebc4f9 [IMP] sale_timesheet: overview access
On sales order form view, we display a "project overview"
stat button. It redirects to the overview of the only
billable project of the SO.
To avoid access error, and because this dahsboard is usefull
only for project manager, only those ones will have access to
this overview. So, stat button (Sales order) and label on
project kanban are aonly visible for manager.
2018-06-01 15:14:23 +02:00
jem-odoo 6b1aec5bb7 [IMP] sale_timesheet: SO/INV stat button on project overview
Now that the overview is refreshed when it is displayed and that we
can create SO/INV from it, it is usefull for the users to have
a stat button displaying those new documents directly from
the overview.
This commit use the already existing mecanism to display
Sales Order and Invoices stata buttons.
Thoses 2 stat buttons are only visible for salesperson seeing
all document, to avoid access errors.

Task #49213
2018-06-01 15:14:23 +02:00
jem-odoo 55ca3dd2b1 [IMP] sale_timesheet: invoice from plan project
We want to invoice from the project overview. To do so,
a button can help people: it is only visible when an order
linked to task in that project has something to invoice
Any sale order line, even the ones with no service product
will be invoiced.

However, the user will have to choose which SO (involved in
the project) to invoice. Then the "invoice order" wizard
takes over.
2018-06-01 15:14:23 +02:00
jem-odoo 9f3040ee1f [IMP] sale_timesheet: control button on plan project
This commit makes the project overview handle action
button in its control panel. When calling server to get
overview HTML code, we also get a list of actions to display
in the control panel. Those are rendered client side.

Since when an action is done, we usually don't want the button
to be display anymore, reloading the overview is required.
The overview is now refreshed when navigating with the breadcrumb,
so each time the overview is displayed, an RPC call to the server
is done (`do_show` method override).

Task #49213
2018-06-01 15:14:07 +02:00
jem-odoo d8f2b1b87e [IMP] sale_timesheet: wizard to create SO from project
This commit provides a wizard to create a SO from
a non billable project. It sets sale_line_id on the
project, and the project on the SO line to simulate
the project was created by the SOL.
The created SO contains one line with a selected
service product, with ordered qty set as the total
of planned hours of all task in projects.
The wizard also links all non billable active
tasks of the project to the SO line (and its
timesheet entries).
2018-06-01 15:14:07 +02:00
Raphael Collet 627292f7f3 [IMP] convert: simplify context when creating records
The context was containing a dictionary under the key `install_mode_data`,
which was informing about the model, xml_id, module, filename.  Actually only
the module and filename were necessary, and the others were slowing down the
import because of generating artificially different environments.

The context now has two entries `install_module` and `install_filename`.
2018-06-01 13:30:28 +02:00
Raphael Collet 655ec91807 [IMP] models: simplify API of _parent_store_create and _parent_store_update
The parameter `vals` is no longer given, and the first method has been adapted
to work on several records.
2018-06-01 13:30:28 +02:00
Raphael Collet 23a3ee1254 [IMP] models: no need to mark non-stored fields as modified
Those will be handled by the transitive closure made over non-stored
dependencies.
2018-06-01 13:30:28 +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
Jeremy Kersten 400b52d98c [IMP] website_crm_partner_assign: track onchange on grade related fields
After this comit, when grade_id, activation or partner_weight is updated, we
keep a log in the chatter.
2018-06-01 11:13:14 +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
Martin Geubelle eee245cee8 [IMP] base: allow to move an element in inherited view
The `position='move'` has been introduced to move an element in an inherited
view.

It's used as
<xpath expr="//@target" position="after">
    <xpath expr="//@node" position="move"/>
</xpath>

or also

<field name="target_field" position="after">
    <field name="my_field" position="move"/>
</field>

The xpath with a position `after`, `before`, `inside` or `replace` can thus now
have another xpath as *direct* child with position `move`.
2018-06-01 10:19:09 +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
Raphael Collet 975c6c8639 [REF] resource calendar (#24717)
Refactor resource calendar and resource mixin:
 - add a required timezone field on models 'resource.calendar' and 'resource.resource';
 - resource calendar attendances are now computed in the timezone of the resource
   or the calendar;
 - improve API of 'resource.calendar' and 'resource.mixin';
 - avoid other modules from using the implementation methods of 'resource.calendar';
 - refactor implementation of 'resource.calendar' to make it more efficient.
2018-05-31 20:28:12 +02:00
Thibault Delavallée f5af0714e2 [REM] calnedar: remove commented leftover of 4a59f93d15
It way to hot here. Forgot to remove commented views.
2018-05-31 16:54:06 +02:00