Commit Graph
114985 Commits
Author SHA1 Message Date
Adrian Torres 8e7aaf8c82 [FIX] sale_management/account_invoicing: properly reinstall
Commit 985c224 introduced a way to properly uninstall these two modules,
however if a user were to reinstall them the views would stay inactive,
in the case of sale_management this would mean some menus were missing,
in the case of account_invoicing this meant that not even the top-level
menu would not appear, effectively misleading users into thinking the
module was not installed.

The solution is to create a post_init_hook (to ensure that all
potentially missing menus are already installed) that activates the
previously deactivated menus.

Fixes #23245
2018-02-22 09:55:59 +01:00
Romain Derie 97cae87812 [FIX] portal: use user timezone to display hours on portal chatter
Before this commit:
User timezone would be taken into account when displaying message date on
chatter. It would always display the hour in the server format (UTC).

Now, we correctly use the user timezone to format the date being sent by the
server.

This closes #22812
2018-02-22 08:55:37 +01:00
Joren Van Onder 3ae382f8df [FIX] point_of_sale: do not recompute manually set prices
The POS recomputes order lines when the pricelist changes. This is
different from the sale app on purpose: in a usual POS flow the customer
and thus pricelist is selected after taking the order.

But users commonly use a 'Miscellaneous' product when they are selling
something that is not in their POS system. The user can select this
product and manually set the price. When now a customer is
selected (even if the pricelist has not changed) these miscellaneous
order lines get recomputed. So now the cashier is forced to input
these prices again.

To avoid this we keep track of lines that have had their price changed
through the UI and we don't update them.

opw-817353
2018-02-21 16:12:40 -08:00
Christophe Simonis dbb713c2f8 [MERGE] forward port branch saas-16 up to 49f8548557 2018-02-21 19:17:01 +01:00
Christophe Simonis 49f8548557 [MERGE] forward port branch saas-15 up to 085ff2f9c4 2018-02-21 18:36:36 +01:00
Christophe Simonis 085ff2f9c4 [MERGE] forward port branch saas-14 up to 8c692aac88 2018-02-21 18:09:17 +01:00
Christophe Simonis 8c692aac88 [MERGE] forward port branch 10.0 up to aad677c338 2018-02-21 17:57:00 +01:00
Christophe Simonis aad677c338 [MERGE] forward port branch 9.0 up to 4432e1d5c3 2018-02-21 17:35:11 +01:00
Christophe Simonis 4432e1d5c3 [FIX] project: do not reset task's partner when changing project if project is not linked to a specific partner 2018-02-21 17:26:16 +01:00
Josse Colpaert 6ec6d3e8a1 [FIX] stock: remove action_traceability method on lot fixes #22299 2018-02-21 17:14:13 +01:00
jem-odoo cb53485d71 [FIX] sale: reinvoice only vendor bills
When validating a vendor bill, we want the product
with expense policy set to be reinvoice on the open
sales order matching the analytic account of the invoice
line. Applying the same mecanism for customer invoice
does not make sense, as we might confirm a SO and validate
its invoice, we don't want a new SO line to appear (avoid
loop).
Unfortunately, since a long time, this is possible in Odoo,
and really make no sense. We should only take negative
analytic lines (coming from vendor bills and expense, not
the customer invoice) into account for adding SO line.

This commit correct this problem to avoid having
many null SO line created on customer invoice validation.
All test cases are correctly written, but there was no
check to prevent this mecanism to be apply on customer
invoice.
2018-02-21 16:59:39 +01:00
Martin Trigaux 113385fdd7 [FIX] pos_mercury: do not translate mercury XML
untranslatable content
2018-02-21 16:43:30 +01:00
Christophe Simonis 68379cadbc [MERGE] forward port branch 10.0 up to 2bdc0cc7eb 2018-02-21 16:37:49 +01:00
Swapnesh Shah d6174dd226 [Fix]mrp: Removed unused copy_data method 2018-02-21 15:55:08 +01:00
Nicolas Martinelli c0fa53e45c [FIX] crm: link in planner
The link to configure incoming emails is not correct anymore after the
Sales reorganization.

opw-813987
2018-02-21 15:49:14 +01:00
Yannick Tivisse 4d614f55c3 [FIX] l10n_be_hr_payroll: Use the warrant costs on gross computation
Purpose
=======

The warrant cost formulae has been modified at 5d22170.

Instead of using the (remaining) warrant costs formulae, use the corresponding field instead.
2018-02-21 15:14:26 +01:00
Christophe Matthieu 5fb21b4db4 [FIX] web: evaluation of xml templates must be retro compatible
Issue:
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
is converted into a domain equal [('date','=','%2017-%12-%12')]
instead of [('date','=','2017-12-12')]
2018-02-21 15:09:16 +01:00
Christophe Simonis 2bdc0cc7eb [MERGE] forward port branch 9.0 up to 2120e667b9 2018-02-21 14:36:35 +01:00
Olivier Dony af7860c94c [FIX] project: restore portal visibility
Odoo 11 comes with unified features for Project Tasks and Project
Issues. Specifically, issues were retro-fitted into tasks, and saw their
specific features added to the features of tasks.
During this refactoring, the portal controller for issues was superseded
by a unified portal controller for tasks, via
623ea43268

One case was lost in the process: portal visibility of
tasks/issues/things that are individually followed by customers, without
the customer following the project itself.
This is important for `transversal` projects, such as a "Helpdesk"
project common to all customers, where each customer only sees their own
issues.

This commit restores the feature, previously added to issues by
1cc8252a95

Note: this clearly requires a proper regression test, to be added soon.
2018-02-21 14:12:15 +01:00
Nicolas Martinelli 1fa6b63c0f [FIX] stock_account: groupby
Set the groupby according to what is done in `_read_group_raw`.

opw-816358
2018-02-21 14:03:40 +01:00
Nicolas Lempereur e2280783a2 [FIX] mail: no view edit on forum link in notif
When sending notification from the frontend, if a template is rendered
for it and the user has the group "website.group_website_publisher" he
will get inherit_branding adding on elements things like:

  data-oe-id="42" data-oe-model="ir.ui.view" data-oe-field="arch"

but the chatter system has feature automatically redirecting an element
that have attribute "data-oe-id": this caused for example that a
link notification towards the forum would instead be redirecting to
editing the view of the notification.

This fix distinguish the inherit_branding in the chatter feature and
ignore them.

opw-813333
closes #23225
2018-02-21 13:39:25 +01:00
Nicolas Martinelli 005614ef72 [FIX] stock_account: apply ir rules
- Enable multi-company: without sharing products and partners
- Create 2 companies (company1 and company2)
- Create 2 users one for each company
- Create inventory transaction (receipt) by user1 in company1
- Create inventory transaction (receipt) by user2 in company2
- Using user2 run inventory valuation report with 'At a specific date'
  option.

You got read access error for product.product.

This is due to commit 5c5098f740. We should apply the `ir.rules` to
the query.

opw-816663
2018-02-21 13:31:20 +01:00
Nicolas Martinelli 1460ed08c9 [FIX] mail: tracking of custom field
- Create a custom field
  Field Type: monetary
  Tracking: Always
- Install any module

A crash occurs in `_instanciate_attrs` since `attrs` is `None`.

In some special cases, the instanciation of the attrs of a field is
delayed at the very end of the setup. For example, in case of a Many2one
for which the comodel is not yet loaded.

Therefore the override of the method should take this case into account.

Closes #22922
opw-815185
2018-02-21 13:27:02 +01:00
Christophe Simonis eebc7b6e32 [MERGE] forward port branch 10.0 up to 1512618d3e 2018-02-21 12:42:46 +01:00
Romain Derie 2120e667b9 [FIX] website_sale: variants view, currency price and price diff
Before this commit:
1. When enabling 'List View of Variants' on a product page, it would not
   replace the variant normal view as it should since the code being replaced
   is included in the code replacing it.
2.The badge specifying the price difference between the variance and the
  product base price would be calculated by taking the price_extra of the
  variance attribute and converting it in the user currency which was not
  correct if a pricelist was set on the product variant because the price diff
  would then be (the variant price set on the pricelist) - (product base price)
  Note: this is about the 'List View of Variants' mode, not the normal mode
        which list variant attribute and not variant itself
3. The strikethrough amount was not in the user currency

Step to reproduce:
  - Enable variants & pricelists
  - Enable multi-currency and activate 'COP' as second currency (you may want
    to change the currency symbol on edit mode since it is also '$')
  - Go to iPad Retina Display product page in shop
  - Enable 'List View of Variants' in 'Customize'
  - Both Variants selection mode are visible (bug 1)
  - The third variant shows '+$ 50.40' which is the diff between the
    strikethrough prices (in fact the sum of the price_extra of the product
    variant attributes, +50,40 on the 32GO attribute in this case)
    It should show '+$ 40.32' since the price change from $600 to $640.32.
    This is bug n°2
  - Change Public Pricelist currency from USD to COP
  - Back on iPad page, change between the 3 product variants, you will see
    the $ price strikedthrough instead of the COP one:
    Strikedthrough: 750 (it should be 1 714 491,47)
    Price: 1 371 593,17
    This is bug 3
  - You can notice the bug n°2 being more visible since it shows
    '+$ 115 213,83' instead of '+ 92 171.07'
  - Remove the iPad Retina from Public Pricelist and add iPad Retina 32Go
    variant to it with a fix price of $1 000 000.
  - '32Gb, 2.4GHz, White' variant cost $1 000 000 but shows '+ 115 213.83'
    instead of '- 714 491.47' since the base price of Retina is
    '1 714 491.47'.
  - You can play with the pricelist price for this variant up and down, the
    diff price shown in the badge will always be 115 213.83 since it will
    always calculate it by summing all the variant's attribute price_extra
    and then converting it to the user currency.

This closes #14094, closes #22553
2018-02-21 12:18:56 +01:00
Jairo Llopis dd184b26ac [FIX] web_editor: Export classes and methods
Add various classes and methods to allow customization

Closes #23180
2018-02-21 11:50:57 +01:00
Christophe Simonis 1512618d3e [MERGE] forward port branch 9.0 up to e544ec8df7 2018-02-21 11:27:22 +01:00
Simon Lejeune 3c03376733 [FIX] stock: extra move, backorder and unit price
When creating an extra move, the price_unit field was not copied. It is
normal since the field is copy=False following rev[0].

But there was a side effect: let's say you order 1 product @ $10 and you
receive 5. The received quantity field on the purchase order line is
correctly set to 5 and the valuation inside the stock is correctly set
at $50, but on the picking there is one move line of 5 and a move a 4
and of 1, instead of one of 5. Note that in v10, the pack operation
would be split between the original move and the extra move, but in our
case the extra move is merged back in the original move, so we don't
need to split the move line. The split mechanism is there only when
working with moves without picking[1].

The issue here is that the moves are not merged because they do not have
the same price unit (5 and 0). We thus copy the unit price when creating
the extra move.

When creating a backorder, the price_unit field wasn't copied either.
It's not important when working with the classic flows (the link to
purchase_line_id is kept), but to be consistent we also copy it.

[0] https://github.com/odoo/odoo/commit/a4740861d3fdbecc8b1171b7d2072697e8a36258
[1] https://github.com/odoo/odoo/commit/561b3461a020021d911999cb41154f158b069a1d
2018-02-21 10:44:01 +01:00
Florent de Labarre b55e844e1a [FIX] stock: check the state before put in pack
Makes consistent the Python logic and the view.

Closes #22534
opw-813477
2018-02-21 10:02:41 +01:00
Nicolas Martinelli e544ec8df7 [FIX] stock_account: method expect a record, not an id
Backport of 6cedc90f69
opw-817262
2018-02-20 17:07:24 +01:00
Goffin Simon eb7602c4ea [FIX] sale: Confirmation date duplicated when duplicating SO
When duplicating a SO, the confirmation date is duplicated and the confirmation
date was older than the creation date.

opw:816866
2018-02-20 15:58:04 +01:00
Martin Trigaux 50ccc1e3dd [FIX] mail: know who added somebody to the channel
When X is adding Y in a discuss channel, the recieved notification was:
- if read in discuss: from Y, "joined the channel" (no information who added him)
- if read in email: from X, "joined the channel" (misleading, think X was the
  one joining the channel)

The problem comes from the author_id in the first case and the email_from in the
second, both containing a different value.

Also correct a bad api.multi parameter
2018-02-20 15:48:48 +01:00
Romain Derie b730de1978 [FIX] hr_expense: correctly set address_id for restricted user
New rights were applied on hr.employee with this commit https://github.com/odoo/odoo/commit/2d777d5ade94f4a80862608e2807660f289d9923

Since, users with limited rights would see a read error when submitting an
expense to manager.
Indeed, when clicking on "SUBMIT TO MANAGER", it opens the view form for
'hr.expense.sheet' that trigger an onchange on employee_id to set the
employee's private address to the expense.
Since restricted users can't read that field, the rpc call to that onchange
was throwing an error resulting in:
1. Showing an read error when entering form view that user could close to
   save anyway.
2. The hr.expense.sheet address would not be set as it should have

Now, we give sudo rights to read that field during the onchange

OPW-815786
2018-02-20 15:46:24 +01:00
Nicolas Martinelli 8876b8b3db [FIX] stock: validate picking in waiting state
When a picking is in 'Waiting Another Operation' state, there is no
possibility to force the validation. In v10, it was possible to force
the reservation, which is not possible anymore.

Therefore, we make the 'Validate' button accessible in the mentioned
state.

opw-817234
2018-02-20 15:44:18 +01:00
Martin Trigaux 05e18074cf [FIX] base_gengo: redirect to correct model
The configuration was moved to res.config

Fixes #23170
2018-02-20 15:44:01 +01:00
tbe-odoo 14081b848f [FIX] payment: Payment form not implemented on /website_payment/pay
The generic payment form introduced in 11.0 has changed the way we collect payment and so does the code.
The route /website_payment/pay hasn't been changed to support the new payment form.
This commit fixes this.

It also fixes a bug for when a customer tries to create two transactions with the same reference.
2018-02-20 15:36:56 +01:00
Simon Lejeune 7ed86b53cd [FIX] stock: immediate transfer and unreserved move
Before the patch, validating a picking where one of its move do not
have any quantity done nor quantity reserved resulted in the complete
validation of the said move. This doesn't make sense and does not do
what the help in the wizard indicate (process only *reserved* quantities).

We also use this patch to clarify what the tests on this workflow is
doing (test_immediate_validate_*). We completely replace the 3 as it was
testing the `force_assign` mechanism, which methods are still present in
v11 but unused. Instead this test is now testing the failing flow this
commit is fixing.

We thus adapt the `process` method of the immediate transfer to only
process the move lines (move line = reservation). We also fix a case
where nothing is reserved and nothing is done. In this case, the
backorder wizard should not opens but instead an UserError telling the
user to either cancel or process something. The testcase for this flow
is test_immediate_validate_7.

With these changes, the test `test_04_create_picking_update_saleorderline`
was failing because one of the items in the so lines was a stockable
product without stock. So before this patch, everything was processed,
now there's a backorder wizard. We complete the patch and duplicate it
with enough products in stock, so that the backorder wizard is not
needed.

opw-815056
opw-808126
2018-02-20 14:42:44 +01:00
Goffin Simon 980d786b09 [FIX] mrp_repair: cannot create a repair if not access to product.product
Steps to reproduce the bug:

- Connect as demo user
- Create a repair
- Add a product
- Save

Bug: An access error was raised because the demo user has no access rights
to write on product.product

opw:816645
2018-02-20 13:59:50 +01:00
Nicolas Martinelli 7c92417cba [FIX] base: copy VAT
When creating a company from a partner, copy the VAT number as well.

opw-808019
2018-02-20 13:23:41 +01:00
Josse Colpaert c0f15c57fe [FIX] mrp: Changing the routing on a bom
When changing the routing on a bom, "Consumed in Operation" indicated
in some lines of the BoM did not correspond to the routing used.
So the system did not link it to a workorder and it was never consumed when
a MO was processed.

Now the "Consumed in operation" are reset  when the routing is changed.

opw:807560
2018-02-20 13:02:51 +01:00
Romain Derie bcc088c348 [FIX] web, web_editor: Better email validation with regex (JS)
This commit improves link creation in web editor.

Before this commit, anything with a @​ would be considered as valid email which
is obviously not the case. It would then be prefixed by 'mailto:'.
This was causing 2 issues:
  - URL with @​ symbol in it would have 'mailto:' added as prefix, like google
    maps coordinates.
    eg: mailto:http://www.google.com/maps/whatever/@​312211.22,321321
  - Incorrect emails would go through (eg: @​@​@​, ko@​k@​k@​, mail@​mail)

Now, we will try to detect and identify valid emails from invalid emails from
URLs. It will also handle 'mailto:' directly typed in the input.

This commit comes with it's counterpart in enterprise https://github.com/odoo/enterprise/pull/1859

This closes #11984, closes #22936

Note that there is a WIP in master to use this new is_email function
everywhere we try to validate emails. It will aim to uniformize email
validation in odoo's javascript that are often performed with different mean
here and there, some more permissive than others, some only checking for @​.
2018-02-20 12:30:13 +01:00
Nicolas Lempereur 64be3521ce [FIX] web_editor: don't format xml with script tag
It happens from time to time that someone use "Format" on the
web.layout template. Thus:

```
<script type="text/javascript">
  var odoo = {
      csrf_token: "<t t-esc="request.csrf_token(None)"/>",
  };
</script>
```

becomes:

```
<script type="text/javascript">
  var odoo = {
      csrf_token: "
  <t t-esc="request.csrf_token(None)"/>",
  };
</script>
```

breaking a number of things on the frontend and everything on the
backend.

On a pure javascript content, we could wrap it with:

```
//<![CDATA[
/* javascript content */
//]]>
```

but in this instance we still want the xml to be processed.

This commit avoids formatting XML containing a script tag.

opw-815865
closes #23164
2018-02-20 12:25:54 +01:00
Christophe Simonis bd16df15ea [MERGE] forward port branch saas-16 up to 98d01e46e5 2018-02-20 11:53:06 +01:00
Aaron Bohy 09323cc470 [FIX] web: editable list: leave edition
Before this rev., an issue occurred on grouped editable list views
that became ungrouped after a reload (i.e. when the grouped part in
the search view was removed). In this scenario, the click handler
outside the list used to leave the edition wasn't bound (because
the list was grouped at the beginning, and thus not editable). So,
it was impossible to leave the edition, even by clicking on 'Save'.

Fixes #23061
2018-02-20 11:34:03 +01:00
Christophe Simonis 98d01e46e5 [MERGE] forward port branch saas-15 up to 482370d014 2018-02-20 11:08:54 +01:00
Christophe Simonis 482370d014 [MERGE] forward port branch saas-14 up to 0571362d7a 2018-02-20 10:25:23 +01:00
Lucas Perais (lpe) a0f8ee92c3 [FIX] website_quote: require payment field should be given by the template
When having a default template for quotation
Doing a sale order through the website

Before this commit:
The field require_payment on the SO was not matching the one on the template
This leads to confusion at config time when on the backend something is set on the template as default
while not matching what actually happens

After this commit:
The field require_payment on the SO is computed from the template

OPW 807946
2018-02-20 10:24:33 +01:00
Christophe Simonis 0571362d7a [MERGE] forward port branch 10.0 up to 1a8993e0cb 2018-02-20 10:24:15 +01:00
Aaron Bohy 297e3e4723 [FIX] web: WebClient: reload company logo after edition
This commit only concerns the community webclient. The user can
edit the company data by clicking on the company logo displayed
in the submenu (left bar). When it does, the logo's url must be
updated to force the logo to be reloaded.

The last part doesn't work since the new views, as it uses an
hook of the form view (called when it is saved) that doesn't
exist anymore.

This rev. adapts the code so that the logo is reloaded when the
edit menu dialog is closed.

It also ensures that the logo is properly reloaded by specifying
the timestamp in the img url as a query string parameter instead of
an hash param, since changing the hash doesn't seem to be enough to
fool the browser's cache anymore.
2018-02-20 10:19:08 +01:00
Odoo Translation Bot 54670bb149 [I18N] Update translation terms from Transifex 2018-02-20 09:46:32 +01:00