Commit Graph
41 Commits
Author SHA1 Message Date
alt-odoo 2a4b0ede52 [FIX] account: wrong default bank journal returned
If no bank journal with no account set can be found, we should return False
instead of an empty record.

closes odoo/odoo#59609

X-original-commit: ececa74b96accd86bf9e9448d18526a905fed4c9
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2020-10-09 11:17:02 +00:00
Nicolas (vin) 0a4c093926 [FIX] account: misc. fixes
The tooltip message on default_account in the journal is too obvious, and it has an issue
(There is no way to control the tooltip title when the field appears multiple times in the view,
it is always taking the label of the last time the field appears)
which is a limitation of the framework.
Thus, it is removed.

Fix the display of emails on the accounting dashboard, as they only should be
visible when properly set and on the purchase journal.

Improve the flow of the new bank account wizard to avoid forcing the user
to chose an existing journal when one of them exists without account.
This should still be a possibility, but the user should be able to decide
to create a new journal if wanted.

Task id #2322724

closes odoo/odoo#56177

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-08-20 10:21:33 +00:00
Nicolas (vin) dbe8bd5438 [IMP] account: search/create bank from bic in bank account wizard
When creating a bank account, the BIC should be enough to find or create
a new bank.

task id #2321110

closes odoo/odoo#55993

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-08-17 12:16:16 +00:00
Nicolas (vin) 41f119d532 [IMP] account: Misc. improvements
Miscellaneous changes aiming to improve the user experience in the accounting module,
mainly in the journal model and its form view.

Also aim to improve the bank account creation wizard.

Task ID: #2250349

closes odoo/odoo#54494

Related: odoo/upgrade#1546
Related: odoo/enterprise#11862
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-08-11 12:41:13 +00:00
Laurent Smet caeb782841 [IMP] account,*: Improve bank statements/payments workflow
- Create journal entries as soon as bank/cash statement lines are created, temporary booked on a suspense account set on the journal.
- Simplify the management of "blue" lines in the reconciliation widget. A "blue" line is now a journal item using a temporary liquidity account (outstanding payment/receipt accounts, set on the journal).
- Adapt and simplify the bank reconciliation report.
- Remove the bank reconciliation threshold date. The reconciliation report will show the not already reconciled journal entries using a liquidity account and the not already reconciled journal entries using a temporary liquidity account. Without accounting, an account.payment will involve directly the liquidity account and then, will be considered as a statement line directly.
- Remove the post_at bank reconciliation feature. The "paid" state will be set on the invoices only if reconciled with a journal entry involving the journal's liquidity account.
    With invoicing, the payment will do that so the "in_payment" state should never be shown up.
    With accounting, only the statement lines have the power to move an invoice to the "paid" state.
- Fix various corner cases about the management of multi-currency in bank statement lines.
- Fix the conversion dates in multi-currency: Since the bank/cash is always used on the statement lines, it will use always the real "bank" date instead of the fictive payment one.
- Ensure the 'reconcile' method will raise an error if the involved moves are not posted.

related enterprise PR odoo/enterprise#7019

closes odoo/odoo#41301

--task: 2092096
Related: odoo/upgrade#1018
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-04-10 09:47:24 +00:00
qdp-odoo 847889b497 [FIX] analytic, account: multi company fixes
added _check_company_auto and check_company attributes on relevant objects

Was task 2206523

closes odoo/odoo#46586

Related: odoo/enterprise#8986
Related: odoo/upgrade#993
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-03-26 13:22:58 +00:00
mreficent 3dffce34bf [IMP] fields: log warning for ignored selection
When a field is related, defining a selection or selection_add will
have no effect and the paramater is ignored.

Log a warning and fix all fields badly definied

Closes odoo/odoo#45716

closes odoo/odoo#45832

Related: odoo/enterprise#8613
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-02-20 14:58:33 +00:00
wan dfd01b8c5c [IMP] account: rework name sequences
Task 2146469

Rework the name computation:
* It doesn't use ir.sequence anymore
* It is an editable computed field
* Add a renaming tool

This allows the user to tweak the sequences more easily than having to
get through the ir.sequence settings.

The sequence depends on a parameter of the journal: continuous, montly
and yearly restart of the sequence. Everytime a new period is started,
try to make a pattern form another period.

The incrementing is done by taking the previous name, ordered
lexicographically, splitting it by taking the digits at the end, adding
1 and re contstruct with the prefix.

** This means there could be cases where the prefix has a big importance
on the next number. For instance, if you have
INVOICE/2019/0001
INVOICE/2019/0002
and then rename the last one to INV/2019/0002, don't expect the next
number to be INV/2019/0003. It will be INVOICE/2019/0002 (again) because
the highest number was INVOICE/2019/0001.
You will then end up with
INVOICE/2019/0001
INV/2019/0002
INVOICE/2019/0002

closes odoo/odoo#41485

Related: odoo/enterprise#7189
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-02-05 13:59:43 +00:00
Iván Todorovich 7869979591 [FIX] *: use sudo() to call set_onboarding_step_done
This method makes a write on res.company but many people do not have
access to the company

closes odoo/odoo#42644

X-original-commit: 130f08f13b49a529c1da0e1dc603c62337842f45
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-01-02 17:38:05 +00:00
Florian Gilbert ed26e9eafa [IMP] account: Various usability improvements
List of improvements:

Invoice/Bill
- Hide "untaxed amount" section when there is no tax.
- Remove tooltips for tax groups field.
- Remove invoice_partner_icon and set this icon in "Vendor" (in a list view)

Chart of Accounts
- Same views for config bar and regulare one
- By default don't show deprecated accounts and add filter to display them.
- Add some optional fields in list view (taxes, tags, ...)

Dashboard opening balance wizard
- The opening move entry date equals to the opening date - 1 day.

Bank Statements
- Set default order for the list view (by date desc and name desc)

Tax report configuration:
Add 3 new columns for the list view (country_id, code, tag_name)
Add 4 new searchs (name, tag_name, code, country_id)

Task ID: 2048225

closes odoo/odoo#38694

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-12-04 13:47:28 +00:00
wan 646a6d5a73 [IMP] account: improve the onboarding
Task 2031686

* Change some labels on the dashboard
* Move the action "Take money In/Out" to a button because it was also dsplayed in bank journals and we only want it for cash journals
* Add reconciliation param on the first account config list, as well as a button to go to the form (it is an editable list)
* Add an action to duplicate accounts in batch
* Smartly detect when a cash statement can be extended instead of creating a new one, making it more obvious to the user that he may need to validate his previous statement(s)

closes odoo/odoo#35137

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-08-19 10:17:47 +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
Christophe Simonis 5e81b18e24 [MERGE] forward port branch saas-12.3 up to 0247d2f35f 2019-06-27 20:45:52 +02:00
Christophe Simonis 6c5783bd5a [MERGE] forward port branch saas-12.2 up to 465909f0fd 2019-06-27 19:10:09 +02:00
Christophe Simonis 465909f0fd [MERGE] forward port branch 12.0 up to cd21c016b0 2019-06-27 18:01:07 +02:00
Nicolas Martinelli 988018a5ba [FIX] account: fiscal year end dates in wizard
- From Accounting dashboard > Configuration panel > Configure fiscal year
- Set opening date: 01/07/2018
- Set fiscal year end: June 30
- Click Apply button

An error is raised: 'Invalid fiscal year last day'.

This is because the 3 fields are linked by the constraint
`_check_fiscalyear_last_day`. However, non-stored writeable related
fields are evaluated one at a time, meaning that the constraint is
evaluated one value at a time.

We do a fancy workaround to write the 3 values at once on the company,
hence evaluating the constraint for the 3 fields once.

opw-2024927

closes odoo/odoo#34275

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-20 10:51:56 +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
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
wan 29ef024b51 [IMP] account: display sample data on dashboard if empty
Task: 1893104

closes odoo/odoo#28131

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-03-25 10:23:49 +00:00
Xavier Morel a0e05e2ab9 [IMP] fields: selection fields only use strings
closes odoo/odoo#29039
2019-01-26 14:25:44 +00:00
Christophe Simonis b106b7ce0b [MERGE] forward port branch 12.0 up to dd70c68426 2018-11-06 16:40:07 +01:00
eco-odoo 4312c1786d [FIX] account: mark configuration bar bank step done
When a new bank account was created manually, the step was not marked as done.
2018-10-26 13:36:26 +00:00
eco-odoo b2a14dda03 [FIX] account: onboarding fiscal year step various issues
Design: remove empty space in the dialog form.
Opening date:
-fix move line not created introduced by c4b9c51abf. This prevented saving the opening date;
-set default date to start of current year.
Add a validation on fiscal year last day:
-the automatic calculation was removed in 90cdc91638 but no validation was set;
-the help message became irrelevant;
-the fiscal year end date was set as readonly in 52a8ed3c0c and not fixed in 3f4f77fd9d.
2018-10-26 13:36:26 +00:00
Christophe Simonis 835b77ba94 [MERGE] forward port branch 12.0 up to ebe43bad9e 2018-10-09 11:37:30 +02:00
Nicolas Martinelli c36dedb095 [FIX] account: prevent incorrect fiscal year end date
We prevent setting a fiscal year end date which doesn't exist.

opw-1890518

closes odoo/odoo#27534
2018-10-08 12:32:05 +00:00
Adrian Torres 3f4f77fd9d [REF] *: adapt code to new related default behaviour
This commit adapts the business code to changes introduced by
the parent commit in order to keep the same behaviour as before.

All readonly=False fields will have to be checked afterwards to confirm
that the business case requires write access to the source field.
2018-09-27 12:10:23 +02:00
Nimesh Jethva 7246170de6 [IMP]account_*: Improvement in model description
Purpose of this commit is to give description more "business oriented"
because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers.

Related Task ID : 37311
2018-09-21 11:45:14 +02:00
Christophe Simonis 0ac7f8fbe6 [MERGE] forward port branch saas-11.4 up to dabe59df9c 2018-08-14 20:16:03 +02:00
Christophe Simonis dabe59df9c [MERGE] forward port branch saas-11.3 up to 27d8daf8a7 2018-08-14 19:43:32 +02:00
Christophe Simonis 27d8daf8a7 [MERGE] forward port branch 11.0 up to 51225c9b9f 2018-08-14 18:59:57 +02:00
Nicolas Martinelli 90cdc91638 [FIX] account: fiscal year last day
Do not replace the day value without notifying the user.

In undetermined circumstances, a fiscal year last day and month can be
replaced by the default December 31st value. Since all settings are
re-written for any setting changed, this is likely to happen in the back
of the user.

Moreover, the `_verify_fiscalyear_last_day` is not correct since it
doesn't accept February 29th, while `compute_fiscalyear_dates` handles
it.

opw-1867978
opw-1873260
2018-08-14 13:32:41 +02:00
eco-odoo 89e358caa8 [FIX] onboarding: Fix/Update onboarding to v2.0
Specification
=============

- Fix lots of bug due to the BS4 migration
- Improve steps
- Validate some steps (Like the company configuration) in all the
  onboarding bars if done in one onboarding bar.
- Only animate the confetti one time if a step is done, instead of
  on each view loading

For more information, see: https://www.odoo.com/web#id=1869513&action=333&active_id=965&model=project.task&view_type=form&menu_id=4720
2018-08-10 16:08:47 +02:00
Christophe Simonis 4797627259 [MERGE] forward port branch saas-11.4 up to 8d9366197e 2018-08-01 18:02:29 +02:00
Olivier Colson 691a5818ee [IMP] account: bank setup wizard: explicitly declare the implicit "res_partner_bank_id" field, automatically created by the use of _inherits, to remove a warning in the logs. 2018-07-25 17:10:06 +02:00
eco-odoo 6671d3d72b [IMP] account: convert dashboard onboarding to new design
Convert the current design of the account dashboard setup bar in order to uniformize the design of the onboarding panels.

task: 1858542
2018-07-20 11:59:13 +02:00
Olivier Colson 042e7862be [FIX] account: properly link bank account created via setup wizard with existing journals when choosing to do so
[IMP] account_bank_statement_import: bank account manual configuration wizard: when linking to an existing journal, change its statements source if the journal had an 'undefined' source.
2018-06-11 11:18:57 +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
Yannick Tivisse bc87f9e988 [IMP] account: Translate message from 148d23915c 2018-02-05 13:27:52 +01:00
Prakash Prajapati 148d23915c [ADD] account: Display a rainbow man after the configuration steps
Purpose
=======

There should be a rainbow man when finishing to configure the accounting via the new config bar
2018-02-05 13:19:38 +01:00
Lucas Perais (lpe) 9edab0dbb4 [FIX] account: modify the way the fiscal year is constained.
Commit a7ac2cf9fbb57242c1f528c4d6604af0e1509dae attempted at introducing a python constraint to make the fiscal day fall within the month boundaries (eg. not to be able to set Feb 30th)
The constrain appeared to fail depending on the order of its dependencies' evaluation.

After this present commit, we force the out of bounds given date to be the last day of the month
2017-09-26 09:30:15 +02:00
Olivier Colson 2d1b8e9f34 [IMP] account: new setup bar
Add a setup bar on account's dashboard, so that the user can more easily enter the initial data of his Odoo installation, following the steps that are proposed to him.

Was PR #16864
Was task 32119
2017-08-31 15:58:22 +02:00