Commit Graph
74 Commits
Author SHA1 Message Date
baa 3ea12e93d6 [IMP] account: auto-load invoices modules for KSA
closes odoo/odoo#79817

X-original-commit: 32f653327bd92688190475ce6aeacd17c3eba555
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-11-16 10:49:28 +00:00
Benjamin Frantzen (bfr) 3416c596d9 [IMP] account: auto_install l10n_it_edi_sdicoop if main company is Italian
Task ID: 2613031

closes odoo/odoo#74508

X-original-commit: a7a4552b6cd9d1992d854c7f79e12ea172f98d81
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-07-30 15:06:19 +00:00
wan d31c5c70e0 [IMP] account: make demo data for all localization
Task 2124952

Extract all the demo data from `l10n_generic_coa` to a new way of
generating the demo data for accounting modules.
Because the data needs to be created multiple times, and right after the
chart template instanciation, it cannot be done the usual way. Instead,
we use python generators to declare the data. It allows us to reference
data that was not created yet at the start of the creation of the demo.
An xml_id is given, prefixed with the id of the company it is created
for (just like the instanciation of the chart template)

To find the correct accounts, a helper method has been added to
`account.account`. It will look for an account with the correct xml_id
(which is the one of the l10n_generic_coa, that we have to put on the
other l10n modules too, in the future). If it didn't find the xml_id, it
will look for an account with the correct type. If it still didn't find
one, just take any account.
2021-02-17 08:39:28 +00:00
william 05dd0f6460 [IMP] account: populate
Task 2230635
Add _populate implementation for:
* Bank Statements
* Journals
* Journal Entries / Invoices
* Payments
* Reconcile Models

Load a chart of account for the first 3 companies, and load data only
for companies with a CoA installed.
2021-01-22 10:14:48 +00:00
Florian Gilbert 442326bc29 [REF] account: adapt main_flow tour and __init__.py for new sync module
This part of the tour can't work with the new online synchronization
module (account_online_synchronization) due to the fact that we are
using an iframe to display the list of institutions and therefore
those steps won't work within the iframe.

Also remove account_plaid & account_yodlee from _auto_install_l10n as
those modules don't exists anymore.

closes odoo/odoo#50267

Related: odoo/upgrade#1780
Related: odoo/enterprise#8200
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2020-11-19 14:13:52 +00:00
wan 1c30b8a95c [FIX] account: do not auto install modules that depend on Accounting
Moved in the post init hook of account_accountant

closes odoo/odoo#60068

X-original-commit: f997bc8f6e9d5138de6faed80e9774d359bfbe8d
Related: odoo/enterprise#14100
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-10-15 10:14:25 +00:00
Paul Morelle 17299012af [FIX] account: fix install of account installs account_accountant
Bug description:

Installing Invoicing on a database whose company is configured in the
SEPA zone, results in installing Accounting

Steps to reproduce on the Runbot:

- Start from a base enterprise database
- Go to Settings > Users & Companies > Companies and configure the
  address of MyCompany to the SEPA zone (e.g. Belgium)
- Go to Apps and install Invoicing
- The Accounting application has been installed

Explanation:

The module account_sepa depends on account_batch_payment, which depends
on account_accountant.
The post_init_hook of account, _auto_install_l10n, adds the account_sepa
module to the installation if the country_code of the company is in the
SEPA zone.
The same side-effect is observed with account_bank_statement_import_camt
which depends on account_bank_statement_import, which depends on
account_accountant.

The fix is to remove the installation of these modules from the
post_init_hook of the module account, and add them to a new
post_init_hook of the module account_accountant, that will be in a PR in
the enterprise project.

closes odoo/odoo#58073

X-original-commit: db4ce56641c75403be935efa072687bff65c7bb2
Related: odoo/enterprise#13362
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2020-09-18 17:35:11 +00:00
oco-odoo 07fbfbb5fb [IMP] account: remove account_fiscal_country_* config parameter
This config parameter was used in order to choose another country than the company's to select the tax report. It is now replaced by a new account_tax_fiscal_country_id field in account_reports.

closes odoo/odoo#55308

Related: odoo/enterprise#12156
Related: odoo/upgrade#1624
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-08-14 07:59:16 +00:00
william eaa7f93c0f [IMP] l10n_*: update the module categories
Task 2309613

We have a new hierarchy:
* Accounting
  * [Generic, not changed]
  * Localization
    * Account Chart
    * Check
    * EDI
    * Point of Sale
    * Purchase
    * Reporting
    * Sale

This helps in displaying only the chart of accounts when clicking on
"Install more Packages" from the accounting settings in the Fiscal
Localization section.
We can also refine the search in the _auto_install_l10n post init hook
of account.

closes odoo/odoo#55384

Related: odoo/enterprise#12179
Related: odoo/upgrade#1568
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2020-08-07 08:30:41 +00:00
william 38f03c4c8a [IMP] l10n_au: add Australian reports menuitem
Done in commuity so that other modules can inherit from it, but only
used in enterprise's l10n_au_reports for now.

closes odoo/odoo#49581

Related: odoo/enterprise#9907
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-06-15 14:09:17 +00:00
william fef6e133a0 [FIX] account: do not install l10n_generic_coa if another is installed
The module l10n_generic_coa was installed in every single case when
loading a new db from the console because the country is US by default.
If we have a `-i l10n_*`, we dont need to install another CoA based on
the country.
The fact that it is installed was messing with the demo data because we
were searching for a type of account not necessary present in the CoA
installed on the company.

closes odoo/odoo#52190

X-original-commit: d3ad353c86f7b148946f9e36457f6b002cc118c1
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-05-29 15:24:37 +00:00
wan 990f1cb5f9 [MOV] l10n_cn: merge l10n_cn_small_business into l10n_cn
Since commit 4d23d241bf, there is only one
CoA left for China. No need to have 2 separate modules.

Also, the translation in english was broken.

closes odoo/odoo#41826

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-12-13 09:40:37 +00:00
jbw 6c9a7592a4 [IMP] various : remove-bic-constraint-on-sepa-operations
{ As the SEPA BIC is no longer mandatory we simplify bank creation removing constrains about BIC }
As of 01/02/2016, the BIC is no longer mandatory, you can see the page 25 ==> https://www.febelfin.be/sites/default/files/2019-04/standard-xml-sdd-initiation-_v4.1a-en.pdf
As a result, in order to simplify both the code and the process, we don’t want anymore constrains about that.

task : https://www.odoo.com/web#id=2056370&action=327&model=project.task&view_type=form&menu_id=4720

> We don't need BIC for both the company iban bank account or customer/vendor iban bank account
> If a vendor bill is linked to a valid IBAN bank account without BIC, show the QRcode (remove the BIC constrains )
> CREATE A SDD mandate should be possible without BIC (for both the company iban bank account or customer/vendor iban bank account)
> Create a SCT payment should be possible without BIC (for both the company iban bank account or customer/vendor iban bank account)
> Add a country group for SEPA zone
> Add IBAN country codes for each country in base_iban module
> Only display qr code when making a payment to an IBAN account whose country code corresponds to a SEPA member
> in account's post init hook, install SEPA modules if the country of the company belgons to SEPA zone (instead of Europe, as it is now)

closes odoo/odoo#40356

Related: odoo/enterprise#6738
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-11-28 15:35:42 +00:00
Nicolas Martinelli ddeb7b7cb0 [FIX] account: UK country code
The country code for United Kingdom is GB.

closes odoo/odoo#35828

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-20 07:34:37 +00: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 8dd5a85267 [MERGE] forward port branch saas-12.3 up to 60e71302a3 2019-05-13 15:26:12 +02:00
Yannick Tivisse a5b6f31cf2 [IMP] base: Contextualize the multi company
Purpose
=======

Allow the user to select the allowed companies for which he wants to see records
on top of selecting his current company.

It is confusing for users to see the records from the company he is connected to
and the records of the children companies.

Instead of using the hierarchy of companies to access records across companies,
the user can now select (from his set of allowed companies) the companies for
which he wants to access records.

/!\ This means that the user will interact with records from company A when in
company B.
Example: a SO has been created and confirmed in A. When in B, I create the
invoice from it.

Specifications
==============

1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
kept on the res.company model to ensure the retro-compatibility, but won't be used
accross the standard code anymore. The only functional usage for this mechanism
was to allow to see records from several companies by creating a virtual parent
company, which will be possible with the new mechanism.

2/ By default, a user will only see the records of the company he is connected
to (or records without a company). (It is still editable by the user if needed).
For that, put this information in the user context, to allow having different
configurations on different browser tabs. Instead of having domains like
['|',
('company_id', '=', False),
('company_id', 'child_of', user.company_id.id)]
you'll have something like
['|',
('company_id', '=', False),
('company_id', 'in', company_ids)]
Note that the 'company_ids' is a value that is passed in the evaluation
context on the record rule, as we already have user, or time.
company_ids is a list of the ids of all the enabled companies in the
user's context.

3/ Out of the generic improvements brought by this task, this will illustrate
issues that could exist since several versions. For example, it should not be
possible to create a scrap order for the company A with a package of the company
B, or it should not be possible to create an invoice on the company A with
payment terms from the company B. Before the version 12.0, it was easy to
encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
effect of the fact that the SUPERUSER_ID has become an inactive user was to
make it more difficult to introduce mismatch on the records, but haven't solved
the issue, as it was still possible to do it with parent companies
configuration. Some of these issues have been fixed in this commit, but all the
business flows should be re-tested to check if an ir.rule should be introduced
(eg: a multi company rule for stock.quand.package), if the company of a record
is correctly transfered to another record created from the first record (eg:
From a SO, create an invoice and a payment, the company of the sales order
should be transfered on the invoice and the payment, even if the company of the
sales order is A and I'm logged into the company B with the company A enabled.

4/ Currently, if I click on a button on a notification email (example 'View
Task'), I face a traceback if I'm not logged into the company of the record.
Now, if you click on a button and if you have access to the record, the correct
company will be automatically set.

5/ If I display a kanban view with several records from several companies (and
an image), all the images should be displayed.

6/ Currently if you copy paste an url, this will crash if you're not in the
correct company. This won't be fixed because it's quite impossible to do it in
a clean way. This task brings a workaround. Copy/Paste -> Traceback -> Log into
the correct company, re-copy/paste -> Ok.

7/ 2 property methods have been added on the environment to retrieve the company
on which the user is logged in and the companies the user enabled, on a specific
tab.
That way, when creating a record, instead of doing
default=lambda self: self.env.user.company_id
do
default=lambda self: self.env.company_id
On the other hand, to retrieve the enabled companies, do
companies = self.env.company_ids

8/ Modify the Company Switcher widget to allow to log into another company
WITHOUT writing on the res.users (and thus bringing cache invalidation issues
and so on). Also allow to enable several companies and see records from several
companies, and independantly of the other browser's tabs.

9/ When focusing on a tab, save the current company configuration on the local
storage. That way, when doing 'CTRL+T' or a middle click, the context is
propagated to the new tab.

10/ Improve the error message in case of multi company access errors. Now, when
the user is in debug mode, display the related names of the records and the name
of the user who brings the issue.

11/ Remove the context erasing when writing on a res.users
This is probably coming from the migration to new API of the base module.
The context was not propagated at this moment, which was a common mistake at
that time. When migrating the module, probably by using the 'black box' method,
as the context was not propagated, it was erased on the new version. This is
now an issue because the context (i.e. the enabled companies) was erased when
writing on a res.users, leading to tracebacks.
See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624

12/ Fix the crash manager on redirect warnings. The issue is the following
- Create an invoice on a company without a configured CoA.
- Set a partner
- On the onchange_partner_id, a redirect warning is raised to propose you
to configure a CoA
- Click on 'Go to the configuration panel'
- A generic warning says something like 'Do you want to discard your changes?'
- Click on yes, the page refreshes, but not on the redirect action.
Now, set correctly the action on the hash, and reload instead. The breadcrumb is
lost for example, but you reach the correct action at least.

13/ Introduce a res.group to enable/disable the multi company per tab
feature.

14/ To help the users to know which tab is in which company, add the
possibility to have a favicon per company. When creating a company,
the classical 'O' icon is colored by default in a random color.

15/ Remove the company switcher on the frontend. This was mainly there
to allow a user to swicth to the company linked to the website.
This behavior is now transparent to the user. If the website A is
activated, then the company set on the context is the company of the
website.

16/ Deprecated the _company_default_get method on the res.company
model. Remove the method _get_company on the res.users model.

17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
context. You can now use those variables on domains in the views to
access directly to the activated company.ies on the current tab.

TaskID: 1960971

closes odoo/odoo#32341

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-13 08:57:49 +00:00
Christophe Simonis 33f1e5f64b [MERGE] forward port branch saas-11.3 up to 44aedc9b13 2019-04-15 18:33:51 +02:00
Christophe Simonis 44aedc9b13 [MERGE] forward port branch 11.0 up to 0b2dbbb337 2019-04-15 14:52:20 +02:00
Johan Demaret Rivarola 45010151dd [[FIX] account: l10n_mx_edi installation
To comply with Mexican laws, this l10n_mx_edi should always be installed when
both l10n_mx and the accounting modules are installed.

It should ease the onboarding process a bit too.

opw-1960982
closes #32566

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-04-10 06:57:09 +00:00
Jeremy Kersten 1cfaa12012 [IMP] server: --test-enable support tests directory without import
Before this commit, if import from tests directory was not in the __init__ file,
it was not possible to launch it with --test-file cli.

Now we only check in test directory if file exists.

This commit closes #26500
2018-08-22 10:08:30 +02:00
Olivier Colson b30fed7a7b [IMP] account: facilitate bank account and bank journal config
With this change,
 * some modules are now set to be automatically installed by default
 * the setup bar of accounting has been changed in order to allow more easiliy the configuration of bank accounts/journals (and the step to oversee the opening entry has been removed)
 * the kanban view in the dashboard has been enhanced (mostly for bank journals, but not only)

Was task: 32668
Was PR #23049
2018-06-08 17:48:03 +02:00
Laurent Smet d49ab568a2 [IMP] account: compute tax lines on account.move with onchange
Allow the user to set taxes on lines when creating manually a new journal entry, and tax lines will be computed automatically thanks to an onchange based on new unstored fields.

Was task: 33802
Was PR #19029
2018-06-08 14:23:14 +02:00
Christophe Monniez 32db86e3a0 [REF] account_check_printing: refatoring to better inheritancy
* localized checks layout of US and CA introduced in enterprise
* account settings now install account_check_printing instead of the US checks layout
Wsa PR #18791. Was task 33298
2018-02-01 16:48:33 +01:00
Rohan Patel 6d92fc93f6 [IMP] l10n_cn: improves the localiaztion packages of China
* Improved translations
* IMproved CoA (types, codes, code_digits...)
* Improved taxes (new ones, added tax groups)

Was PR #21169.
2018-01-24 15:30:35 +01:00
Andrew Latham 7fd8c7f7f7 [FIX] account: correct spelling mistakes
Closes #20652

Partially backported at 5aebc22722
2017-11-03 09:19:33 +01:00
Cédric Snauwaert 09189fa809 [IMP] l10n_de: localization package improved
* CoA up to date
* Taxes up to date
* SKR03 installed by default but users can easily switch to SKR04 while no accounting entries exists for the company
* removed unneeded things
* set tags accordingly on accounts and taxes for the reports to work (new reports in enterprise)

Was task 31826. Was PR #17447. Discussion related on #18571
2017-09-12 17:52:47 +02:00
Thibault Delavallée 3836aac471 [MOV] account_*: move account customer portal to account
As already done for sale, customer portal for account is moved to account
module directly. Account now depends on portal module and website module
is not necessary anymore to display the account customer portal.
2017-08-08 15:36:32 +02:00
Nicolas Martinelli f57f133047 [IMP] account, l10n_*: remove dependency on base_vat
Localizations depend on the module "base_vat". It is therefore
impossible to remove base_vat without the localization. This causes
issues for users who simply want to deactivate the VAT check.

opw-743260
2017-05-18 17:05:22 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Yannick Tivisse d6e1d41128 [MIG] account: Migrate remaining old API chuncks of code 2016-08-08 12:24:40 +02:00
qdp-odoo ea12117f65 [IMP] account: auto-install 'l10n_uk' for country code 'GB'. Auto install 'l10n_generic_coa' if there is no dedicated localization found for the country code 2015-10-27 10:44:50 +01:00
qdp-odoo 3f231fc0ac [IMP] account: auto-install account_yodlee module for some more localizations, accordingly to what is written at https://docs.google.com/spreadsheets/d/1tnUwiweunpjBdDkzTx2XqfE8Usv9MZPH_C20WRVoyvY/edit#gid=0 2015-10-14 16:36:38 +02:00
qdp-odoo 4890715171 [IMP] account: auto_install account_check_printing for US companies 2015-09-30 09:26:36 +02:00
qdp-odoo 6863826d0d [IMP] account: auto install account_sepa module if the company's country is in Europe 2015-09-18 11:16:52 +02:00
qdp-odoo 108e424baf [IMP] account: auto_install localization module(s) if the country is known 2015-09-07 17:12:46 +02:00
Mahendra barad 38dc782eaa [RESTRUCTURE]Account : Files Restructure according to new api guideliens 2015-06-23 14:00:43 +02:00
Olivier Dony 0bd4545348 [LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
  automatically in all countries thanks to Berne Convention + WTO rules,
  and a reference to the applicable license is clear enough.
2015-06-02 03:16:04 +02:00
qdp-odoo c04065abd8 [IMP] accounting v9. Yeeeeaah 2015-05-05 17:28:04 +02:00
Leonardo Donelli 4a0b13ed92 [REF] remove vim modelines and resulting trailing blank lines
Let 2015 be a year without modelines!
cf #4174
2014-12-31 15:52:13 +01:00
qdp-odoo b92c6b3101 [IMP] base, ir_sequence: added use_date_range field on ir.sequence, that allows to have several sequences running for the same one depending on date ranges (similar to what was existing previously on accounting with FY, which is now deprecated) + port to new API 2014-11-21 10:09:29 +01:00
cod-odoo a301b4c7fc [MOVE] account: moved account/project files to analytic or account, depending on which module the moved code belongs to. This allows to remove references to project in account module. Also added some improvements in project when deleting a project (delete account if void) or when deleting an account (delete project if void). 2014-08-04 13:23:46 +02:00
Thibault Delavallée 67480c3823 [FIX] account: partner before account in import ... weird ?.
bzr revid: tde@openerp.com-20120810102743-mx70k3gymn4ou7y1
2012-08-10 12:27:43 +02:00
Raphael Collet 532f125232 [MERGE] branch trunk-v62_config_account-uco (new config wizard for accounting)
bzr revid: rco@openerp.com-20120328074146-8bfa90nkus9bxbaf
2012-03-28 09:41:46 +02:00
Ujjvala Collins (OpenERP) 96b40be149 [IMP] account: Improved logic to install chart of accounts using configuration.
bzr revid: uco@tinyerp.com-20120309103812-uyb9rnb08c1b1lcc
2012-03-09 16:08:12 +05:30
Ujjvala Collins (OpenERP) 5128b93091 [ADD] account: Added config files.
bzr revid: uco@tinyerp.com-20120307124301-ey6qvcafb3uibuqy
2012-03-07 18:13:01 +05:30
Antony Lesuisse 74adf124cd move account_financial_report to it's own file, create separate action for PL BS.
bzr revid: al@openerp.com-20111230114410-73kvxxvl6vauj6tu
2011-12-30 12:44:10 +01:00
Olivier Dony 3bffe65b2c [MERGE] sync with latest trunk
bzr revid: odo@openerp.com-20111013170327-9rvfdkbgj01hdgxb
2011-10-13 19:03:27 +02:00
Olivier Dony 05497056de [IMP] account: edi export/import review
bzr revid: odo@openerp.com-20111005003409-7umxxyebrh6jf8r2
2011-10-05 02:34:09 +02:00
Antony Lesuisse a1e940627b [IMP] rename invoice into account_invoice
bzr revid: al@openerp.com-20111001095720-h2prjp5due7rukir
2011-10-01 11:57:20 +02:00