Commit Graph
117156 Commits
Author SHA1 Message Date
Toufik Benjaa 2b771757e2 [FIX] crm: Access rights issues in contact merging
- When merging partners with fields restricted to certain groups which the user doesn't belong, an access error is raised.
  To avoid this, we only merge fields that are accessible by the user. We do so by using the method fields_get() that only returns the fields accessible by the current user.
2018-05-14 17:04:46 +02:00
Denis Ledoux e48767fe65 [FIX] mass_mailing: force to not use a template for the rendering
If the user configures a default `template_id` for
the `mail.compose.message`,
this template was used by the mass mailing to render the email,
and, among others,
it therefore used the `email_to` of this email template,
to render the recipients,
and it was configured empty or something else than `object.id`,
it did not used the `active_ids` passed in the context to the
`mail.compose.message` `create` call to compute the correct
recipients

To reproduce:
 - In developer mode (?debug)
 - Open the full mail compose message
   e.g. in app sales, open a so, hit new message,
   and hit the button to open the full message composer
 - Set the template to the quotation template is not there already
 - In the debug menu of the dialog, View > Set defaults,
 - Click the radio button to all users, and the default to Use template = ...
 - Then, try to send a mass mailing. It will fail because it cannot
   compute the `email_to` values correctly because the `email_to`
   of the quotation template is empty.

opw-1840287
2018-05-14 16:48:20 +02:00
Christophe Simonis 2787de8c68 Revert "[FIX] web_editor: adapt test"
Was weirdly working in browser...

This reverts commit fb18de745c.
2018-05-14 15:55:53 +02:00
Christophe Simonis fb18de745c [FIX] web_editor: adapt test 2018-05-14 15:12:16 +02:00
Christophe Simonis b44c34865b [FIX] web_editor: correct js code.
Oversight of previous forward-port
2018-05-14 15:10:09 +02:00
Goffin Simon 1265839a07 [FIX] sale: Down payment in multi company
When creating a product "down payment" in multi company in function "create_invoices"
of the model "sale.advance.payment.inv", a default company was set on this product
and it could lead to access rights error when trying to invoice a SO from an other
company.

NB: The down payment product must be shared with all the companies, as this is
the only one that you can set in the ir.config_parameter.

opw:1841468
2018-05-14 14:44:31 +02:00
Christophe Simonis bd2de7ae78 [MERGE] forward port branch saas-15 up to d818b516c1 2018-05-14 14:37:08 +02:00
Nicolas Martinelli f88a05d18e [FIX] website_sale: do not copy last SO
- Create u1 as a portal user
- Connect as u1, add products to the cart
- Duplicate u1 (e.g. u2)
- Connect as u2

u2 retrieves the cart of u1.

opw-1847328
2018-05-14 13:35:49 +02:00
Denis Ledoux 5603b778f6 [FIX] point_of_sale: automatic selection of customer pricelist
When changing the customer to a customer with a different pricelist
than the pos default, the customer pricelist was not automatically selected.

This is because of an oversight in the below revision:
f76cc095b8

opw-1843709
fixes #24611
2018-05-14 12:45:52 +02:00
Christophe Simonis d818b516c1 [MERGE] forward port branch saas-14 up to 5274a62037 2018-05-14 12:28:37 +02:00
Raphael Collet 7f27992998 [FIX] fields: convert selection value to int
When a string value is assigned to a selection field expecting integers, the
value simply rejected.  In such a case, convert the value to an integer before
validating it.
2018-05-14 12:08:59 +02:00
len-odoo 8adb11a529 [FIX] calendar: fix recurring events rrule definition
Some versions of the datutil library crash when a 'Z' (specifying 'Zulu' time)
is appended at the end of an rrule.
This is because they decided to be stricter when comparing timezone aware/naive
datetimes with rrules.
This bug appears when trying to create a recurring event on the calendar,
defined with an "until" (a certain date) rule.
We explicitly add the timezone information if the 'Z' is in the rrule.

We also remove the rrule ffield from the view, since it is not used and could
only interfere with the logic of the rrule creation.

related to commit 35a4263f0a

opw 1841761
2018-05-14 12:08:28 +02:00
Christophe Simonis 5274a62037 [MERGE] forward port branch 10.0 up to 7b1362ac55 2018-05-14 11:51:18 +02:00
Nicolas Martinelli 3579bd53be [FIX] hr_expense: account on expense
- Set a specific expense account on an expense product
- Send an email to the expense alias

The specific expense account is not used; a default account is used
instead.

opw-1838174
2018-05-14 11:37:32 +02:00
Christophe Simonis 7b1362ac55 [MERGE] forward port branch 9.0 up to 1dae7ea1d6 2018-05-14 11:29:57 +02:00
Nicolas Lempereur 5bb7ffa20e [FIX] web_editor: ignore range error on Restricted
In firefox, if we have a range on eg.:

  `<input type="file">`

and we tabulate to get to it, we have the range over:

  `<button type="button" tabindex="0">Browse…</button>`

which seems to be a "virtual" element inside the `<input/>` but this
magic element is "Restricted" and causes error such as:

  `Permission denied to access property "nodeName"`

So this fix ignore errors when getting a range from current selection on
keyup.

opw-1819279
closes #24524
2018-05-14 11:16:20 +02:00
Lucas Perais (lpe) 3416d4a798 [FIX] point_of_sale: user on invoice same as on order
Open a pos session with a user A
Change cashier to user B

Make an order with invoice

Before this commit, the salesman of the order was user B
but the salesman on the invoice was A

After this commit, both invoice and order have user B as salesman

OPW 1844175
closes #24642
2018-05-14 09:27:09 +02:00
Lucas Perais (lpe) 3a09c06f8c [FIX] point_of_sale: sale details report should display the internal ref of products
It seems that in v8 the internal reference (the code) of the product
was displayed in the sales details report of the pos

This commit put that field back on the report

OPW 1844776
closes #24641
2018-05-14 09:23:11 +02:00
Odoo Translation Bot 2cd730998b [I18N] Update translation terms from Transifex 2018-05-13 04:12:31 +02:00
Odoo Translation Bot bc54fc47bd [I18N] Update translation terms from Transifex 2018-05-13 00:25:38 +02:00
Nicolas Martinelli af41ab8010 [FIX] payment_adyen: bytes/str comparison
When returning from the Adyen payment website, SHA signature check fails
because of an inconsistent bytes vs string comparison. This is due to
`base64.b64encode` returning bytes in P3.

opw-1841103
2018-05-11 13:41:22 +02:00
Nicolas Martinelli 3c61cd0992 [FIX] sale_timesheet: set company currency
Make sure the compoany currency is USD, otherwise the tests fail.

opw-1841170
2018-05-11 13:34:46 +02:00
Nicolas Martinelli ed9dbffe07 [FIX] sale: All Channels Sales Orders
The 'All Channels Sales Orders' report should filter out canceled
orders.

opw-1839938
2018-05-11 13:32:48 +02:00
Nicolas Martinelli c9bdda2c68 [FIX] account: display negative value in portal
The residual amount of a customer invoice or a credit note is displayed
in the same way in the portal view. This can be confusing for the end
user since there is no way to distinguish both.

We display the residual amount as negative in case of a credit note.

opw-1841432
2018-05-11 13:30:04 +02:00
Nicolas Martinelli 9a450ac162 [FIX] account_payment: prevent payment of credit note
A credit note is not supposed to be paid by the customer, so do not
display the payment button in the portal view.

opw-1841432
2018-05-11 13:30:04 +02:00
Yoshi Tashiro c6df2fb1d7 [FIX] sale: Remove outdated comments
The comment "Note that once a Quotation becomes a Sales Order, it will be moved from
the Quotations list to the Sales Order list" isoutdated since 10.0 - sales
orders are also visible in the quotation list.
2018-05-11 12:02:28 +02:00
Nicolas Lempereur 1dae7ea1d6 [FIX] web_editor: inline space in source code
Backport of 57f7c68106
2018-05-11 11:06:05 +02:00
len-odoo 6c6c4b89a0 [FIX] mail: parse eml/msg attachments
When parsing an email with some eml or dmg attachment, the parsing would
generate an attachment with empty content.
Since this content is later encoded in base64, it would crash trying to encode
None.
We simply do not process attachments without content.

We add a test to check that parsing mail with some empty attachment doesn't
crash, since the crash implies that the mail gets stuck on server
and is never fully processed by Odoo.

opw 1814014
2018-05-09 16:49:34 +02:00
Goffin Simon dff1e96ed3 [FIX] purchase: Wrong property fields in multicompany
Steps to reproduce the bug:
- Enable multi companies and multi-currencies
- Multi company: Your Company and Test
- Users: Admin and Demo
- Login as admin user with the current company: Your Company
    - Allowed companies: Your Company, Test
- Login as Demo user with the current company: Test
    - Allowed companies: Test
- From the admin user with the current company: Test, do the following configuration in the product,
   - product: iPad mini, select vendor: Delta PC with price $100 with company: test, currency: USD
- Change the admin's company from Test to Your Company, do the following configuration in the vendor,
   - vendor: Delta PC, set supplier currency: EUR and payment terms: 30 Daya Net Payment
- Log in with the demo user
- Create SO for that product by selecting routes: Make to order and Confirm it.
- Open the PO which is generated from this SO

Bug:

The Currency and payment terms were set with the data set for Your Company

Excpected behavior:

Nothing is set for supplier currency and Payment terms as nothing is set for the company: Test

Closes #24564
opw:1841379
2018-05-09 16:21:23 +02:00
Goffin Simon 475027b988 [FIX] point_of_sale: Set the correct cashier
After reopening the session in the POS by another user,
the cashier was not correctly identified.

Back-port of this commit: a9caef0ebb

opw:784422
2018-05-09 16:06:51 +02:00
Josse Colpaert 0ca60a8d01 [FIX] delivery: delivery with carrier but not linked to so
When a delivery with free_over=True was not linked to a SO, it raised
an error.

opw:1843829
2018-05-09 15:39:34 +02:00
Christophe Simonis 4431c8c843 [FIX] website: GeoIP Legacy compatibility
Some IPs (like google-proxy ones) are not bound to a specific country.
Legacy Database used to set country_code to 'EU' for these one. geoip2,
on contrary, does not set the country. Read information from `continent`
attribute in this case.

opw-1844888
2018-05-09 11:40:56 +02:00
Nicolas Martinelli b793e23ae5 [FIX] stock: incorrect PO sequence
- Create 2 companies A & B
- Create a sequence for PO in each company
- Set User A in Company A and Admin in Company B
- Create a MTO product with a 'Buy' route
- Create a SO with User A using the product, validate

The PO created uses the sequence for Company B instead of Company A.

The creation is done as `sudo`, and ultimately `next_by_code` will use
the company of the Admin.

opw-1839656
2018-05-09 11:25:39 +02:00
Romain Derie 665fcb62cf [FIX] website: always show menu if its a container with visible menus
Before this commit:
1. If a menu was used as a container (dropdown) and had an unpublished page_id
   (website.page), we would never show that menu (and so its submenus) even if
   it has visible submenu.
   Some users are stuck with this since they:
   a) create a new page 'A' (unpublished by default) included in menu.
   b) create a new page 'B' (unpublished by default) included in menu.
   c) set 'B' as a submenu of 'A' in the menu manager
   d) decide to publish the website.page linked to menu 'B'
   Then, since menu 'A' is linked to an unpublished page, the menu 'A' and 'B'
   are never visible.
2. If a menu is being created with an URL that match a website.page URL, the
   m2o relation will automatically be set (website.menu.page_id).
   Still, if the user type the URL without the leading slash, the m2o won't be
   set.
   This could be misleading since on the page property in the page manager the
   URL is being shown without the leading slash even if it is stored in DB.

Now:
1. We always show menu container if they contains visible submenu, even if the
   container menu is linked to an unpublished page
2. The page URL search is more clever and will match URL even if the only
   difference is the leading slash.

This closes #24635
2018-05-09 11:02:16 +02:00
xmo-odoo 020906659e [FIX] orm: "relate" binding type on actions
When ir.values was removed and the "action" ir.values were merged
directly into the actions themselves, "client_action_relate" was
discarded as unused (and possibly too similar to
client_action_multi?). *However*:

* it was actually used implicitly as "relate" was the default key2 of
  the <act_window> XML tag
* and it had a crucial difference from client_action_multi:
  client_action_multi is shown on both form and list views by default
  and only on list if multi=True, whereas relate is shown on *either*
  the form or list view (tree if multi else form)

This means without relate the actions which should be only visible on
the form view are now on both list and tree, which leads to
overpopulated `Action` menus and odd behaviours (e.g. actions relying
active_id on lists, which id do they get and why?)

=> reintroduce relate as "action_form_only" for the specific case of
multi=False and either no key2 or a key2 of client_action_relate. If
multi=True then binding_type=action.

Fixes #20124

Followup: Task 1843603 to remove #multi and redundancy
2018-05-09 09:45:29 +02:00
Christophe Simonis f2e105eeca [MERGE] forward port branch saas-15 up to d3a040cebe 2018-05-08 18:12:03 +02:00
Christophe Simonis d3a040cebe [MERGE] forward port branch saas-14 up to 1813f42dbc 2018-05-08 17:18:48 +02:00
Goffin Simon 652e336deb [FIX] base_vat_autocomplete: address format of swedish company
Swedish Postal Codes are 5-digit codes with the following format: XXX XX

Before the fix:

With VAT=SE556242088401

For [zip_code] [city] = [171 42] [SOLNA]

we got [zip_code] [city] = [171] [42 SOLNA] because 'zip_code' didn't allow whitespaces

opw:1841010
2018-05-08 17:15:36 +02:00
Nicolas Lempereur d595e3a258 [FIX] tools: mail transcoding css space consistent
The transcoding of a mail (transforming CSS into inline styles on the
element nodes of the mail) used the form:

 property:value;

So when a mail is saved, it would be eg. with `style="property:value;"`
and when it is being edited "property:value" is removed if available via
CSS stylesheet given the structure.

But the sanitize_style (introduced in bfe7aafa7) adds an espace before
the value (which is more pretty but was probably not choosen in
transcoding to decrease size of mail):

 property: value;

so the inline style would not be removed when editing possibly causing
conflict with the editor.

With this commit, the sanitize_style doesn't add a space. It could have
been changed in transcoding but the code is already rather slow and we
don't want to use a regex replace or two string replace instead of the
current one string replace.

opw-1841107
2018-05-08 16:46:23 +02:00
Nicolas Lempereur b739e65940 [FIX] web_editor: optimize big mail transcoding
The browser may throw an error when a big mail such as one with
hundreds thousands of tags is being transformed to have a style
more compatible with mail clients.

The error would be:
 "Uncaught RangeError: Maximum call stack size exceeded"

This happens in jquery because we hare too many nodes (there is an
ongoing issue at https://github.com./jquery/sizzle/issues/403) so this
commit replace that part by a DFS traversal over DOM nodes.

There was also an issue that not having the option "style-inline" would
still cause some style code to be ran albeit it was intended not to be
solved in 55c7d2d5b0.

opw-1841107
closes #24550
2018-05-09 12:35:40 +02:00
Christophe Simonis 1813f42dbc [MERGE] forward port branch 10.0 up to 14f59f4b78 2018-05-08 16:23:54 +02:00
Martin Trigaux 96c7390a37 [FIX] _crm: remove outdated es_CR translations
It was containing a bad translation "Inicaitiva / Oportunbidad" while the
correct one "Iniciativa / Oportunidad" was already done in Spanish.

Remove files to avoid getting the wrong translations.

Regional translations can be used for different terms, avoid to use the same
to make it easier to maintain.

Fixes #24613
2018-05-08 14:59:43 +02:00
Christophe Simonis 14f59f4b78 [MERGE] forward port branch 9.0 up to 468e2e454e 2018-05-08 14:51:36 +02:00
Mohammed Shekha 2bd92cc581 [FIX] web: use correct href in link for m2o
With a better href, many2one in readonly mode  can be opened in new tab.

Related to task: #32919
2018-05-08 14:46:17 +02:00
Nicolas Lempereur e9454e79e2 [FIX] website_event: typo tickets not disappear
Since 809aaf9e, when clicking on "Register Now" on a ticket registering
page, the ticket list disappeared because of a typo.

opw-1841488
closes #24607
2018-05-08 13:53:29 +02:00
Priyanka Kakadiya 7f632f909e [FIX] website_forum : fix karma alert-box position
Currently, if user does not have enough karma to perform specific action on
forum, alert-box with appropriate message is displayed to the user.

There are several issues with these alert-boxes, like :
- Click on same CTA multiple times, creates multiple alerts
- Click on another CTAs keeps previous alerts on the screen, and adds
  further alerts, which sometimes overlaps adjacent CTA and looks ugly.

After this commit :
- Alerts are displayed below their related CTAs
- Only one alert appears at a time on the screen

Fixes : #23071
PR    : #23800
Task# : 1829835

This commit closes #23071
This commit closes #23800
2018-05-08 12:38:13 +02:00
Arnold Moyaux 4591b9a49a [FIX] delivery: test robust to installed localization
related to 9e5c1f68a5

opw-1841170
2018-05-08 12:02:34 +02:00
jem-odoo 1591d3e19e [FIX] sale_timesheet: SO line of subtask
When creating a subtask (or a task), parent_id is passed in the create values.
Howver, when the task is not a subtask, we might want to set the SO line directly
and not erasing it with the one from the inexisting parent. So the values of
parent_id is required to force the so line value when creating a task.

Closes #24592
Closes #22707
2018-05-08 11:18:03 +02:00
jem-odoo aee95705d2 [FIX] sale: normalize domain is smart
When manipulating domain, this is always better to
normalize them, otherwise we can have strange behavior
when handleing them with `expression.OR` and
`expression.AND`.

For instance:
domain = [('so_line', 'in', [91]), ('amount', '<=', 0.0)]
timesheet_domain = ['&', ('so_line', 'in', []), ('project_id', '!=', False)]

`expresion.OR(domain, timesheet_domain)` will give
['|', ('so_line', 'in', [91]), ('amount', '<=', 0.0), '&', ('so_line', 'in', []),
('project_id', '!=', False)]

And this is not what we attempt.

Closes #24038
2018-05-08 11:17:54 +02:00
Nicolas Martinelli a0f8a06079 [FIX] website_sale: fallback on payment term
If `account.account_payment_term_immediate` doesn't exist, the `.id`
will crash.

opw-1841141
2018-05-08 09:27:38 +02:00