summaryrefslogtreecommitdiff
path: root/odoo/tools
AgeCommit message (Collapse)Author
2019-04-05[MERGE] forward port branch saas-12.2 up to f2be461f090Christophe Simonis
2019-04-05[MERGE] forward port branch saas-12.1 up to f2d0995362cChristophe Simonis
2019-04-04[MERGE] forward port branch 12.0 up to 251021796c2Christophe Simonis
2019-04-03[FIX] tools: February 28thNicolas Martinelli
- Set your fiscal year end date to 28th February - Run the P&L a year before a leap year, e.g. anytime between March 1st and December 31st 2019. - Select 'Last Financial Year' The dates are set from 2019-03-01 to 2019-02-28. There are actually 2 bugs. The one solved here is the following inconsistency: ``` current_date = type(date)(2019, 4, 3) date_utils.get_fiscal_year(current_date, day=28, month=2) 'date_from': datetime.date(2019, 3, 1), 'date_to': datetime.date(2020, 2, 28) current_date = type(date)(2020, 2, 28) date_utils.get_fiscal_year(current_date, day=28, month=2) {'date_from': datetime.date(2019, 3, 1), 'date_to': datetime.date(2020, 2, 29)} ``` Both should return `'date_to': datetime.date(2020, 2, 29)`. This implies that the period is recognized as `custom`, which is affected by the bug solved in PR https://github.com/odoo/enterprise/pull/4006 opw-1949628 closes odoo/odoo#32366 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-29[MERGE] forward port branch saas-12.1 up to c0cf4049b2aChristophe Simonis
2019-03-29[MERGE] forward port branch 12.0 up to 09fb2469b49Christophe Simonis
2019-04-02[IMP] web,base: put buttons in list group headersMartin Geubelle
It is now possible to put buttons in the list view group headers. When the view is grouped by a many2one field, those buttons appear next to the header title when the group is opened. The buttons are specified in the views in a <groupby> tag in the list arch, with the following structure: <groupby name="groupedField"> <!-- must be a many2one --> <button type="object" name="my_method" string="Button1"/> </groupby> It is also possible to add `field`, inside the `groupby` which can be used for modifiers. These fields thus belong on the many2one comodel, like: <groupby name="partner_id"> <field name="name"/> <!-- name of partner_id --> <button type="object" name="my_method" string="Button1" attrs="{'invisible': [('name', '=', 'Georges')]}"/> </groupby> These extra fields are fetched in batch when grouping on the field. Part of task 1915702
2019-03-29[FIX] tools: extract module from po fileMartin Trigaux
When a single po file is processed (i.e. direct po import, not read from a i18n directory inside a module), there was no module information on code translations The module information is important for web translations where the list of modules is given in the call to the route '/website/translations' and '/web/webclient/translations' and only the web translations of these specific modules is retrieved and used. To manually import the translations of a custom module (e.g. openerp_enterprise), the base.language.import wizard is typically used and the give .po file is directly imported. For model and model_terms, the module information is easily deducted from the the record external id (<module>.<reference>) but for code translation, we relied on the global variable module_name. The .po file do contain the module information but this information was ignored. Real example: #. module: openerp_enterprise #. openerp-web #: code:addons/openerp_enterprise/static/src/js/odoo_enterprise_start_trial.js:249 #, python-format msgid "Please choose your domain name" msgstr "Veuillez choisir votre nom de domaine" Before this commit, the above translation was imported without the module and was not retrieved in the '/website/translations' call on the /trial page The global module_name is still used when set for backward compatibility. Co-authored-by: Raphael Collet <rco@odoo.com>
2019-03-26[MERGE] forward port branch saas-12.1 up to f00c490be86Christophe Simonis
2019-03-25[MERGE] forward port branch 12.0 up to 11b1e12cde3Christophe Simonis
2019-03-21[FIX] base: ignore empty translatable attributeMartin Trigaux
Complete cd4080839f501ad01bd <span class="fa fa-globe" title="Title stuff"/> is not correctly extracted but <span class="fa fa-globe" title=""/> was also extracted while there is no content Check the size of the content too Similar content is present on odoo.com website and should not be translatable on Transifex closes odoo/odoo#32018 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-01[MERGE] forward port branch saas-12.2 up to 18c735361a6Christophe Simonis
2019-03-28[IMP] mail, test_mail, *: add new email.cc.mixin on main modelsXavierDo
*: crm, project, maintenance, hr_recruitment When a record is created from an email, cc can be lost. This commit proposes a new mixin to keep cc on the record and allows to create partner for each of them when sending a message from the chatter. The mixin is added on the mail recors that can be created from mail.alias: document helpdesk.ticket mrp.eco quality.alert hr.applicant crm.lead project.task mail.channel maintenance.equipment Task: 1925001
2019-03-27[MERGE] forward port branch saas-12.2 up to 7c1a9a8204fChristophe Simonis
2019-03-22[FIX] convert: enable kwargs in tag <function>Raphael Collet
closes odoo/odoo#31417 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-02-14[IMP] tools,base,web: improve image toolsSébastien Theys
Add support for a 256*256 image, to be used in the following commit. Define sizes in named variables instead of being hard-coded in several places in the code. Allow parameters `preserve_aspect_ratio` and `upper_limit` to be passed from the different helper methods. Factorize the code inside `image_resize_images` to make it easier to read. Add new function to compute whether the size of an image is above a given size. task-34045 PR: #30656
2019-02-13[IMP] tools: float_utils, precision rounding must be positiveJorge Pinna Puissant
Adding a new rule to verify that precision_rounding is positive. Before this commit: when a precision_round was 0 or smaller than 0 the float_utils functions gave as results: * float_is_zero(0.0, precision_rounding=0.0) -> False * float_round(1.25, precision_rounding=0.0) -> 0.0 * float_compare(1.0, 1.0, precision_rounding=0.0) -> 1 These results where at least not correct at worst not logic. Now, the function raises an error when the precision_rounding is not positive
2019-02-11[MERGE] forward port branch saas-12.1 up to 93d736e905eChristophe Simonis
2019-02-28[FIX] tools: correct typoNaglis Jonaitis
closes odoo/odoo#31002
2019-02-04[FIX] base: fixes http redirectionThanh Dodeur
The 7d85ab1eac6dbf33d56c6a1f8bf7e9e12bb8008e refactor of 'ir.http' introduced changes in `web/image` that caused the route to no longer return early (to avoid data processing steps) in the case of redirection and that caused `binary_content` to not set the mimetype of the `ir.attachment` when it was an URL. This commit fixes those issues, allowing `web/image` to redirect properly. closes odoo/odoo#30777
2019-02-07[FIX] core: remove email escape logic from html_sanitize.XavierDo
Related to #30326 Before #30326, when calling html_sanitize, some content may be escaped when it shouldn't. A simple example was images with cid links containing @. (a first fix for another use case was made in 8aff53733b6ca1dd6f8074834ada1baaab3910d5) We suspect that this escaping (added in 71a92f46e4e223a3bad0e27ececa2ece3c09f5d1) was made to avoid loosing email with format '<email@domaine>' in html_sanitize to escape them if html_sanitize is called on plain text. Anyway, only html should be passed to html_sanitize, and therefore email of format <email@domain> should already be escaped. PR #30326 fixes the unwanted behaviour in 12.0 and this commit removes this logic in master. closes odoo/odoo#30815
2019-01-31[MERGE] forward port branch 12.0 up to cb8fefa8999Christophe Simonis
2019-02-04[MERGE] forward port branch saas-12.1 up to 4524ad06a8aChristophe Simonis
2019-01-17[FIX] base: avoid to escape image when src contains @XavierDo
The content id of an attachement can contains a @, therefore image contained in emails where sometimes escaped by html_sanitize as if they were emails adresses. Task: 1915251 closes odoo/odoo#30326
2019-01-23[FIX] tools: fix typo in help messageYannick Vaucher
for --db_maxconn option closes odoo/odoo#30433
2019-01-09[FIX] translate.py: really generate missing termsNicolas Lempereur
With 12.0's (#28297) empty translations were no longer added by default with the idea that if needed the "Generate Missing Terms" wizard should be used. But that wizard itself used what was modified so also did not added empty translation. With this changeset, empty translations are added when using the "Generate Missing Terms" wizard. fixes #29184 closes #30037
2019-01-08[MERGE] forward port branch saas-11.3 up to 2d824a5b7adChristophe Simonis
2019-01-08[MERGE] forward port branch 11.0 up to c07b7200b26Christophe Simonis
2019-01-03[FIX] tools: properly verify the size of HTML nodesMartin Trigaux
Instead of checking the size of text only node, let the xml_translate verify it. The size verification using etree was introduced at 40efdccc3d1e1f070c9 but was probably too simple. Since 45352512a842, this becomes redundant with the nonspace method which can be extended. The re.sub is still relevant as some terms may contain only non-alphanumeric and use push_translation (e.g. '>=' as a selection or xml terms extracted by babel in static repository) closes odoo/odoo#29432
2019-01-03[FIX] translate: inline elements with translatable attributes onlyRaphael Collet
2018-12-31[FIX] tools: value_label attribute translatablesJulien (juc) Castiaux
A newly intoduced xml attribute by @svs-odoo was not translatable. Related PR on enterprise: odoo/enterprise#3252 opw-1908220 closes odoo/odoo#29386
2019-01-03[FIX] tools/date_utils: Fix get_fiscal_year with leap yearsLaurent Smet
Suppose calling get_fiscal_year(date, day=29, month=2) with date(year=2017, month=2, day=28) The computation steps are: date_from = date(year=2017, month=2, day=28) - 1 year = date(year=2016, month=2, day=28) date_from = date_from + 1 day = date(year=2016, month=2, day=29) It's incorrect because the value of date_from must be date(year=2016, month=3, day=1) closes odoo/odoo#29416
2019-01-14[MERGE] forward port branch 12.0 up to 6a0675d36ddChristophe Simonis
2019-01-09[MERGE] forward port branch 12.0 up to 3e4138deaa2Christophe Simonis
closes odoo/odoo#30045
2018-12-06[REF] base, *: refactor binary_contentThanhDodeurOdoo
*: tools, web, website, website_forum, mail, im_livechat This commit refactors ir_http to make it more readable and flexible. Move the resize function of web/image to odoo.tools Co-authored-by: XavierDo <xdo@odoo.com> Co-authored-by: Antony Lesuisse <al@openerp.com> closes: #28563 task: #1908896
2018-11-22[MERGE] forward port branch 11.0 up to 263b388c504Christophe Simonis
2018-11-21[FIX] cache: ormcache loggerRaphael Collet
The adaptation to Python 3 was done with two mistakes: the iteration on the lru cache does not return keys, and functions are not sortable. closes odoo/odoo#28870
2018-11-29[FIX] core: fixup of convert cleanupXavier Morel
_tag_delete was not properly converted when the _tag_ calling convention was modified in 4d581e26c2c30a53c41fcdc89d42c79e9ba1ef2f, so <delete> tags would all blow up if encountered. closes odoo/odoo#29149
2018-11-29[REM] pycompat: remove python 2 shims and helpersAdrian Torres
Odoo no longer supports python 2, thus some of these helpers can and have been replaced by python 3 built-ins, therefore there is no need for them to stay defined. The removed helpers are: * izip, imap and ifilter * unichr, text_type * implements_to_string, implements_iterator * string_types, integer_types * to_native The python 2 shims have also been removed, and only the python 3 helpers have been kept, because they can still be usable (i.e. accepting both bytes and str for functions that can only accept one of the two) [REM] pyjsparser: remove PY3 shims They're no longer necessary as Odoo doesn't officially support python 2 anymore. closes odoo/odoo#28519
2018-11-29[REF] *: replace deprecated pycompat helpers for builtinsAdrian Torres
This commit replaces calls to pycompat helpers that were intended for python 2 <-> python 3 interoperability for python 3 builtins, as python 2 is no longer officially supported by Odoo. This includes: * calls to imap/izip/ifilter replaced by map/zip/filter * uses of text_type replaced by str * uses of unichr replaced by chr * calls to implements_to_string, implements_iterator removed * string_types and integer_types replaced by str, int respectively * calls to to_native replaced by calls to to_text This is done in preparation to the removal of these deprecated helpers in the following commit.
2018-11-23[MERGE] forward port branch 12.0 up to b3052b690faChristophe Simonis
2018-11-22[MERGE] forward port branch saas-11.3 up to b09f624f207Christophe Simonis
2018-11-20[IMP] tools, mail : adds email normalization method in mail toolsDavid Beguin
In order to normalize email independently from the mail.address.mixin model.
2019-01-28[MERGE] forward port branch saas-12.1 up to d3b8422c9c4Christophe Simonis
closes odoo/odoo#30614
2018-11-27[REM] builtin logrotate featuresXavier Morel
It's completely FUBAR when using workers[0] and properly reimplementing it is not really worth the effort when logrotate(8) and newsyslog(8) exist (or cyclog/multilog/cronolog if you subscribe to the "logrotate and newsyslog are a design that should be consigned to history" school of thought). [0] https://stackoverflow.com/questions/34186774/why-doesnt-timedrotatingfilehandler-work-properly-and-how-to-solve-this-issuer closes odoo/odoo#29073
2018-11-12[MERGE] forward port branch 12.0 up to a403155dec7Christophe Simonis
2018-11-07[FIX] translate.py: fallback on base lang if notermNicolas Lempereur
When there is a language and its base language translation files in a module, in 12.0 an empty translation in the language translation file will not fallback on the base language. eg. fr.po : {'one': 'un', 'seventy': 'soixante-dix'} fr_BE.po: {'one': '', 'seventy': 'septante'} => the translation in fr_BE will be {'one': '', 'seventy': 'septante'} but before 7288b477 it would have been {'one': 'un', 'seventy': 'septante'} With this commit, an empty translation is no longer created so does not override base language. Also the intention of d84b795b0a6 that was also lost is restored by upserting only noupdate==false translation, and inserting the other ones. opw-1904638 closes #28297
2018-10-22[MERGE] forward port branch saas-11.4 up to 3c108977c1eChristophe Simonis
2018-10-21[FIX] models: restore warning on wrong recordMartin Trigaux
Was lost during d5b687a48ffb Set the module name in the context to be able to detect errors in xml and csv import closes odoo/odoo#27680
2018-10-19[FIX] core: early fail on missing foreign recordsChristophe Simonis
When installing/updating a module, verify existence of foreign records before updating them. Also handle forcecreate=False records. Also fix misprefixed XML id in sale_quotation_builder. closes odoo/odoo#27659