Commit Graph
116179 Commits
Author SHA1 Message Date
Nicolas Martinelli 9a3fc2a06f [FIX] base: P3.5 - P3.6 compatibility
In P3.6, the error message has changed.
2018-06-12 15:48:43 +02:00
Adrien Dieudonne 25955f6d94 [FIX] web: prevent web client from blocking some view
Before this commit some rpc was blocked and we didn't see
lost connection notifications.

Steps to reproduce:
1) Go to any form view
2) Force disconnected from the network
-> The "Connection lost" notification appears
3) Get connection back
-> The "Connection restored" notification appears
3) Close the connection again
-> No notification appears and the user aren't notify
that the internet connection is lost.

Related commit: @47cf31b53

Note: It's now important to notify the user about connection loss
because a recent improvement in mobile app replaces the 'retry screen'
and let the webclient handle connection issues by itself.
The single odoo mobile app is supposed to work with all databases
from 10.0.
2018-06-12 15:41:24 +02:00
mpanarin 4178684fa3 [IMP] mrp: make mrp_bom_structure_report more extensible
by moving child values to a separate method. This way, other modules can
properly add or remove fields to the report without overriding it
completely and breaking the inheritance
2018-06-12 11:56:50 +02:00
Yannick Tivisse dd3faf40fa [FIX] crm: Don't modify the sales team when removing the salesman
Purpose
=======

Currently, if we remove the salesman on the lead, the sales team will
be replace by either the sales team of the current user or the default
sales team.

That way, by removing the salesman, we loose information about the sales
team, and that way we loose information about the origin of the lead.

Specification
=============

Don't overwrite the sales team when removing the salesman on the
the lead.
2018-06-12 11:34:03 +02:00
Daniel Dico 8be5cc0980 [ADD] base: set vat_label for Canada
Closes #25052
2018-06-12 10:19:11 +02:00
Luis González d5d797360a [FIX] base: Avoid exception when showing error in namespaced qweb node
Before this commit, if a SyntaxError or any other exception occurs in a
qweb attribute, and the path to the node contains at least one
namespaced tag, e.g.:

<mynode:node xmlns:mynode="http://example.com/mynode">
    <field t-att-value="'This is a TypeError' + []"/>
</mynode:node>

the following exception is raised, instead of the actual one:
lxml.etree.XPathEvalError: Undefined namespace prefix

After this commit, if the path to the failing node contains a namespaced
tag, the node is not retrieved, to avoid the above exception, So this
one will be raised:

Error to render compiling AST
TypeError: Can't convert 'list' object to str implicitly
Template: module.template_name
Path: /templates/mynode:node/field

In addition, a test case was included, to ensure this works as expected

Closes #24824
opw-1853232
2018-06-12 10:14:29 +02:00
Andreas Perhab e34a9ba58f [FIX] test_pylint: incompatibility between pylint 1.6 and python 3.6
reference: https://github.com/PyCQA/pylint/issues/1349

pylint 1.6 and python 3.5 (and below) should work fine, so no need to
force people to upgrade there.
2018-06-12 10:12:09 +02:00
Long Do 869b833618 [FIX] mrp_repair: fix templates duplicating report when printing it
We are looping twice on docs. To have a minimal diff we just try to reuse
existing variable but with loops correctly taken into account.

Closes #25008 .
2018-06-12 10:05:52 +02:00
hoanglong87 b0f1886f97 [CLA] Update tvtmarine-automation.md 2018-06-12 10:05:52 +02:00
Goffin Simon bf3bb5ef50 [FIX] mrp, stock: Duplicate Detailed Operations
Steps to reproduce the bug:

- Create a stockable product P tracked by serial number with route BUY
- Create PO with 5 P and validate the PO
- On the picking, just set one serial number and create a backorder
- Go on the backorder

Bug:

8 lines were created:
    - 4 lines with one reserved quantity
    - 4 lines with no reserved quantity

Now only 4 lines with one reserved quantity are created.

opw:1847714
2018-06-12 10:01:18 +02:00
Swapnesh Shah 651a7bdada [FIX] sale: disable link from pivot view for sale
Before this commit, linking was enable for pivot view of model sale.report.
User that click on a cell will be redirected on a default view list/form
with all fields.

Now linking is disabled.

If you want to open the sale order on click, you need to start with the
pivot view from model sale.order.

This commit closes #25079
2018-06-11 16:59:37 +02:00
Erick Birbe 10c1187e7b [FIX] website_sale_stock: product cart_qty without request
Reading product's `cart_qty` computed field directly with the XMLRPC API
failed because, in such case, the request is unbound.

Fixes #21530
2018-06-11 16:59:37 +02:00
Petar Najman 824f5eec1a [CLA] Modoolar signs Odoo's CCLA
Closes #25181
2018-06-11 16:25:43 +02:00
Lucas Perais (lpe) bf0fffff44 [FIX] base: rng tree def: js_class must be included
Before this commit, the js_class attribute on a tree arch was not present in the RNG of the tree view.
This is inconsistent with what is done in Odoo, where that attribute is used for kanban views,
is defined in the view_manager to select the widget,
yet unusable for other views.

After this commit, we add this attribute in the RNG to be able to use it in tree views

Linked to OPW 1837565
closes #25088
2018-06-11 15:01:00 +02:00
tslai ada4235582 [FIX] website_sale_wishlist: avoid traceback when product has been unpublished
Before this commit, if you add in your wishlist a product, and that this product
become unpublished, the user will have a traceback.

After this commit, we filter the wishlist product to only show published product.

This commit closes #24857 and closes #24618
2018-06-11 12:56:40 +02:00
Duc Dao 91bcd84a02 [FIX] account: Only allow admin to set the first invoice sequence
Purpose
=======

When a Access Rights user create the invoice for the first time, when
click save it will raise an access right issue

A user belong to group Access Rights, when he create a invoice he'll
be able to edit 'sequence_number_next'
The reason is he belongs to 'group_erp_manager' which makes _is_admin
return True.

However, he does not have rights to edit on model 'ir.sequence.date_range'.
So that we should not allow him to edit the sequence of invoice in any case

Specification
=============

Since only users belong to 'group_system' can edit model ir.sequence.
We should not allow other users edit sequences on invoice form, so
the field won't be displayed for them to edit
2018-06-11 12:44:11 +02:00
Pedro M. Baeza 1bf483b047 [FIX] website_event_track: Properly sort tracks on website with P3
On Python 3, dict.keys() doesn't return a list, so we can't sort it, but
converting to a list on the fly before calling to sort() is not going to
change the original dict_keys object. Storing directly the list in the
variable, we get the expected result.

Side note: the daylist2 variable is there just for the t-set and was
already present in the code. Renaming it to dummy would be clearer
but that should not be done in stable.

Closes #25113.
2018-06-11 12:03:38 +02:00
Nicolas Martinelli e2ea066360 [FIX] point_of_sale: refresh when qty changed
- In the POS screen, select a product.
- Set the keyboard on "Price" mode
- Change the unit price
- Set the keyboard on "Qty" mode
- Change the qty

The product qty and the total price doesn't refresh until you go to the
payment screen.

We manually trigger a change when the quantity is updated.

opw-1855970
2018-06-11 11:01:18 +02:00
Odoo - OpenERP - Acysos S.L 2d12a361e3 [FIX] base: Navarre official name (#24851)
The official name is Navarra, not Nafarroa

Closes #24851
2018-06-11 10:57:00 +02:00
David 407f52e86c [FIX] website_mass_mailing: Use the correct model to unsubscribe
Purpose
=======

When a contact in a mailing list receives a mass_mailing with an
unsubscription link, then he is automatically unsubscribed once the
unsubscription link in clicked instead of opening the
unsubscription form.

Specification
=============

Now the user can decide wether to unsubscribe or not.

Closes #24969
2018-06-11 10:53:23 +02:00
Gustavo Valverde fc252fa6a1 [FIX] base: specify Dominican Republic formats
Dominican Republic had no formatting for the address, the code country code was
not being evaluated to '1' and the label was set to TIN or NIF, when it should
be RNC.

Address format wasn't regulated, and it's not explicit in the regulation, but
the invoice formats given by the regulators use this formatting
Source:
    http://dgii.gov.do/contribuyentes/personasFisicas/inicioOperaciones/ComprobantesFiscales/Paginas/FormatoDeFactura.aspx

Closes #24820
2018-06-11 10:48:57 +02:00
Nicolas Martinelli 0d35f569f4 [FIX] point_of_sale: prevent product unlink
- Create a product with variants which can be sold in the POS
- Open a POS session
- Delete a variant (e.g. change the attributes)
- Sell the product in the POS, validate

The POS order cannot be created because the product ID doesn't exist
anymore.

We extend the existing constain on `product.template` on
`product.product`.

opw-1850598
2018-06-11 10:39:18 +02:00
Nicolas Martinelli 61c9921596 [FIX] mrp_repair: return move with owner
- Create Product A with 5 Unit(s) on hand
- Created SO for 5 Units(s) A, validate SO and picking
- Return of the same quantity, but assign an owner
- Created RMA for 5 Units(s)

A warning generated: 'A is not available in sufficient quantity in ...'.

By assigning an owner on the return, the product is not considered
available. However, this makes sense since we are not owner of the
product, so it should not be valued.

Ideally, we would need a field `owner_id` on the RMA. Since it is not
available, we use `partner_id`. the logic is the following:
- try to reserve with owner_id = partner_id
- if the available qty is not sufficient, try without owner

When the stock moves are created, we apply the same logic to know
whether we need to create the move with an owner. Note that this is not
really sufficient. Ideally, we should reserve the quantity to repair
when we check if the quantity available is sufficient.

opw-1854346
2018-06-11 10:02:09 +02:00
Adrian Torres 9422b3272e [FIX] sale_timesheet: reset service_type on uninstall
`sale_timesheet` adds a value to the selection field `service_type`, if
any product.product or product.templates are set to this new
`service_type` and then the module `sale_timesheet` is uninstalled, the
`service_type` field won't be implicitly reset to the default, existing
value of `manual`, due to this, when accessing a view displaying
product.product records the view will crash and won't be accessible as
long as it contains an undefined selection value.

this commit explicitly resets the field to the base value upon
uninstallation.

opw-1856776
2018-06-11 09:48:20 +02:00
Adrian Torres b680dac375 [FIX] website: properly unlink res_config_settings recs
res_config_settings.website_id should be ondelete='cascade', however
that is not suitable for stable, so we emulate the ondelete cascade
with an SQL query during ir.model unlink (website uninstallation).

Fixes #25078
2018-06-11 09:45:20 +02:00
Nicolas Martinelli 1ce2536095 [FIX] point_of_sale: vat_label if no country
- Do not set a country on the company information
- Create a POS order, validate

A crash occurs because of an undefined value.

opw-1856267
2018-06-11 08:24:09 +02:00
Nicolas Martinelli e9b21c37f4 [FIX] payment_authorize: state code
According to Authorize.net documentation, the state code should only be
used for United States. For the other countries, use the state name
instead.

opw-1854278
2018-06-11 08:11:39 +02:00
Odoo Translation Bot 3adeb46cdd [I18N] Update translation terms from Transifex 2018-06-10 04:40:02 +02:00
Joren Van Onder e1a9546334 [FIX] event: print time on badge using the event timezone
Otherwise the time is printed using the timezone on the user printing
the badge. This fix is inspired by how the times are rendered by
website_event (e.g. website_event.index).

Using the date_{begin,end}_located fields was considered, but their
formatting is not configurable and they result in lines that don't fit
well on the badge.

opw-1853238
2018-06-08 15:00:37 -07:00
Lucas Perais (lpe) dded98a04c [FIX] mail: open a channel in discuss on systray click
User B mentions @UserA in a channel on discuss
User A gets two notifications: one for direct chat,the other for the channel
User A clicks on the notification for the channel

Before this commit the form view of the channel was opened

After this commit, the channel is opened in discuss

OPW 1849577
closes #25074
2018-06-08 10:06:11 +02:00
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