Daily updates from Odoo
Thursday, October 17, 2019
3 changes · master
Enhancements to existing features
This change separates timesheets from project-only work so employees can record time more flexibly, including against analytic accounts. It also reorganizes how timesheet billing connects to sales and projects, laying groundwork for future time-selling features without changing the current user experience.
Original PR description
https://www.odoo.com/web?debug#id=1923949&action=333&active_id=965&model=project.task&view_type=form&menu_id=4720
Users configuring file upload fields can now restrict the types of files that appear in the upload picker, such as images, PDFs, or specific extensions. This improves data quality and reduces accidental selection of unsupported files across attachment, image, and PDF-related widgets.
Original PR description
Purpose ======= We want to add an option on the widgets - many2many_binary, - binary, - image This option specifies what file extensions the user can pick from the file input dialog box. Examples…
Purpose
=======
We want to add an option on the widgets
- many2many_binary,
- binary,
- image
This option specifies what file extensions the user can pick from the file input dialog box.
Examples
========
```xml
<field widget="many2many_binary" options="{'accepted_file_extensions': 'image/*'}"/>
<field widget="many2many_binary" options="{'accepted_file_extensions': '.png,.jpeg'}"/>
<field widget="many2many_binary" options="{'accepted_file_extensions': 'application/pdf'}"/>
<field widget="image" options="{'accepted_file_extensions': '.png,.jpeg'}"/>
<field widget="image"/> <!-- default value is "image/*" -->
<field widget="binary" options="{'accepted_file_extensions': '.pdf,.svg'}"/>
```
How
===
Add an option (accepted_file_extensions) in the template ``HiddenInputFile`` (the widget many2many_binary is using this template)
So, we can also use this new option in others widgets using ``HiddenInputFile``
In the many2many_binary, read the ``nodeOptions`` and set the widget attribute ``accepted_file_extensions``
We also have to fix some other widget, because an property ``image_only`` was already existing in the template ``HiddenInputFile``
(we just need to replace ``image_only=True`` to ``accepted_file_extensions='image/*'``
The widget ``FieldPdfViewer`` (pdf_viewer) now use the new option to filtrate PDF
(instead of removing the <input/> and adding <input accept='.pdf'/>).
Tests
=====
We also test if the option is correctly set on the <input/>
- binary
- image
- many2many_binary
Impacted widgets
===============
- many2many_binary
- image: this widget use ``options="{accepted_file_extensions='image/*'}"`` instead of ``image_only=True``
- tablet_image: same as ``image``
Task #2082815Resolved issues and error corrections
The Chinese small business accounting setup is updated to better match the 2017 accounting standards for small and medium-sized enterprises. This improves compliance and makes account names available in translation files for clearer use in localized environments.
Original PR description
…es COA Steps to reproduce the bug: - Modify some account according to 'Accounting Standards for 2017 Small and Medium-sized Enterprises' - Add account translation into .po file Signed-off-by: Colinliz <lizheng02@inspur.com> Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr