Commit Graph
106533 Commits
Author SHA1 Message Date
Osval Reyes e4d1155d6f [CLA] include osvalr as a member of Vauxoo
cf #14370
2016-12-05 16:26:54 +01:00
Sebastián Ramírez f378a31564 [FIX] project: raise validation error
The ValidationError in Task._check_dates was returned instead of raised
Closes #14393
2016-12-05 16:20:59 +01:00
Goffin Simon 14e5b7fcb6 [FIX] portal_stock: access rights
When clicking on the delivery order linked to the SO with a portal user,
a access right error was raised.

1. Due to this record rule: res_partner: portal/public: read access on my commercial
The portal user cannot read the fields of the partner linked to the warehouse of the picking.
The unreadable fields were in external_layout_footer.

2. The portal user is not allowed to read the field barcode on a product.

opw:693238
2016-12-05 15:52:48 +01:00
Lucas Perais (lpe) 1f795a2d5a [FIX] hr_holidays: notifications: This commit corrects the behavior of notifications.
The actions on notifications are appended to an empty list

[FIX] hr_holidays: appending actions on notifications

Closes #14565
Related to ticket 695738
2016-12-05 10:25:16 +01:00
Andrea Stirpe b431e18226 [FIX] l10n_nl: adjust sequence to handle default taxes
Default sale tax should be Verkopen/omzet hoog
Default purchase tax should be BTW te vorderen hoog (inkopen)

Closes #14174
Fixes #14166
2016-12-05 09:21:36 +01:00
Jared Kipe 88114f45b6 [FIX] website_project_issue_sheet: duration rounding
Complement of commit 4fea5d1020

opw-694014
Closes #13781
2016-12-05 09:14:45 +01:00
Moisés López 44a6366ba4 [REM] all: Remove es_MX.po files
- Previous information:
  - `es_MX` language is not published to [transifex](https://www.transifex.com/odoo/odoo-10/languages/) this is a official announce from thread [Regional languages and Spanish (Latin America) translations](https://www.odoo.com/es_ES/groups/community-translators-63/community-translators-20325962?mode=thread&date_begin=&date_end=) by @mart-e
  - Currently we have the files `es_MX.po` with terms translations outdated or wrong translation.
    - [Example wrong translation es_MX.po](https://github.com/odoo/odoo/blob/8de795291/addons/account/i18n/es_MX.po#L7788) should be [es.po correct translation](https://github.com/odoo/odoo/blob/8de795291/addons/account/i18n/es.po#L7975)
  - Now to change a `es_MX.po` a PR is required.
  - `es.po` terms translations and the most terms are fine for México too. (Not regional translation is required for most cases)

Then our regional translation process should be:

| step | If accepted | If not accepted |
|------|-----|-------|
|   Create a proposal to original language `es.po` from transifex    |   good and finish!  |   Create a new PR to odoo/odoo adding just that special term to `es_MX.PO` |

This PR reset the `es_MX.po` terms in order to fix many wrong terms using the good `es.po`.

Closes #14555
2016-12-05 09:11:13 +01:00
Odoo Translation Bot 260a3da768 [I18N] Update translation terms from Transifex 2016-12-04 03:44:39 +01:00
Olivier Dony 553ea82f81 [FIX] ir.qweb: invalidate cache only when active
Complements rev. 8a7af44a07

The assets cache is only active while not in "xml dev" mode,
so the cache clearing must not be done while this development
mode is active (i.e. with `--dev=xml`)
2016-12-02 17:19:08 +01:00
Nicolas Martinelli 4fea5d1020 [FIX] website_project_timesheet: duration rounding
- Record a timesheet line duration of 2 minutes
- View the record in the frontend: it gives 1 minute 59 seconds

opw-694014
2016-12-02 12:52:38 +01:00
Olivier Dony 8a7af44a07 [FIX] ir.qweb: force multi-worker bundle invalidation
When a newly-spawned worker detects a stale asset bundle
(due to its empty cache), it regenerates the new bundles,
but has to notify other workers, who would otherwise continue
serving the old list of bundles. This typically leads to
some missing bundles (served as empty files with 404 status),
that could only be cured by restarting the whole server.

Forcing the cache invalidation on the worker that notices
the staleness has no effect (the cache was empty) except
that it causes a cache refresh signal to be broadcast to
all workers.
2016-12-02 12:25:16 +01:00
Simon Lejeune 12e36a66f2 [FIX] qweb: render a child view with its xmlid
QWeb's get_template:
  * remove the fallback that returned the entire result of IRQweb's
    `load` if no match was made between the t-name of the first children
    of this result and the template to render
  * When get_template receives an etree, directly return it and don't
    try to find a matching t-name in it. The loader was not called but
    a matching was trying to be made, now that we removed the fallback
    a lot of tests that were relying on passing etree didn't work
    anymore.

IRQweb's load now return consistently the full result of IrUiView's
`read_templace` when asked to load an id or an xmlid. We make a special
case to patch the result if asked with an id or with a child view so
that the "t-name" of one of the first children of what we return is
always what QWeb is looking for.
2016-12-02 12:24:51 +01:00
Simon Lejeune 9dd5bd9349 [ADD][TEST] qweb: render a child view with its xmlid
Issue: rendering a child view with its xmlid return its `read_template`
wrapped in a "templates" tag. In the context of asset bundles, it leads
to the browser not being able to handle it correctly.

Explanation:

What happens when you render a view? First, QWeb will call is method
`get_template` with the argument `template`. This argument contains the
name of template you try to render. It can be an id or an xmlid (also an
etree but let's forget this one at the moment). Within the method
`get_template`, it'll call IrQweb `load` method, again with the argument
`template`.

This `load` method will call IrUiView's `read_template` wih `template`
as argument. This method will return the view in the database with all
inheritance applied, wrapped in a "templates" tag. When `read_template`
has returned, the `load` method will, according to `template` and in the
following order:

  * if `template` is an xmlid, return the whole `read_template`.
  * if `template` is an id and if one of the first child has "t-name"
    attribute (whatever its value): return the subtree of this first
    child.
  * if `template` is an id and one of the first child is a "t" tag: set
    a "t-name" attribute to this first child with the id as value and
    return the subtree of this child.

As you may note, inconsistencies already appear.

Now that QWeb's `get_template` has finished its call to IRQweb's `load`,
it'll do:

  * if one of the first child of what's returned as a "t-name" attribute
    matching the `template` argument, return this subtree
  * return the whole thing returned by IRQweb's `load`.

Let's say we have a view:

                <t t-name="base.dummy">
                    <div><span>something</span></div>
                </t>

What happens if we render this view with its xmlid? First Qweb's
`get_template` will load the template with the help of IRQweb's `load`
method. As it received an xmlid as argument, it'll return the whole
`read_template` output, wrapped in a "templates" tag. Qweb's
`get_template` will now check if one of the first child has a "t-name"
attribude matching the `template` argument (base.dummy in our case). It
has one, so it returns the subtree and the compilation continue.

What happens if we render this view with its id? IRQweb's receives an id
as argument, gets the `read_template` of it and check if one of the
first child has a "t-name" attribute. It does, so it returns this
subtree to `get_template`. The latest will check if one the first
children has a matching "t-name" attribute with the `template` argument.
It does not, so it returns the whole thing.

Weird things in the way we got here but the result is the same whatever
you tried to render the template with an id or an xmlid.

Now let's add an extension to this view and try to render it (the
extension):

                <xpath expr="//div" position="inside">
                    <span>another thing</span>
                </xpath>

What happens if we render this view with its xmlid? `load` will receive
an id, so it'll return the whole `read_template` stuff. Note here that
if you try to render a parent or child view, `read_template` will return
the same thing: the parent with all inheritance applied. Now `get_template`
looks through the first children of this to find a matching "t-name" and
it doesn't find one, as the "t-name" is the one of the parent view and
we tried to render with the child xmlid. It so returns the whole thing,
wrapped in a "templates" tag. There's our issue.

It's working if we tried to render the thing with its id because `load`
would have returned the right subtree.

This commit adds a test showing the failure.
2016-12-02 12:24:51 +01:00
Nicolas Martinelli a894fb33c1 [FIX] product: bigger ratio
- Create a new unit of measure with 'Bigger than the reference Unit of
  Measure'
- Save
- Edit and change the ratio ==> the ratio is set back to its value

opw-695507
2016-12-02 11:10:19 +01:00
Whitley 3344cce465 [FIX] doc: Updated link for ProxyFix
Dead link
Closes #14484
2016-12-02 11:07:14 +01:00
Alexis de Lattre fc57a20f6e [FIX] mrp: don't use the same default_code for different products
Wrong demo data
Closes #14544
2016-12-02 07:08:09 +01:00
Christophe Simonis 18fc260369 [FIX] website_sale: fix js error introduced by previous forward-port 2016-12-01 19:05:28 +01:00
Christophe Simonis 5dc1c57601 [MERGE] forward port branch saas-11 up to 7842498 2016-12-01 16:59:33 +01:00
Christophe Simonis 7842498934 [MERGE] forward port branch 9.0 up to 5bed95f 2016-12-01 15:33:21 +01:00
Christophe Simonis 5bed95fbd5 [MERGE] forward port branch saas-6 up to 97af232 2016-12-01 14:47:17 +01:00
Christophe Simonis 97af2325cd [MERGE] forward port branch 8.0 up to 0105cbb 2016-12-01 14:39:25 +01:00
Martin Trigaux 2e960afd37 [I18N] update saas-11 translations by merging 9.0 and 10.0 2016-12-01 13:52:01 +01:00
Nicolas Martinelli 4f43ec4fcf [FIX] calendar: invitation template lang
- Create a calendar event
- Add invitees

The invitees receive a mail so they can accept/decline. When clicking,
the page is always displayed in the language of the administrator.

Since the `request` object is not directly associated to the attendee,
the template is not rendered in his language. Since (i) the template
should not be rendered lazily (see comment in code) and (ii)
`request.render()` does not allow the rendering in an arbitraty
language, we do a manual call to `render_template`.

opw-694718
2016-12-01 11:52:27 +01:00
Denis Ledoux 0105cbbcf9 [FIX] website: make website default language required
The website `default_lang_id` was not required,
while the algorithm choosing the website language
expects it to be required.

This solves the below issue, when your browser language is en_US:
 - add a second language to the website (e.g. fr_BE or es_VE),
 - in the website settings, remove English from the languages
 - in the website settings, unset the default language
 - try to go on the website

You will have a crash:
```
  File "/home/odoo/src/odoo/saas-11/addons/website/models/ir_http.py", line 193, in _dispatch
    resp.set_cookie('website_lang', request.lang)
  File "/usr/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 992, in set_cookie
    self.charset))
  File "/usr/lib/python2.7/dist-packages/werkzeug/http.py", line 905, in dump_cookie
    value = to_bytes(value, charset)
  File "/usr/lib/python2.7/dist-packages/werkzeug/_compat.py", line 106, in to_bytes
    raise TypeError('Expected bytes')
TypeError: Expected bytes
```

This is because the `request.lang` is set to `False`
because of the below algorithm in `ir_http.py`:
```
    nearest_lang = not func and self.get_nearest_lang(path[1])
    url_lang = nearest_lang and path[1]
    preferred_lang = ((cook_lang if cook_lang in langs else False)
                      or self.get_nearest_lang(request.lang)
                      or request.website.default_lang_code)

    is_a_bot = self.is_a_bot()

    request.lang = request.context['lang'] = nearest_lang or preferred_lang
```
`nearest_lang` is `False`, because there is no nearest language
available for the browser lang (`en_US`)
`cook_lang` is `False` for users who never went on the website
`request.website.default_lang_code`, which is the last feedback,
is also `False` because you removed the default language
in the website settings.

opw-695621
2016-12-01 11:37:03 +01:00
Goffin Simon a433ae65cb [FIX] purchase: default picking_type_id with ir.values
The deleted code put the same picking_type_id for all companies.
The function _get_picking_in returns the right default picking_type_id
according to the company.

Steps to reproduce:
-stock.warehouse0 is on company A.
-Define another company B with its own warehouse.
-Update the purchase module -> a new default value for picking_type_id on purchase
order for company B is created wtih the value of company A
-Create a purchase order on company B, Odoo tries to get the picking_type_id from company A.
If user doesn't have any rights on company A, it occurs a security warning.
Otherwise the purchase order is linked to a picking operation of another company.

opw:694059
2016-12-01 10:04:30 +01:00
Nicolas Martinelli e6ba772406 [FIX] mrp: BOM Cost report
1. Set up BoM component A with cost of $1 per kg
2. Create a BoM which uses 1t of component A
3. Execute the BOM Cost report

Cost of component A is $1, while it should be $1000.

opw-695014
2016-12-01 09:59:09 +01:00
Denis Ledoux 021878f9c4 [FIX] tools: formatlang currency digits
When passing a value along with a currency
to the `formatLang` method,
the currency symbol was added to the value,
but the amount wasn't rounded to the currency
decimal places, as it would be expected.

For instance, when using the currency "XOF",
with as symbol "CFA" and 0 decimal places,
2 digits after the comma were still displayed
in the accounting dashboard, while the user expects none.

This behavior to take the number of digits out of the currency
is already the behavior of the `formatLang` methdod in the reports
(`/openerp/report/report_sxw.py`)
it was just not yet the case in the misceleanous tools
(`/openerp/tools/misc.py`).

opw-695496
2016-11-30 16:46:49 +01:00
Goffin Simon 60300fc287 [FIX] website_sale: _get_pl_partner_order
The function _get_pl_partner_order must also return the available
pricelists on the website with promo code. In this way, the user
can use promo code on the website.

opw:694556
2016-11-30 16:19:56 +01:00
Goffin Simon c352945bf5 [FIX] account: Reversing exchange rate difference entry
To reverse all the the exchange rate difference entries created during the reconciliation.

Before the fix:

Configuration
- Company Currency USD
- Multicurrency
- Other Currency EUR with exchange rates per day.
- Bank journal in EUR with allow cancelation.

Steps
- Create more than 1 invoice for customer in EUR and validate it. (Example. 3 invoices 100 EUR each)
- Create a bank statement in EUR Bank with the payment of that invoices (Example. 300 EUR)
- Conciliate the payment with the invoices.
- The journal entries for exchange difference are correctly created(three exchange rate difference entries).
- Cancel the payment from bank statement.

Bug:
There was only one reverse journal entry created for the exchange rate difference of the all reconciliation.
But three reverse journal entries  for exchange rate difference entries were expected.

opw:694120
2016-11-30 15:57:29 +01:00
Antonio Espinosa aac0faafb8 [FIX] membership: remove date_cancel for draft invoices
In `action_cancel` method below, the date_cancel is set when the linked invoice
is canceled.
When the canceled invoiced was reset to draft, the date_cancel was not removed.
This change makes sense as the state of the membership line is changed from
`cancel` to `waiting` when the invoice is reset to draft.

Closes #14313
2016-11-30 14:33:16 +01:00
Martin Trigaux c965e64e52 [FIX] l10n_multilang: add only translate flag
No need to redifine existing attributes.
Introduced at db682bf
2016-11-30 13:58:03 +01:00
Nicolas Martinelli e5cad9a45e [FIX] web: date autocompletion
When a user fills partially a date or datetime field, the system will
somehow autocomplete the value entered. For example, if the user enters
"11//11" then clicks on the Tab key, it will be completed as
"11/11/0000".

However, the year 0000 is not recognized in Python, and this causes a
crash upon saving.

opw-695035
2016-11-30 13:56:20 +01:00
David Tran 0d160851c7 [ADD] l10n_multilang: allow to translate account tag
Account tags are used to describe accounts and contains text that makes ense to
be translated for multilangue CoA

Closes #14527
2016-11-30 13:55:53 +01:00
David Tran f16d2e9ec7 [ADD] sign the CLA
Closes #14527
2016-11-30 13:55:53 +01:00
Denis Ledoux 05010362d5 [FIX] product: remove currency rounding check against DP account
The decimal precision `Account` no longer exist.
This check is therefore pointless, and prevent
to change the rounding of the currency of the main company
2016-11-30 13:24:03 +01:00
Christophe Simonis deaec34996 [FIX] l10n_nl: do not mark tax templates as noupdate 2016-11-30 12:16:11 +01:00
Martin Trigaux adb12f95ea [IMP] sale: remove untranslated terms
Closes #14497
2016-11-30 08:37:57 +01:00
Jeremy Kersten 1f10ef8055 [FIX] website_sale: fix amount format display
Before this commit, amount updated from ajax request don't respect currency format.
Eg: 1.200,000 => 1200.00

Now we use the grouping/thousand separator/decimal separator from l10n,
and if class decimal_precision is defined in dom, we use it. (format=0.001)

This commits closes: #11553
This commits is related to #1103
2016-11-29 17:00:18 +01:00
Jeremy Kersten 21148fb46f [FIX] website_sale, website_portal: typo in label for
This commit closes an issue.
2016-11-29 16:40:47 +01:00
Jeremy Kersten fee6015964 [FIX] website_sale: format amount according to currency client side
This commit closes #1103, closes #11553
2016-11-29 16:40:15 +01:00
Goffin Simon a5f186c158 [FIX] purchase: _get_stock_move_price_unit
valuation_price_unit must in the uom of the line.

Before the fix:

- Set "Use anglo-saxon accounting" True at company settings.
- Check that the "Account Properties" on product category are set (set a price difference account).
- Set costing method = Average price, Inventory valuation = Perpetual (automated).
- Create and confirm a PO (product purchased with unit of measure "Unit(s)" and purchase unit of measure "Dozen(s)")
- Validate shipment (Receive the product)
- Create and validate the supplier invoice
- View the accounting journal entries

Bug:

In the invoice journal entry, there were:

In the output account: debit=0.0 and credit=price unit of the PO line
In the price difference account: debit= (11/12)*price unit of the PO line and credit=0.0
In the input account: debit=(1/12)*price unit of the PO line and credit=0.0

Expected behavior:

In the output account: debit=0.0 and credit=price unit of the PO line
In the input account: debit=price unit of the PO line and credit=0.0

opw:694108
2016-11-29 15:17:17 +01:00
Denis Ledoux 3589c3f666 [FIX] note: fix _notification_recipients
Since revision 458aaca328,
the `groups` args of the method `_notification_recipients`
is a list of tuple, and no longer a dict.

The code here has not been adapted to this change.
It is now.

opw-695300
2016-11-29 11:35:13 +01:00
Denis Ledoux 060d6927c9 [FIX] website_portal_sale: portal, exclude vendors bills
The vendors bills must not be displayed in the portal invoices.
We shouldn't ask the supplier to pay their own invoices :).

opw-694215
2016-11-29 11:35:13 +01:00
Jérome Maes 32e812a916 [FIX] website_sale: create consumed rating
Otherwise, it is not taken into account when
computing grates in rating mixin.
2016-11-29 09:56:40 +01:00
Jérome Maes 5b6d734f6f [FIX] rating_project: use correct domain
The computed domain to see consumed rating
of task and issue was simply not correct.
2016-11-29 09:56:31 +01:00
Denis Vermylen (dve) a82055c911 [FIX] hr_*: Make button box visible to employees
The employee form view button box should be enabled for employees,
it's up to each button in their respective modules to define
more restrictive groups, and in fact they already do
(see hr_holidays, hr_timesheet_sheet, hr_contract ...)

For example, hr_holidays adds the "Leaves left" smart button
which is supposed to be visible for employees looking at their own profile,
but it was actually hidden because they couldn't see the entire buttonbox.

Also added fixes to buttons that came afterwards and relied on this behavior.

fix for https://github.com/odoo/odoo/pull/14164
2016-11-28 14:50:15 +01:00
Nicolas Martinelli bdf630f9b8 [FIX] account_analytic_default: invoice from PO
- Create a vendor bill
- Add a PO thanks to the "Add Purchase Order"
- The analytic accounts are not added on the lines

opw-693313
2016-11-28 13:00:34 +01:00
Goffin Simon cadb7e0bfd [FIX] base: writing on is_company field
The commercial_partner_id field on "account.invoice" is a stored related
field to commercial_partner_id on res.partner and this field is recomputed
when changing the is_company field (by the function _commercial_partner_store_triggers).
So when changing the "is_company" field, the commercial_partner_id is recomputed and
a write is made on each account.invoice linked to the commercial_partner_id.

To avoid access rights problem on account.invoice, the write on "is_company"
must be done in SUPERUSER.

opw:694687
2016-11-28 10:39:53 +01:00
Goffin Simon 043aa0b158 [FIX] stock_account: _get_anglo_saxon_price_unit
Backport of ab279d9cea

When getting the price from a account.move.line, the uom set
on the line must be taken into account.

Before the fix:

-Set anglo-saxon accounting
-Create two units of measure Box and Mot where 1Mot = 10Box
-Create a stockable product with Box as unit of reference and set with
real price and perpetual
-Create a SO with a Mot of this product
-Confirm the SO and create the invoice
-Validate the invoice

Bug:
In the journal of entries, only one box was counted for the debit and the credit
instead of 10.

NB: The function _get_anglo_saxon_price_unit must return the price unit of the
product in the unit of measure of the account.invoice.line.

opw:693075
2016-11-28 10:20:38 +01:00
Odoo Translation Bot 8de795291a [I18N] Update translation terms from Transifex 2016-11-27 03:41:40 +01:00