Commit Graph
107 Commits
Author SHA1 Message Date
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
oco-odoo 78a8e0a98e [FIX] l10n_fr_fec: alleviate memory error when exporting too many move lines
We now split the export of the FEC files per batch of move lines. This was necessary, as the fetchall() ran on the cursor to get the results could return a huge amount of data on big databases, saturating the RAM.

This fix is not exhaustive, and memory consumption could be lowered by removing the need to convert the whole file to base 64 and write it in attachment. Those changes are not doable in stable ; further improvements will come to master.

OPW 3442579

closes odoo/odoo#130884

X-original-commit: 86a221fa3773b5b23ae8f1ad653c1aaac607482e
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-08-04 16:35:05 +02:00
Nshimiyimana Séna 4393a03f4f [FIX] l10n_fr_fec: unlock UI after exporting FEC
Summary
-------
Currently, if you try to export FEC, download will work correctly, but
the UI will stay locked.

Steps to reproduce
------------------
* install l10n_fr_fec
* Accounting / Reporting / France FEC
* input a start/end date (ex: 01/01/2022 to 12/31/2022)
* click Generate
 => Report exports immediately, but the UI stays locked.

Cause
-----
This issue is caused by commit d291ef80b726c11486efe6e42d9dcf4968efa518
The intent is to make it so that if an `act_url` action with target
"self" is expected to reload the page, then the UI is blocked and
remains so, expecting the page reload to naturally unblock it. We
rely on the `beforeunload` event as a signal that the page is likely to
reload, usually followed by the `unload` event (actual reloading of the
page).
However, things are different when the new URL points to a file
download. Here, `beforeunload` is triggered, but not `unload`. As a
result, the `env.services.ui.unblock()` function isn't called, and since
the page doesn't reload, the UI stays blocked even after the download
starts.

opw-3344777

closes odoo/odoo#129918

X-original-commit: 23744ba3f992203e36dac59acfc905b018758e25
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-07-27 20:32:36 +02:00
william-andre 0479b2b594 [IMP] account,*: manage subsidiary companies
Allow sharing records between company
* accounts
* taxes
* fiscal positions
* products
* ...and some related models

These records can be read and used in children companies.

This can be used to
* have different branding for different businesses
* allow more complex security rules
* consolidate branches differently
* manage different tax reports with different tax ids in the same
  country

task-3371677

closes odoo/odoo#125642

Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-07-20 11:49:06 +02:00
Julien Carion (juca) 6c412be2ea [IMP] *: coherent hotkey uses
This commit makes hotkey uses more coherent throughout the entire
codebase by setting alt+q as main shortcurt for confirm and default
actions and alt+x for cancel actions.

task-3370463

closes odoo/odoo#127469

Related: odoo/enterprise#43694
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-19 18:24:15 +02:00
jbw-odoo d050b8e8a0 [FIX] l10n_fr_fec: allow exclusion of journals in FEC export
In French accounting, they need to provide a FEC file to the auditors/tax authority to control their accounting. So far it's fine in Odoo.
While a company is managing IFRS accounting, the usual way to do it in Odoo is to use a specific journal "IFRS adjustments" for example. This way of working allows you to have a balance in local GAAP (excluding IFRS entries) and in IFRS GAAP (including the IFRS entries).  So far it's fine in Odoo.
The issue that we met is once a customer need to send his FEC file to the auditors/tax authority, he needs to send only local entries (then excluding IFRS entries). Therefore, it would be great to have an option to exclude some journals from the FEC export.

closes odoo/odoo#110655

Task: 3133678
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-02-09 18:07:12 +01:00
Florian Vranckxandxmo-odoo 7dc2190fa4 [IMP] test_lint, * : SQL injection detection
This commit brings a new way to detect sql injection.

Previously, this test was meant to push developers to use the second argument of cr.execute(query,args) for parameters.

However, this also meant that the test will always be green as soon as the second argument is used.

This commit aims to change that by tracking the source of information of all variables used to build a query. Parsing of the AST in reverse, starting from the query variable itself.

However these are some current limitations:
  -The hierarchy of Odoo modules is currently not taken into account. If two functions have the same name, they will both be evaluated to find if their return value is part of the query
  -Object mutation is not supported and is not evaluated
  -Whitelisted values are too wide in order to reduce the amount of false positives.

Even if this test is blocking, it can be disabled by adding #pylint: disable=sql-injection at the end of the line.

closes odoo/odoo#101237

Related: odoo/enterprise#35697
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Co-authored-by: xmo-odoo <xmo@odoo.com>
2023-01-26 14:19:00 +01:00
aliya 6278eaeb32 [FIX] l10n_fr_fec: fix unaffected earnings account check
Before account types refactoring, fec wizard would check whether company has accounts for unaffected earnings and only call `_do_query_unaffected_earnings` in that case. Now it would always call it.
This commit adds a check for `equity_unaffected` accounts back

closes odoo/odoo#110408

X-original-commit: f9bdc589450514c3e240efb2297ded1f1a4c5879
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-01-19 17:49:11 +01:00
Florent de Labarre 29d4179c71 [FIX] l10_fr_fec : multicompany error when fetching unaffected earnings account
- create a company A
- create a company B with French accounting
- Select A and B in the company selector, with B being the active company
At export, the A's unaffected earnings account can be used instead of B's.

closes odoo/odoo#109421

X-original-commit: 17a7390ad8cd0b09ccad609febc9ccb0bea1aa3a
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-01-09 14:24:26 +01:00
Julien Alardot (jual) ef6e3b668d [FIX] l10n_fr_fec: Fix missing colspan
Since the recent css change the text of the description field was no taking all the place he could, so it was impossible to read, thanks to the colspan it's now the way it was intended

closes odoo/odoo#108714

Task: task-3103640
X-original-commit: b35485ddbb0567ff129e9da863a29bdc66df34eb
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2022-12-27 13:18:10 +01:00
Chong Wang (cwg) f8c2b02abe [FIX] *: adapt code to jsonb translations
Website: the context install_filename='dummy' is used to prevent
arch_updated from becoming True while updating translations of
ir_ui_view.arch_db (if arch_update becomes True, test_inherit_specific
fails)

Fuzzy search for jsonb translated fields has been adapted in the case of
website.  It may require some refactoring later.
2022-09-15 22:37:50 +02:00
aliya 26b2472f49 [IMP] account: refactor account types
Task: 2856281

- Remove user_type_id, account.account.type model, internal_type
- Add account_type that is a simple selection field
- Move internal_group and include_initial_balance to account.account
- Because of these changes, type_control_ids on account.journal is also removed

closes odoo/odoo#93212

Related: odoo/documentation#2223
Related: odoo/upgrade#3595
Related: odoo/enterprise#28205
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
2022-07-08 19:52:15 +02:00
Andrea Grazioso (agr-odoo) 64106ba7c7 [FIX] l10n_fr_fec: use invoice/bill date when generating FEC
Install FR accounting and have a FR company setup with VAT
Create a bill with bill date different from accounting date
Export FEC under Accounting>Reporting>FEC

For the created bill the accounting date will be used, while it should
be taken first the bill date

opw-2680288

closes odoo/odoo#88319

X-original-commit: 2b1fc6a9b48e423e8f299ebeb723c95302aa13ea
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2022-04-08 18:31:41 +02:00
Nicolas (vin) d9ee3a019e [FIX] l10n_fr_fec: allows exporting FEC without TVA number.
Not all company needs a French TVA number but still needs to provide
FEC file.
Improve that by making the TVA number optional, allowing to export the
FEC file without it. The only difference is that in such case, the vat
number won't be appended to the file name.

Task id #2801629

closes odoo/odoo#87620

X-original-commit: 59937bbea86a9d01bb7038f7e307fd88fbb82976
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-03-31 07:55:40 +02:00
jbw 0f4cc6dcce [IMP] account_fr_fec: fix SQL Memory error when FEC too big
Set fec_data to attachment True to avoid storing data in DB and generating memory alloc errors.

closes odoo/odoo#83620

Task: 2453453
X-original-commit: e2d4a6bd03361188f7454015574896b52aa797ef
Signed-off-by: William André (wan) <wan@odoo.com>
2022-01-28 18:58:47 +00:00
Julien Van Roy 9f12a39396 [FIX] l10n_fr_fec: prevent error for non-french vat
As the FEC can be downloaded by non-french companies, the length of a given vat number might be different than the french's vat.
Currently, if the vat length was lower than 13, it raised an error.

For french companies -> include the SIREN in the name of the FEC file (legal requirement)
For non french companies -> include the complete vat number in the FEC file

closes odoo/odoo#83054

X-original-commit: c3c05bf073a521a662d83c3382e77cb25c59bc3c
Signed-off-by: Laurent Smet <las@odoo.com>
2022-01-20 09:11:01 +00:00
Julien Van Roy 4e18c501b8 [FIX] l10n_fr_fec: solve some issues with the french FEC
This commit:

1. Allows exporting the FEC without any VAT number. Indeed, a company can have to submit its FEC without being submitted to VAT regulation.

2. Allows non french companies to export FEC file.

3. The FEC now includes the journal items == 0 and/or journal entries which total is 0.
Initially, french tax administration rejected the journal items which balance is 0.
But after several requests from tax payers, they agreed because they prefer continuous sequences and some tax payers post entries which total amount is 0.

task-2717676

closes odoo/odoo#82456

X-original-commit: e6206b03ba245ece3d8f765644d71f2d2008398d
Signed-off-by: Laurent Smet <las@odoo.com>
2022-01-11 08:36:38 +00:00
Xavier Morel a6c29c44f4 [IMP] l10n_fr_fec: fix report 2020-12-15 11:31:34 +01:00
Paolo (pgi) c6c41f359e [FIX] l10n_fr_fec: Cleanup spaces in FEC export
The fields of the FEC export must be sanitized.
All tabs, carriage returns and newlines must be excised.

Ticket link: https://www.odoo.com/web#id=2672261&model=project.task

opw-2672261

closes odoo/odoo#80366

X-original-commit: 5869376a95ea2d500bda687ec944354171988a79
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2021-11-25 09:14:13 +00:00
alt-odoo 404ec3d44d [FIX] l10n_fr_fec: correct translation of journal name in FEC export
Before this commit, when exporting the FEC report, we were using the account journal
name in the initial language set. As it could be confusing for the French administration
to see names in a foreign language, we should use the user language instead to allow the
export of FEC report in French even if another default language was used.

closes odoo/odoo#79908

X-original-commit: 8ba4b76017a92c63e369877f30583485bedbd57a
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
2021-11-17 08:26:28 +00:00
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
Define `data-hotkey` on most used action buttons.

For the modals, the following keys are dedicated for "special"
actions:
 - Alt+G: add
 - Alt+V: save
 - Alt+Z: cancel

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
oco-odoo 17610e8ca9 [IMP] account, account_edi, l10n_*, purchase, sale: Generalize the use of account_fiscal_country_id
Before, account_fiscal_country_id was only use for tax operations; and country_id was used for all the other accounting stuff. Now, with the new ability to use foreign tax reports (with foreign VAT fiscal positions), we can generalize the fiscal country, sot that it is the one that needs to be used for the whole accounting. Since foreign tax reports were not supported before, account_fiscal_country_id is already set on existing database as the country for the "main" accounting, so the impact of this change is small.

closes odoo/odoo#68349

Related: odoo/upgrade#2322
Related: odoo/enterprise#17299
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-04-01 12:09:20 +00:00
wan bb04c655e1 [FIX] l10n_fr_fec: follow CompAuxNum for CompAuxLib
Thos two fields shoulb be the same, following
https://github.com/odoo/odoo/pull/43985

closes odoo/odoo#62788

X-original-commit: 902dbd1fe1bf50d7c3e00c8f9c6405f76d139daf
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-12-03 09:28:51 +00:00
Florian Gilbert 2c926abcb3 [IMP] l10n_fr_fec: Set lock date when user ask for official FEC file.
Add the possibility to download a test FEC file.
Set the fiscal year lock date when the user ask an official FEC file.
Add some basic checks.

Task ID: 2297407

closes odoo/odoo#55311

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2020-08-07 07:00:48 +00:00
Jeremy Kersten 76b2de42f4 [FIX] *: handle null value for boolean in sql queries
It has always been a best effort until the v13 to have false as default value
for boolean field.
Until v13: https://github.com/odoo/odoo/blob/12.0/odoo/models.py#L3645

During ORM refactoring in v13 it has been replaced by a default value in sql
From v13: https://github.com/odoo/odoo/blob/13.0/odoo/tools/sql.py#L79

But with a typo since columntype for boolean is bool and not boolean.
What's mean that in v13 we have a lot of null value for boolean (~=False)

In all cases, we try to be aware and check Falsy boolean with 'null or False'
(https://github.com/odoo/odoo/blob/13.0/odoo/osv/expression.py#L1230)

So we should do the same when we write pure sql in method bypassing the ORM.

closes odoo/odoo#53391

closes odoo/odoo#54458

Related: odoo/enterprise#11319
Related: odoo/enterprise#11838
X-original-commit: 118c9f6aafd423f415b2bbfcf8a9cfcd676d9b92
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-07-14 15:52:59 +00:00
Martin Trigaux ba244cef01 [IMP] *: replace to new _() syntax
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))

Old syntax is still compatible but starts the migration to the new
syntax that catches error.
2020-06-18 13:03:34 +02:00
wan 7efff597e5 [FIX] l10n_fr_fec: CompAuxNum changes
opw-2122776
* CompAuxNum should be the code of the account concatenated with the id
of the client
* It should be popuated only if it is a receivable/payable

The problem is the export of the partner ID in the column G
"CompAuxNum". We only export the ID of the linked customer/vendor. When
they import the FEC into their software to make tax declarations and
annual accounts. The system will notice if an account is filled in in
the column G and will override the account in column E with the ID of
the partner. As the ID is not a real account, they cannot use the FEC to
import correctly.

closes odoo/odoo#44297

X-original-commit: 955eec233f2a3129dfddca06ad43a426b3cd4061
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-01-30 12:34:06 +00:00
Yenthe666 7876af3ad0 [IMP] *: set name on page elements
page is an element that is often used for xpath

closes odoo/odoo#41718

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-16 15:10:24 +00:00
Julien Castiaux 4f03a5f136 [FIX] *: remove old deprecated modules/functions
PEP-594 is deprecating a bunch of modules. As part of the cleanup, we
are also dealing with long deprecated modules, functions and aliases.

* `assert_` -> `assertTrue`
* `assertEquals` -> `assertEqual`
* `assertNotEquals` -> `assertNotEqual`
* `assertAlmostEquals` -> `assertAlmostEqual`
* `assertRaisesRegexp` -> `assertRaisesRegex`
* `assertRegexpMatches` -> `assertRegex`
* `base64.encodestring` -> `base64.encodebytes`
* `base64.decodestring` -> `base64.decodebytes`
* `inspect.getargspec` -> `inspect.signature`
* `inspect.formatargspec` -> `inspect.signature`
* `logging.warn` -> `logging.warning`

closes odoo/odoo#36863

Task: 2003936
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-17 11:36:42 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Martin Trigaux 1f5a4649a6 [MERGE] Forward port of saas-12.3 to saas-12.4 up to 87fc1554d6
closes odoo/odoo#34820

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-12 13:59:35 +00:00
Christophe Simonis 5e81b18e24 [MERGE] forward port branch saas-12.3 up to 0247d2f35f 2019-06-27 20:45:52 +02:00
Christophe Simonis 465909f0fd [MERGE] forward port branch 12.0 up to cd21c016b0 2019-06-27 18:01:07 +02:00
Christophe Simonis cd21c016b0 [MERGE] forward port branch saas-11.3 up to 2f2bc67c06 2019-06-27 17:24:24 +02:00
Christophe Simonis 039e6bae99 [MERGE] forward port branch 12.0 up to 9c742d0c65 2019-07-05 11:13:53 +02:00
Christophe Simonis 7b74f4ca9a [MERGE] forward port branch saas-11.3 up to 1debaa89f1 2019-07-04 18:57:17 +02:00
Christophe Simonis 2c81916f5d [MERGE] forward port branch saas-15 up to aaaf32fedd 2019-07-04 11:39:07 +02:00
Christophe Simonis 565165a6c8 [MERGE] forward port branch 10.0 up to acbdd526e6 2019-07-03 18:32:16 +02:00
jev-odoo acbdd526e6 [FIX]l10n_fr_fec: better remove new line
Fix/improve commit d870749d79
that was removing line feed (\n).

In this one, we also remove carriage return (\r)
to address all cases.

closes odoo/odoo#34536

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-03 07:40:43 +00:00
Christophe Simonis 1985a49b92 [MERGE] forward port branch 10.0 up to 5eb15c01b5 2019-06-27 12:41:15 +02:00
Nicolas Martinelli d870749d79 [FIX] l10n_fr_fec: remove new line
- Make a SO with a product that have a carriage return in its
description
- Export FEC report

The CSV contains new lines and is not correctly formatted.

opw-2026861

closes odoo/odoo#34385

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-26 11:45:57 +00:00
Nicolas Martinelli da986aa479 [FIX] l10n_fr_fec: backport fixes
Backport of:

a3519638a3
fe9e7d47b8

opw-2026861
2019-06-26 11:41:41 +00:00
Nicolas Martinelli 98a590b359 [FIX] l10n_fr_fec: remove new line
- Make a SO with a product that have a carriage return in its
description
- Export FEC report

The CSV contains new lines and is not correctly formatted. This is due
to c712231745.

opw-2026861

closes odoo/odoo#34386

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-26 12:54:28 +00:00
Nicolas Martinelli aad824067c [FIX] l10n_fr_fec: wrong forwart-port
Incorrect forward-port of commit cd26eb8e7c

opw-2026861
2019-06-26 12:53:20 +00:00
Christophe Simonis 71a50a2214 [MERGE] forward port branch saas-12.3 up to 409679866b 2019-06-06 11:54:35 +02:00
Christophe Simonis cfe0523714 [MERGE] forward port branch 12.0 up to 8f21148e1a 2019-05-31 14:37:38 +02:00
Yannick Tivisse f5dfe4727c [IMP] api.py: Rename company_id/company_ids into company/companies
The goal is to be coherent with the user property.

Actually, company_id and company_ids on the environment are no fields.

Calling env.company_id returns a browse record, not an id.
2019-05-29 08:09:15 +00:00
Christophe Simonis 8d7ee39213 [MERGE] forward port branch saas-11.3 up to 8a0e819d0b 2019-05-29 14:06:12 +02:00
Nicolas Martinelli d0cd05a670 [FIX] l10n_fr_fec: new line
Commit 5dfb6e39af added the new line
characters at the end of each line but the last one.

However, it does so by adding a new element in the row: therefore, 19
columns are created instead of the 18 required.

We add the new line character at the end of the last element of the row.

opw-2000429

closes odoo/odoo#33571

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-22 13:02:55 +00:00
Nicolas Martinelli a3519638a3 [FIX] l10n_fr_fec: EcritureLib
Make sure `EcritureLib` is always filled in if the AML name is an empty string.

opw-2000429
2019-05-22 13:02:55 +00:00