Commit Graph
968 Commits
Author SHA1 Message Date
Olivier Dony 2257583bb5 [ADD] ir.attachment: add token field for external access
Introduce a new attachment field (access_token) to allow external
unauthenticated access. This will be an opaque unique number
(typically a UUID) that should be provided via an appropriate
controller, for unauthenticated display.

The field is intended to be NULL unless unauthenticated access has been
allowed, in which case a value will be set for the access_token.

This could be used e.g. for allowing access to images within mailings,
even when the recipient is not logged in (which is sometimes entirely
impossible, when email providers use restricted proxy servers to
load images)

Note 1: this is still a work-in-progress, but serves to freeze the API.
The implementation of the access check and provisioning of the new
field will be added later.

Note 2: namimg collisions with the file download token prevent the use
of a shorter 'token' parameter for download routes.

Apologies for the late (and incomplete) addition in saas-18 :-/
2017-09-21 23:48:36 +02:00
Christophe Simonis 5c51a0ad4d [MERGE] forward port branch saas-17 up to bf4ccb21f6 2017-09-21 18:14:55 +02:00
Christophe Simonis bf4ccb21f6 [MERGE] forward port branch saas-16 up to 88395bdb8e 2017-09-21 17:18:49 +02:00
kujiu (@havelock.kujiu.org) 1fbaa11c6f Revert "Add attributes and elements on XML views' checks to avoid errors with Studio (renamed_field and studio_groups) (#19623)"
This reverts commit fc5d6e1ab9.
2017-09-21 16:40:16 +02:00
kujiu fc5d6e1ab9 Add attributes and elements on XML views' checks to avoid errors with Studio (renamed_field and studio_groups) (#19623) 2017-09-21 16:21:53 +02:00
Raphael Collet c6b184bb23 [FIX] fields: optimize many2many command (6, 0, ids) on new records
The command does not need to remove existing relations, as there is no relation
yet on new records.  This saves one query per many2many field with that command
in a `create`.
2017-09-21 16:10:13 +02:00
Raphael Collet 59a8234fbc [FIX] mail performance: avoid useless queries
Avoid making queries that are known to return empty recordsets, and do not
format messages to be notified on no channel.
2017-09-21 16:10:13 +02:00
Christophe Simonis 88395bdb8e [MERGE] forward port branch saas-15 up to 3ad3b34df6 2017-09-21 16:00:27 +02:00
Christophe Simonis 3ad3b34df6 [MERGE] forward port branch saas-14 up to 537d1ec0d2 2017-09-21 15:08:34 +02:00
Christophe Simonis 537d1ec0d2 [MERGE] forward port branch 10.0 up to e245135421 2017-09-21 14:01:41 +02:00
Martin Trigaux 9d2e825340 [I18N] export saas-18 source terms
saas-18 will be the future version 11
2017-09-20 16:14:08 +02:00
Martin Trigaux 289b6046d6 [FIX] tools: py3k export translations
Previous code was converting the text to bytes which fails below

AttributeError: 'int' object has no attribute 'isalpha'
2017-09-20 16:13:37 +02:00
Raphael Collet f776f9f3dc [FIX] ir_http: routing map crashes after having run unittests
If the server was launched with ``--test-enable``, `routing_map` tries to load
the routing map of module `None`, which is the current module being tested...
2017-09-20 14:52:43 +02:00
Nicolas Lempereur a0fddebe64 [FIX] base: prevent bin_size/binary visual defect
Changing the address type of a contact in the "Contact & Addresses" tab
could in some instance lead to a dead image (just visually, saving it
would not change it) because the image is set to something like
"data:image/png;base64,5.23 Kb" because of a combination of kanba/form
x2many view, onchange, the differences of field present.

In 9.0 this did not happen because the image was not a field in the form
view corresponding to a contact of the kanban contacts view.

In saa-15 thanks to bf26445 the image_small is different than image in
the kanban view and this got us out of the issue.

In saas-16 it is solved even further because new views only load missing
fields.

This commit just get out of the issue by preventing an update of the
records field (with bin_size which caused the issue of the image) when
opening the modal form view of a contact's contact.

Ideally we should solve this more deeply but this is dangerous code to
change (eg. removing the bin_size would solve it but this was done for a
reason and could affect performances) and the effect is just visual in a
very particular set of factors (if we save the form after the image is
dead, the previous image reappeared).

opw-765952
closes #19491
2017-09-20 13:36:51 +02:00
Raphael Collet 69161ed69c [FIX] mail: performance, replace filter() by condition in domain 2017-09-20 13:30:56 +02:00
Raphael Collet 49f6a1b544 [FIX] fields: improve performance of many2many fields
An update by a list of commands is now guaranteed to have at most three SQL
queries to update the relation, whatever the number of commands and records.
2017-09-20 13:30:56 +02:00
Raphael Collet 87970ea344 [FIX] mail: add cached method to retrieve message subtypes
This saves queries to retrieve message subtypes for a given model.
2017-09-20 13:30:56 +02:00
Raphael Collet 38193456d4 [FIX] test_performance: log when number of queries is less than expected 2017-09-20 13:30:56 +02:00
Christophe Simonis 30b1b89496 [FIX] odoo shell: P3 compatibility when reading script from stdin 2017-09-20 11:31:21 +02:00
Martin Trigaux 27ca297e64 [FIX] tools: python3 compatibility for export terms
Avoid error in babel getting the wrong source file
TypeError: startswith first arg must be str or a tuple of str, not bytes
2017-09-20 11:15:20 +02:00
Deep Patel 9b9fcfe628 [FIX] web,base: document template widget in settings
Go to General Settings, click on 'Change Document Template', and
in the opened dialog, click on a template.

Before this rev., it automatically closed the dialog, which was
not really convenient.

This rev. introduces a new field widget (image_selection) for
this use case, and ensures that the dialog doesn't close when
a template is selected.

Test written by @mba-odoo
2017-09-20 10:56:57 +02:00
Raphael Collet 3069734d4f [FIX] models: in method onchange, filter out pseudo-fields 2017-09-19 17:06:04 +02:00
Prakash Prajapati 5423efe0a3 [FIX] base: preview invoice pdf template
Go to Settings > General Settings, click on 'Change Document
Template', in the dialog, click on the preview: 'Error: Failed
to load PDF document'.
2017-09-19 13:20:55 +02:00
Christophe Simonis d15a31ae6d [MERGE] forward port branch saas-17 up to 2a343d7c9c 2017-09-19 11:58:01 +02:00
Foram Katharotiya 2b3c8e6ca9 [IMP] l10n_in: GST introduced as new legal requirements.
aka 'Indian localization out of the box'.

Details:
     GST introduced, module refactored.
     Update GST chart of account, tags and SGST, CGST & IGST taxes.
     Replace vat label with GSTIN in reports & views.
     Added HSN Code field and display it on invoice form view & report.
     Added pin number field in res_country_state.
     Show the total amount in words based on Indian numbering system on form view of customer/supplier invoice/refund.
     Arrange address format of India country.
     l10n_in_schedule6: Introduce new GST taxes, chart of accounts & account tags.
     l10n_in_sale, l10n_in_purchase, l10n_in_stock: added modules to add hsn code and replace vat with gstin in sale, purchase & stock reports

Was task: 33241. Was PR #18952
2017-09-18 22:17:43 +02:00
qdp-odoo ec96c0b3c2 [IMP] base: add vat_label on res.country
That allows to display the 'vat' field under the right label in reports.
2017-09-18 21:57:48 +02:00
Stéphane Bidoul (ACSONE) 8bf06adc8d [FIX] namespace packages: move from pkg_resources-style to pkg_util
Deprecates the previous pkg_resources-style packages. Our use was
not entirely spec compliant, and it broke with setuptools 31.
More information in https://github.com/odoo/odoo/pull/15718

Instead, use the pkgutil-style namespace packages.
This is spec compliant as long as all other distributions providing
odoo.addons use PEP 420 namespace packages (i.e. no __init__.py).
So this mechanism fully works on Python 3 only, but does not break
anything on Python 2.

See also:
https://packaging.python.org/guides/packaging-namespace-packages/#pkgutil-style-namespace-packages

Closes #19517
Fixes #15718
2017-09-18 16:05:31 +02:00
Xavier Morel 313f69e948 [ADD] doc: JS document extraction system
* Fix a bunch of ill-documented/incomplete/incorrect method docs
* add start of Sphinx extension to extract & integrate jsdoc into
  Sphinx documentation:

  - parse JS files (and don't blow up), uses a fork of pyjsparser as
    the project currently does not parse comments
  - extract cross-module dependency information
  - parse JsDoc comments using pyjsdoc and infer structure from code &
    jsdoc
  - ``ast`` CLI printing a simplified AST of the input files
  - ``dependencies`` creating a dependency graph of either all modules
    in the provided input files or the modules matching the specified
    filters (warning: will not work if missing dependencies),
    generates a .dot file
  - ``extractor`` generating a plain text module documentation (mix of
    rst and markdown styles, not anything formal)
* sphinx extension with an "automodule" directive taking a module name
  and generating the documentation for it
2017-09-18 11:54:36 +02:00
Odoo Translation Bot f087bb021e [I18N] Update translation terms from Transifex 2017-09-17 07:07:45 +02:00
Odoo Translation Bot c2f2bea6c5 [I18N] Update translation terms from Transifex 2017-09-17 04:40:19 +02:00
Christophe Simonis 8defed9536 [REL] 10.saas~18 2017-09-15 19:06:10 +02:00
Christophe Simonis 66ca687324 [MERGE] forward port branch saas-17 up to ed901bedcb 2017-09-15 18:09:39 +02:00
Yannick Tivisse 51b5ee7c3c [IMP] mass_mailing: choose model among all chatter models
This commit removes the strange selection box based on a magic flag and
some strange methods returning a string. Instead just allow to send mass
mailing on all models inheriting from mail.thread using the is mail
thread flag.

Various addons are updated to remove the _mail_mass_mailing class
attribute used to determine mass mailing capability.

We consider people could send a mass mailing on every model inheriting
from mail.thread. It makes no sense to limit it to a given set of addons.
2017-09-15 15:56:23 +02:00
rde 4ecbacaf59 [ADD] website: add new page management
website.page = old ir.ui.view with page=True
website.redirect is a new mechanism to replace in the futur the ir.attachment
mechanism of redirect.

From now, we don't have a specific /page controller to serve 'page'.

We use a new model website.page which is rendered if none route matches the url
 and that the field 'url' on website.page matches the request.httprequest.path.

The order to serve a path is:
    - Routes defines in controllers (/shop, /blog, ...)
    - ir.attachment with name matching the path
    - website.page with url matching the path
    - website.redirect with url_from matching the path
    - 404

To improve:
    - allow regexp in website.redirect model
    - allow to edit the view_arch from the page.management via redirect backend
      (needed when traceback in the page, or when modifying a js/css/less/...)
2017-09-15 15:29:37 +02:00
stefanorigano fafbc5ebe9 [REF] *: use new kanban record classes/layout 2017-09-15 14:34:18 +02:00
stefanorigano da21b03661 [REF] base, web: adapt base settings to new design
- Use mixins and default LESS variables whenever possible
- Get rid of useless “!important” rules
2017-09-15 13:39:01 +02:00
Mitali Patel 79038055f5 [IMP] base, res.currency: amount_to_text() based on num2words library
Old implementation of tools.amount_to_text() is now deprecated. The new one support more languages

Was task 27215. Was PR #16531
2017-09-15 13:24:02 +02:00
Pierre Masereel b9be8402c3 [FIX] core: handle sql constraint exceptions in python3 2017-09-15 10:18:32 +02:00
Christophe Simonis a63a805efb [FIX] core: python3 compat: do not modify dict during iteration 2017-09-14 19:41:13 +02:00
Christophe Simonis 4bcd444eae [FIX] core: python3 compatibility for migration engine 2017-09-14 14:09:29 +02:00
Mitali Patel 70942e4cfb [IMP] base: improve view rng validation (#17902)
Split big universal RNG into view-specific schemas and moved rng based view validation
into view_validation.py file.
Adapt old views, and remove deprecated tag `version="7.0"` from views.
2017-09-14 10:16:00 +02:00
Simon Lejeune 5b66c17ed2 [FIX] test_main_flows: adapt to rev 8bca882b56 2017-09-13 15:46:43 +02:00
Raphael Collet 886003af93 [FIX] models: in onchange, consider all levels of subfields 2017-09-13 10:12:16 +02:00
Jérome Maes 538e62e53a [IMP] sale_timesheet: product config for service
The purpose is to simplify the product configuration.
Adding detailled options about the service tracking
(create task and/or project) make the setup less
confusing for users.

The invoice policy is replaced by "Invoice based"
(only for services). We don't support "ordered
quantities" with "manual" tracking anymore. The
supported use cases are :
- Ordered quantities (using timesheet)
- Timesheet on task (delivered with timesheet)
- Milestones (delivered manually)

Also, even when selecting 'Milestones', the SO line
can generate a task/project, but timesheeting on
thoses objects will not change the delivered
quantities on the SOL. So, a task can always be created
whatever the service invoice policy of the product.

Every generated task or project are linked to their SO
line. But this SO line is only incremented (on delivered
quantity) if its product 'service_type' is timesheet.
2017-09-13 08:41:30 +02:00
Raphael Collet ed9e3ed699 [IMP] test_performance: run tests as demo user as well 2017-09-12 17:16:24 +02:00
Raphael Collet ee14025c52 [REF] test_performance: improve cache warmup in test methods 2017-09-12 17:16:24 +02:00
Christophe Simonis c5f680200c [MERGE] forward port branch saas-17 up to d08b4407be 2017-09-12 12:09:11 +02:00
Raphael Collet e7205b7992 [FIX] models: _in_cache_without may not return new ids 2017-09-12 09:36:30 +02:00
Christophe Simonis fdc4ef97c9 [FIX] core: only check table existance in public schema
This allow the use of tables defined in other schemas, like `domains`,
already defined in `information_schema`.

See #16651
2017-09-11 14:55:49 +02:00
Christophe Simonis bd08d4f052 [MERGE] forward port branch saas-16 up to 3ac2a1106c 2017-09-11 14:02:19 +02:00