Commit Graph
117975 Commits
Author SHA1 Message Date
Goffin Simon 0bde7aa106 [FIX] sale_timesheet: AccessError on sale.order.line in multi-company
When the type of a product is changed by a user of company A, if this
product has been sold previously by company B, the user receives an
access error.

opw:1824548
2018-03-08 15:46:20 +01:00
Christophe Matthieu 070f1173da [FIX] odoo: onchange load the related field data
Configurations uses an onchange to populate the fields visible to the
user. However, the related fields are by default called sudo, when it is
an onchange, there may be a missmatch in the cache, the cache used being
empty, there is no value to return (cache fix is not currently possible).

Before this fix we must use 'related_sudo=False' to use the good cache but
it's an inconsistent fix because in some case we must use sudo to avoid
access error.

opw-1823363
2018-03-08 15:36:22 +01:00
Simon Lejeune 527b22b511 [FIX] stock: "Picking Moves" on quant
When looking for the move line associated to a quant, make sur to return
the move lines that took from the package or that put something in the
package.

opw-1824578
2018-03-08 15:27:46 +01:00
Nicolas Martinelli 303f547690 [FIX] point_of_sale: round unit_price
- Set the product price decimals to 5
- Create a product costing 0.32
- Create a pricelist with 20 % discount when quantity is > 100
- Set a default fiscal position on the POS
- Lauch a POS session
- Add 500 units of the product

The unit price is rounded to 0.26, while it should be 0.256.

This is due to the call to `compute_all`, which will round to the
currency precision.

opw-1816997
2018-03-08 15:24:05 +01:00
qdp-odoo 8b2c25f575 [FIX] account: payment lines of invoices selection
The payment lines shown in the payment widget on invoices, should only list reconciliation made towards the lines sharing the same account as the invoice/bill. Previously, if a tax or an invoice line was using another account set reconciliable, any payment made against this account would be shown in the payment widget, which is wrong.

OPW: 1805968
2018-03-08 15:16:19 +01:00
Martin Trigaux 1274758033 [FIX] gamificiation: partial backport of 56645335
Was making subject `mail.message()`

Closes #9557
2018-03-08 14:59:50 +01:00
Christophe Simonis 8f118ad533 [FIX] purchase,stock_dropshipping: correct test
Oversight of previous forward-port
2018-03-08 14:37:13 +01:00
true-datura 67f67b5124 [FIX] web: 'image_small' field not displayed for non-latin translations
Before this commit, images in kanban view of the Contact app were not displayed
on non-latin languages, such as Russian.

This was caused by the is_bin_size helper that wrongly assumes that a certain
string is not a binary size, although it is (e.g. 64.2 Кб).

This commit fixes the issue by including such strings as valid binary sizes.

Bug found and fixed by @true-datura
Test by @alexkuhn

closes #23526
closes #22519
2018-03-08 14:29:36 +01:00
true-datura 6faf7784e6 Add CLA signature 2018-03-08 14:29:29 +01:00
Martin Trigaux 205fd6afe2 [FIX] sale: translate Uncategorized layout 2018-03-08 14:19:54 +01:00
Christophe Simonis 7d66953d17 [MERGE] forward port branch 11.0 up to bfe88c50e2 2018-03-08 14:06:54 +01:00
Denis Ledoux b98233aacc [FIX] stock_landed_costs: gap in landed costs sequences
On creation of a new landed cost,
in the web client,
the name was filled with the next sequence
`self.env['ir.sequence'].next_by_code('stock.landed.cost')`

but then, as the field is readonly,
it is not sent in the create values to the server,
and therefore the server sets again the default value
and generates a new sequence name.
The previous assigned sequence name is therefore never assigned,
and there was an obvious gap in the landed costs sequences.

Besides, using a sequence as a default is never a good
idea, as the record can be discarded, and this will not discard
the sequence number that has been used. There will be again
a gap in the sequence.

See this forum topic for reference:
https://www.odoo.com/forum/help-1/question/how-to-handle-reading-and-writing-to-read-only-fields-2247#answer_2281

I therefore remove the default value,
and use the exact same behavior than on the sale order,
which is pretty similar:
 - The default value is set to `New`
 - Then, on creation, it is replaced to the actual sequence number.

https://github.com/odoo/odoo/blob/bfe88c50e2b4975a23c624cc5b5171158bb9f855/addons/sale/models/sale.py#L273-L279

opw-1823133

Note: This can be back-ported to Odoo 9.0,
but the fix will be different since the module has
been converted to the new API since then.
If I did it in 9.0 in the first place,
mostlikely it would not have been forward ported correctly.
2018-03-08 13:48:17 +01:00
Martin Trigaux 4fc0947850 [FIX] tools: do not escape \t
msgid ""
"You cannot set a negative product quantity in an inventory line:\n"
"\t%s - qty: %s"

Was creating a ir.translation record with a src as

You cannot set a negative product quantity in an inventory line:
t%s - qty: %s

('t' instead of \t)

Closes #23541
Fixes #23521
2018-03-08 13:47:12 +01:00
Nicolas Lempereur bd4f09fa72 [FIX] portal: no note in frontend chatter w/ token
When a chatter is displayed and the document is accessed with a valid
access_token, the message related to the document are searched in sudo.

This bypass valid filtering we may down the line.

This change apply the filtering so note type messages are not displayed
for user who are not employees.

note: before 11.0 this logic was in 1b5c2ced. In future version it would
      probably be better to have a method eg. _get_domain_based_on_user
      that would be called before sudo and if not sudo.

opw-1819702
closes #23544
2018-03-08 13:41:08 +01:00
Christophe Simonis bfe88c50e2 [MERGE] forward port branch saas-15 up to 0ae300e9e6 2018-03-08 13:22:28 +01:00
Thibault Delavallée 7ca93cd916 [FIX] test_mail: make some tests independent from other module demo data
There is a test checking message access rights and search results. It
searches for messages created in the test class having a subject like
Test. However this search may return more results than expected. For
example project create messages containing Test. As we want to keep tests
independent let us rename the test data to ensure everything works as
intended.
2018-03-08 13:20:42 +01:00
Christophe Simonis fc2fc62ffd [MERGE] forward port branch 9.0 up to b5da9d65ae 2018-03-08 12:57:19 +01:00
Christophe Simonis 0ae300e9e6 [MERGE] forward port branch saas-14 up to 85fd5cc147 2018-03-08 12:45:29 +01:00
Aaron Bohy 7fac801075 [FIX] web: mobile: display searchview toggler
There was an issue with the control panel in mobile since rev.
7b6056a. In the enterprise webclient, by default, the search view
is hidden, and a search icon should be displayed on the top right
corner of the control panel so that the user can toggle the
searchview.

Before this rev., the icon was invisible at the first rendering of
a view, and only appeared once the view was reloaded.

The change in rev. 7b6056a that produced the issue is that the
control panel is now updated twice when a view is rendered (once
by the view itself with the buttons, searchview..., and once by
the ActionManager with the breadcrumbs). The control panel didn't
handle correctly that scenario.

A test case will been added in web_enterprise.
2018-03-08 12:41:59 +01:00
Christophe Simonis b5da9d65ae [MERGE] forward port branch saas-6 up to f48b754cef 2018-03-08 12:40:38 +01:00
Aaron Bohy 3809fc891f [FIX] web,mail: always reload widget mail_activity
Before this rev., the field widget 'mail_activity' kept an internal
cache of fetched activities (like the 'mail_thread' and
'mail_followers'). However, for activities, this cache may cause
issues.

For instance, create a new lead in 'My pipeline', schedule a
'Meeting' activity on that lead (it opens the Calendar view so
that real meetings can be created), create a meeting 2 weeks from
now, go back to the lead form view: the activity still diplays that
the meeting is today (when the view is refreshed, the correct date
is displayed).

This rev. removes the internal cache for this field widget, as the
activities can easily be updated in business flows (unlike messages
or followers).

This rev. also fixes a bug in the BasicModel, where the res_ids of
a list datapoint was altered in place to return a list of x2many
commands instead of the list of ids when being stringified. This
caused a traceback when opening a lead with activities, as soon
as the internal cache had been removed.
2018-03-08 12:39:21 +01:00
Denis Ledoux f48b754cef [FIX] membership: missing triggers to recompute membership dates
When a membership line has its dates changed
(date_from, date_to, date_cancel)

The membership start/stop dates on the member
(res.partner) were not changed accordigly.

opw-1823981
2018-03-08 12:34:33 +01:00
Christophe Simonis 85fd5cc147 [MERGE] forward port branch 10.0 up to 41af298d9d 2018-03-08 11:37:10 +01:00
Christophe Simonis 41af298d9d [FIX] hr_payroll: use defined variable
Oversight of previous forward-port
2018-03-08 11:11:44 +01:00
Christophe Simonis d7f4454694 [MERGE] forward port branch 9.0 up to 2f46f3bdb2 2018-03-08 10:50:20 +01:00
Goffin Simon 622399c796 [FIX] purchase: Changing the price of a confirmed PO before the receipt
Steps to reproduce the bug:
- Set your company in anglo-saxon
- Create a product P in a category which is in real price and perpetual
- Create a PO with P at 500$ and validate it
- Change the unit price of P in the PO line and set 100$
- Receive the product
Bug:
The two journal entries generated for the goods were created with the price unit
500$ instead of 100$.
Fix:
Now the right price is taken into account to generate the journal entries.

opw:1813946
2018-03-08 10:42:53 +01:00
Christophe Simonis 5fa4cc0d34 [FIX] stock_dropshipping: run accounting tests after install 2018-03-08 10:41:52 +01:00
Jeremy Kersten b4f8ca0a34 [FIX] base: fix dev mode for inherits view
Before this commit, model that create ir_ui_view via _inheritS was ignored in --dev xml
The arch_fs was not set. Because it was not ir.ui.view, and because xml_id was suffixed by _ir_ui_view.

Now we manage the case of inherits. So if model model.name inherits ir_ui_view

class MyClass(models.Model):
    _name = 'model.name'
    _inherits = {'ir.ui.view': 'view_id'}

    view_id = fields.Many2one('ir.ui.view', string='View', required=True, ondelete="cascade")
    ...

<record name='model.name' xmlid='pok'>
    <field name='arch' type='xml'>content</field>
</record>

will be read from xml in dev mode.

parsing the xml file for xml_id pok_ir_ui_view and pok.
The orm by default will add this suffix.

The 'dynamic' view created when we update the groups is a special case, which we don't want the arch_fs
for dev mode because the xml only contains by default and an empty container and btw the imd was wrong
since we had the res.group model a xml_id into the _inverse_arch.

The page create via a template (method new_page) will automatically remove the arch_fs since we don't
want to see the empty container if we are in dev_mode.
2018-03-08 10:22:21 +01:00
Goffin Simon 9f226528bd [FIX] stock_account: Force accounting date on validated inventory adjustment
When the inventory adjustement has been validated, changing accounting_date has no
impact on the stock moves created by the inventory adjustement.
This behavior cannot be changed in stable version.

opw:1817813
2018-03-08 10:17:52 +01:00
Alexandre Kühn 60bbce2e53 [FIX] mail: nocontent helper discuss (inbox & starred)
Revision on https://github.com/odoo/odoo/commit/a87d761fdbf345ada5dc93e0a686b08a0f5a0417

From the UX/UI changes above, we also changed the style for empty
inbox and starred in Discuss.

There are two issues with the empty boxes message:

    1. The text is not centered at all (one word per line,
       and everything is stuck on the left-side of the screen)
    2. The style is inconsistent with nocontent message on search

In this commit, inbox and starred use the same style as the no_content
message from a search. The style of the nocontent from a search has been
slightly changed to mimick the intended style for inbox and starred:

    - centered text
    - title is in bold 125% font size
    - other text is not in bold, 115% font size.
2018-03-08 09:30:37 +01:00
Nicolas Martinelli 1048fc6ed5 [FIX] purchase, stock_dropshipping: fix tests
Astonishingly, some people really need a green runbot to work.
2018-03-08 09:22:59 +01:00
len-odoo 9fdbbb816c [FIX] website_sale: display prices using public user pricelist on the shop
When a pricelist was set on the public user that was different from that of the
website, the prices were displayed using the public user default currency,
but the currency symbol displayed was the website default currency.
The issue was that in the template, the currency was accessed as a computed,
related field of website while the price was obtained using a function call.
In the first case the field was obtained using sudo, and thus the call would not
get the public user pricelist.

opw-1817761
2018-03-08 08:58:30 +01:00
Christophe Simonis 9db108c106 [FIX] delivery: remove extra unsourced file 2018-03-07 18:49:05 +01:00
Christophe Simonis 4aa5ec3fa5 [MERGE] forward port branch 11.0 up to d67b410dfc 2018-03-07 18:46:38 +01:00
Nicolas Martinelli d594fece4a [FIX] point_of_sale: return product
When a user returns a tracked product in the POS, it is not possible to
register the serial number. In case a customer returns 2 units of a
tracked product, the following error occurs:
'Cannot set the done quantity from this stock move...'

Since the serial number were not set, `qty_done` remains equal to zero
and `pack_lots` is empty. Therefore, we are trying to set a zero value,
which is actually useless.

opw-1817695
2018-03-07 18:18:57 +01:00
Christophe Simonis d67b410dfc [MERGE] forward port branch saas-15 up to cb87388d72 2018-03-07 17:42:02 +01:00
Denis Ledoux 2f46f3bdb2 [FIX] hr_payroll: generate payslips sets the employee company
In a multi-company environment,
if a user in company A
created a Payslips batch for an employee in the company B
and used the `generate payslips` button,
the created payslip was set with the user company (A) while
it must be the employee company (B).

opw-1820138
2018-03-07 16:16:52 +01:00
Denis Ledoux 43f0cbcc86 [FIX] hr_holidays: employee onchange when no employee set
When changing the employee to None in an allocation,
this onchange raised an error because it attempted
to set an employee browser record (empty but still)
in a department many2one.

- Create a new leave allocation
- Try to change the field Mode (holiday_type) from "By Employee" to "By Employee Tag"

Fixes #23345
opw-1820069
2018-03-07 15:52:16 +01:00
Alexandre Kühn 3c821d4035 [FIX] mail: no traceback with attach/detach (discuss mobile)
Revision on https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498

From the refactoring above, some snake_case attributes have been
converted into camelCase. That was the case in discuss.js, but
we missed to propagate the changes in discuss_mobile.js.

This commit fixes the traceback that came from the mistake above.
2018-03-07 15:11:01 +01:00
qsm-odoo b7b8634575 [FIX] web: statusbar buttons design when no statusbar status
When there were no status widget in the form view statusbar, the left
buttons appeared without any vertical space around them in a smaller
statusbar.

There also was a 1px mistake that made the buttons appear non-centered.
Now they appear centered in any case and a row of buttons is always
forcing the correct statusbar height.

Closes https://github.com/odoo/odoo/pull/22053
opw-(1)813479
2018-03-07 15:05:17 +01:00
Arnold Moyaux 98547bf0cd [FIX] barcodes: Do not trigger useless onchange server side.
This commit improve perf by not trigger onchange server
side on one2many field if the js could find a candidate.

opw-785425
2018-03-07 14:55:31 +01:00
Nicolas Martinelli cf3ed5e547 [FIX] l10n_be_hr_payroll_fleet: max cars
The field `max_unused_cars` is impossible to read in the configuration
view.

Closes #23412
opw-1819898
2018-03-07 14:50:02 +01:00
Christophe Simonis cb87388d72 [MERGE] forward port branch saas-14 up to b16129d108 2018-03-07 14:28:05 +01:00
Christophe Simonis b16129d108 [MERGE] forward port branch 10.0 up to 69c7d696d8 2018-03-07 14:27:15 +01:00
Romain Derie 1c01528375 [FIX] hr_expense: ensure message_new has only one record (singleton)
Before this commit:
Expense emails title are parsed to find a product that match the given [CODE].
For example, an email title like '[CARD] Graphic Card $900' will create an
expense for the product having 'CARD' as internal reference.
Since the search is done with an 'ilike' and with no 'limit', it could return
multiple product: all the one containing the CODE in their internal reference.
This would throw a singleton error when trying afterward to read product.id.
Then, the mail would not go through the mail.thread flow and it would return
a Mail System Delivery fail saying the address does not exist.
Users would get stuck with this, having no way to understand where the error
comes from.

Now, we ensure to find only 1 product.
To avoid breaking the ilike behavior that could be used by users only typing
the first caracters of a long CODE, we still use ilike but force exact match if
there is multiple results.

Closes #23419
opw-1816340
2018-03-07 14:25:16 +01:00
Pierre Masereel a2d554c0a5 [FIX] stock: fix various bug in picking views
The following bugs in detailed operations have been fixed in this
commit:
- Avoid to edit reserved quantity on move lines. When a picking is set
  in 'UNLOCK' mode you are able to edit the reserved quantity of move
  lines, even if it doesn't really causes problems it create confusion
  on what is the reserved quantity.
- Avoid to edit the product_id on a move if there is a move lines linked
  to it. This will cause inceonsistencies by having move lines with
  product_id different than the related moves.
- Avoid to edit the product_id on a move line if it has a linked move for
  the same reasons as above. We also avoid the edition when picking is
  done to avoid issues with the stock valuation
- Remove call to 'force_assign' method on demo data as this method is
  not used anymore and set some pickings in wierd states
- Adding a move line in the detailed operation view does not create an
  associated move.
- Don't allow editing moves when we are in detailed views and state is
  done, even if picking is unlocked.

TASK-1817931
2018-03-07 13:59:28 +01:00
Arnold Moyaux f95566f08a [FIX] barcode: set quantity with key press
Allow the user to set the quantity with barcode
scanning. This functionality was present in v9 but
didn't work in v11.

The code in order to make it work was already present in
_quantityListener however it makes a check on setQuantityWithKeypress
key on the obejct activeBarcode. Howver the key was never set during the
activeBarcode event.

This commit set the key on the activeBarcode if passed in the event data.
It also allow to trigger a barcode if the user is inside a modal.
2018-03-07 13:20:52 +01:00
Arnold Moyaux 93ae1b1a04 [REF] stock, purchase: scheduler move exception
This functionality comes from v10. In v10 you had an object procurement that could be with a state exception. For example you had a product with routes MTO and buy but no vendor(supplierinfo). In 10.0 it would create all the move except the receipt from supllier and since it can't find a supplier it would pass the procurement in state exception. The scheduler each day checked all the procurements in exception and try to run them again until it can process them(in our case if a user finally set a vendor on the product).

In v11 we removed the procurement and an error is directly raised if the moves's chain couldn't be totally created if the action comes from a user. A next activity is created with the error if the action comes from the scheduler(a reordering for example). No move at all are created if the MTO/RR moves's chain couldn't be completed.

Thus the scheduler should now only be responsible to create moves from RR and to log next activity on product with missing information in order to help the user to correct it. Once the error is corrected, the user can run the scheduler manually or wait the cron responsible for it, it should then create the complete move's chain. the scheduler is not responsible anymore to create picking in broken move's chain since it should not be possible to create them automatically. Also creates picking/RFQ/MO automatically goes against the will of the user since he cancelled the first manually.

In order to help him to remember that he cancelled some documents next activities has been implemented with this purpose.
2018-03-07 13:12:33 +01:00
Adrian Torres 69c7d696d8 [FIX] base: whoopsie
Autovacuum wouldn't be executed at all!! `cr` is not defined.

Fixes commit 8b119e2
2018-03-07 11:44:36 +01:00
Stefan Rijnhart (Opener) 1cc21d7eb6 [FIX] account: use correct model in report definition
`account.report.journal` and `account.report_partnerledger` aren't valid models
2018-03-07 11:29:04 +01:00