Commit Graph
7202 Commits
Author SHA1 Message Date
Christophe Simonis b33f919e3d [MERGE] forward port branch 10.0 up to aec8e25 2016-12-06 17:38:40 +01:00
Christophe Simonis aec8e2582f [MERGE] forward port branch saas-11 up to 345755e 2016-12-06 17:24:37 +01:00
Eric Antones d6b26f1d62 [FIX] base: Catalan separator format and thousands separator
* The thousands separator does not appear by default in Catalan language. Using
it is the usual practice

Closes #14123
2016-12-05 16:43:14 +01:00
Alexis de Lattre ef8116628b [FIX] base: display the value of ir.property
For the records with type='selection' (example: "Cost Method Property")

Closes #14413
2016-12-05 16:33:56 +01:00
Osval Reyes 5a4c548ab1 [REF] base: update peruvian currency symbol
- Currency symbol position is set before the amount, not after
- Since last month 2015 (see https://es.wikipedia.org/wiki/Sol_(moneda_del_Per%C3%BA) )
the currency passed from S/. to S/ (without the dot)

Closes #14370
2016-12-05 16:26:55 +01:00
Jérome Maes 13f84b9aca [REM] *: remove ir.needaction mixin
ir.needaction_mixin is not used anymore by the webclient.
From 9.0, the concept has changed: this feature is now
available in mail module, with the mail.thread mixin,
and message_neeadction field.

Remove all code handeling needaction bullet and
counter on ir.ui.menu, knowing that since 9.0
webclient does not display the counter anymore.

This code was, thus, useless and some RPC calls
were done for nothing, and adapt accounting
reconcialiation widget.
2016-12-05 11:30:03 +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
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
Christophe Simonis 0b846861b6 [MERGE] forward port branch 10.0 up to 5dc1c57 2016-12-01 17:05:08 +01:00
Christophe Simonis 5dc1c57601 [MERGE] forward port branch saas-11 up to 7842498 2016-12-01 16:59:33 +01:00
Kishan Gajjar 167057800b [IMP] web,website: Only display planner for group_system users
Planners should only be visible for "base.group_system" user group (admin settings) because there are links to install apps etc. For now missing access rights messages whenever you click a settings link.Only for admin and not by company.
Admin and the user who has "base.group_system" rights can see the planners.
2016-12-01 16:32:01 +01:00
Martin Geubelle ed22e0fb84 [ADD] base: display unpickled value 2016-12-01 14:38:30 +01:00
Odoo Translation Bot 8de795291a [I18N] Update translation terms from Transifex 2016-11-27 03:41:40 +01:00
Christophe Simonis 7d4ac39c4c [MERGE] forward port branch saas-12 up to d853d3c 2016-11-24 18:35:42 +01:00
Odoo Translation Bot 9ab572fa4c [I18N] Update translation terms from Transifex 2016-11-23 13:50:32 +01:00
Yannick Tivisse 98cb4719db [REM] workflow: Remove workflow engine, documentation and tests 2016-11-23 11:52:39 +01:00
Christophe Simonis e348330b57 [MERGE] forward port branch 10.0 up to 6a18e31 2016-11-22 17:59:41 +01:00
Moises Lopez - https://www.vauxoo.com/ 4fb15ccdd7 [RES] base: Add thousand separation for es_MX ","
More information from https://en.wikipedia.org/wiki/Decimal_mark section:
"examples of use"
`The following examples show the decimal mark and the thousands separator in
various countries that use the Arabic numeral system.`
`Style: 1,234,567.89    Countries: Malaysia, Mexico, New Zealand, Pakistan,
Philippines, Singapore, Taiwan, Thailand, United Kingdom, United States`

Closes #14402
2016-11-22 15:08:39 +01:00
angelfentanez e965ac14dd [FIX] modules: add missing parameter to find_module
AddonsImportHook's find_module method to follow PEP302 by setting None as
default for the path parameter
Similar to edeb5a8c

Fixes #14087
Closes #14088
2016-11-22 14:51:05 +01:00
Christophe Simonis 457a705bf0 [MERGE] forward port branch saas-12 up to d1fddd2 2016-11-22 14:02:03 +01:00
Martin Trigaux b5c555ff0a [FIX] base: avoid duplicated translations
This commits fixes the following scenario:

1. load translations in language X
2. modify the source of a translated record (e.g. email template body)
3. click on 'load translations' button (flag)
4. execute the translation wizard for the same language (to refresh)

The translation of the modified record was duplicated.
This was due to the field src in the database being different than the msgid in
the po file. The src value is updated on the `insert_missing` call.

The matching on src for type='model' translations is only needed due to the
translations that are split (e.g. xml views or html content). For the other
translations, matching on the rec_id is enough.

opw-691752
Closes #14310
2016-11-22 11:37:02 +01:00
Jeremy Kersten 651976521b [IMP] base, mail: action server: remove deprecated code 2016-11-21 12:56:59 +01:00
Odoo Translation Bot bad26aae2e [I18N] Update translation terms from Transifex 2016-11-20 03:37:19 +01:00
Christophe Simonis 2d26229052 [MERGE] forward port branch 10.0 up to ea675d8 2016-11-18 18:29:23 +01:00
Christophe Simonis ea675d8b76 [MERGE] forward port branch saas-12 up to ff7f3d6 2016-11-18 18:03:47 +01:00
Jeremy Kersten a55ee3858c [FIX] *: convert action server to new syntax
Use record / records instead of deprecated locals
2016-11-18 10:03:48 +01:00
Devendra Kavthekar 8872800e75 [IMP] sql_db: Improve error message logging on database querries
Purpose:

When we have a SQL error, it's not very easy to identify the root of the crash. For example if a mandatory field is not set on a row creation, it difficult to see which field isn't correctly set as a lot of fields are not required and a lot a NULL values are present in the INSERT querry.

Specification:

Show a proper log message, with the reason (cause) of the sql error.

Behavior Modification Examples:
Some sample log after applied fix. The new line are those beginning by '+'

2016-10-25 09:59:40,208 21161 INFO ent_master odoo.sql_db: bad query: INSERT INTO "res_partner_category" ("id", "active", "color", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval('res_partner_category_id_seq'), true, 10, 1, 1, (now() at time zone 'UTC'), (now() at time zone 'UTC')) RETURNING id
+REASON: null value in column "name" violates not-null constraint
+DETAIL:  Failing row contains (27, null, null, 1, null, 10, 1, null, 2016-10-25 09:59:40.207202, t, 2016-10-25 09:59:40.207202).

2016-10-25 10:00:29,710 21161 INFO ent_master odoo.sql_db: bad query: UPDATE "res_partner" SET "parent_id"=1001,"type"='contact',"name"='Course Script',"company_name"=NULL,"write_uid"=1,"write_date"=(now() at time zone 'UTC') WHERE id IN (1)
+REASON: insert or update on table "res_partner" violates foreign key constraint "res_partner_parent_id_fkey"
+DETAIL:  Key (parent_id)=(1001) is not present in table "res_partner".

2016-10-25 10:23:28,690 21336 INFO ent_master odoo.sql_db: bad query: DELETE FROM res_country WHERE id IN (235)
+REASON: null value in column "country_id" violates not-null constraint
+DETAIL:  Failing row contains (9, 1, AL, Alabama, null, 1, 2016-10-24 10:19:58.765552, 2016-10-21 09:32:26.939607).
+CONTEXT:  SQL statement "UPDATE ONLY "public"."res_country_state" SET "country_id" = NULL WHERE $1 OPERATOR(pg_catalog.=) "country_id""
2016-11-17 16:33:57 +01:00
Christophe Simonis e2fcace05e [MERGE] forward port branch 10.0 up to 13dc704 2016-11-17 15:27:29 +01:00
Christophe Simonis 13dc7041a6 [MERGE] forward port branch saas-12 up to 1ef4061 2016-11-17 15:24:36 +01:00
Christophe Simonis bcddba4e4b [FIX] fields: set attributes before accessing them
If renamed attributes are used, a warning is emit with `repr` of the
culprit field, which need attributes to be set.

Fixes #14036
2016-11-17 13:40:24 +01:00
Jeremy Kersten 9a8975be46 [FIX] base: add record, records in context of ir.actions
Purpose is to remove old variables in next version:
    - obj
    - object
    - cr
    - user
    - uid
    - context
    - pool
    - workflow

record = model.browse(env.context['active_id'])
records = model.browse(env.context['active_ids'])

obj, object => record
user => env.user
cr => env.cr
uid => env.user.id
context => env.context
pool => env
workflow => record.signal_workflow()
2016-11-16 18:46:01 +01:00
Denis Ledoux 4ea356110e [FIX] base: crons Work Days option
As you can see from the code,
choosing "Work days" or "days" as internval
has exactly the same behavior.

Users might nevertheless expect the interval
"work days" option to avoid running the
action on non-working days, such as
Saturdays and Sundays.

It may have been intended, but it never
worked, since revision 1:
https://github.com/odoo/odoo/blob/004a0b996ff8f269451e07346f71a129a1f3fbaf/bin/addons/base/ir/ir_cron.py#L49-L50

opw-693882
2016-11-16 17:05:14 +01:00
Christophe Simonis dece72d010 [MERGE] forward port branch saas-12 up to ca20038 2016-11-15 13:58:55 +01:00
Uku Lagle f701311f72 [FIX] cli: correct link to module categories file
As the folder openerp no longer exists

Closes #14263
2016-11-14 17:07:44 +01:00
Martin Trigaux 014a6e283f [I18N] export 10.0 source terms 2016-11-14 16:57:46 +01:00
David Arnold a35d8895b1 [FIX] base: es_CO date format
Closes #14065
2016-11-14 16:39:37 +01:00
Yenthe V.G 3f605d18ba [FIX] cli: correct templates for scafold
Convert openerp to odoo

Closes #14129
2016-11-14 16:26:23 +01:00
Odoo Translation Bot 7a800427df [I18N] Update translation terms from Transifex 2016-11-13 03:42:40 +01:00
Raphael Collet f825f415f8 [FIX] registry: ensure that all non-abstract models have a table (#14194)
After modifying the database schema, if some models do not have a table/view,
attempt to recreate it by calling their method `init()`, following inter-model
dependencies.

Fix the model `board.board` by making it an abstract model.

Add the missing model dependencies on report `crm.partner.report.assign` to make
it depend on report `account.invoice.report`.
2016-11-10 13:50:04 +01:00
David Monjoie ca11d35a62 [FIX] base: enforce deterministic view inheritance
If multiple views had the same name and same priority, the order
of application of their xpath was not deterministic. That may be a
big deal if both of them were doing xpath with position = inside.
2016-11-09 10:51:09 +01:00
Mansi Gandhi 5cb307170d [IMP] base, auth_signup: rename technical users to avoid confusion
* default user > Default User Template
 * Template User > Portal User Template
2016-11-09 10:48:33 +01:00
Moisés López cc444338ed [FIX] base: change Mexican city name
'Distrito Federal' is renamed 'Ciudad de México'
English news:
https://www.theguardian.com/world/2016/jan/29/mexico-city-name-change-federal-district-df
Official reference (spanish):
http://www.dof.gob.mx/nota_detalle.php?codigo=5424565&fecha=05/02/2016

Closes #14034
2016-11-08 15:37:46 +01:00
Christophe Simonis 7eb8ed2769 [MERGE] forward port branch 10.0 up to 3d085f6 2016-11-08 15:13:05 +01:00
Christophe Simonis 3d085f632d [MERGE] forward port branch saas-12 up to 6386037 2016-11-08 15:01:20 +01:00
fwi-odoo ce91c5b6f5 [FIX] base: partner's default to company instead of individual for sales menu (make clearbit feature visible for on boarding)
Fix commit 69b641d6bc
2016-11-07 15:04:24 +01:00
Odoo Translation Bot 7cfbdd57b4 [I18N] Update translation terms from Transifex 2016-11-07 11:09:10 +01:00
Moises Lopez 6665a6a6e1 [IMP] base: add search on 'vat' field in name_search() of res.partner.
Courtesy of Vauxoo
2016-11-07 11:06:51 +01:00