When creating a timesheet, several fields need to be recomputed:
- `currency_id`
- `group_id`
- `department_id`
- `is_timesheet`
- `validated`
When `validated` is computed before the other fields, the recomputation
will lead to an `AccessError` because of the rule
`hr_timesheet.timesheet_line_rule_user`.
Since the test `test_timesheet_validation_user` expects an
`AccessError`, the test succeeds. However, from time to time,
`validated` is computed last => the `AccessError` is not raised.
Actually, a `ValidationError` should be raised in this case (from the
`create` override in `timesheet_grid`).
This commit is a cherry-pick of 802339c12d
and dcca2e8b9d
When creating a timesheet, several fields need to be recomputed:
- `currency_id`
- `group_id`
- `department_id`
- `is_timesheet`
- `validated`
When `validated` is computed before the other fields, the recomputation
will lead to an `AccessError` because of the rule
`hr_timesheet.timesheet_line_rule_user`.
Since the test `test_timesheet_validation_user` expects an
`AccessError`, the test succeeds. However, from time to time,
`validated` is computed last => the `AccessError` is not raised.
Actually, a `ValidationError` should be raised in this case (from the
`create` override in `timesheet_grid`).
This replaces the former modified preorder tree traversal (MPTT) with the
fields `parent_left`/`parent_right`. Each record is associated to a string
`parent_path`, that represents the path from its root node to itself. The path
is made of the node ids suffixed with a slash:
a node | id | parent_path
/ \ a | 42 | 42/
... b b | 63 | 42/63/
/ \ c | 84 | 42/63/84/
c d d | 85 | 42/63/85/
This field provides an efficient implementation for parent_of/child_of queries:
the nodes in the subtree of record are the ones where `parent_path` starts with
the `parent_path` of record. It is also more efficient to maintain than the
MPTT fields, and less sensitive to concurrent updates, because the value of
`parent_path` does not depend on sibling nodes.
Purpose
=======
User not able to see his total balance per customer if user has several projects with same customer..
see here : https://www.odoo.com/web/content/3287924
Specification
=============
User should be able to see the sum of the debit, credit and balance when group by partner
The difficulty here is that debit,credit and balance are non-stored computed fields depending on the company and the date passed with the context. As these parameters depend on the user and the current date, we can't store the field. The simplest way to achieve this is to override the read_group method and compute the sum by hand when the values are aggregated (means when a group_by is applied).
* analytic accounts can be shared among companies
* amount on analytic lines always refer to amount in company currency of which it belongs to
* add analytic groups (hierarchical way to classify analytic accounts)
* analytic tags:
- only present on analytic lines, not anymore on analytic accounts
- can be used to distribue/split an analytic lines among several analytic accounts
- enabled by a dedicated res.group
- added on several objects (vouchers, expenses, analytic defaults...) as well as in bank statement reconciliation widget (manual counterpart and account.reconcile.model)
* bunch of fixes made related to analytic
Was PR #22124. Was task 32386. Original work by tbe.
New feature:
- New Transparent tag visual (grey border & text, white bg),
- By default, newly created kanban tags are transparent,
- Tag's colorpicker has now a 'Hide in Kanban' checkbox,
to select the transparent color.
Toggling off 'Hide in Kanban' sets the color of the tag as follow:
- Previous color, if 'Hide in Kanban' was toggled on on the
same formview session.
- Color 1 (dark orange), otherwise.
1/ An empty notebook was created in analytic and filled in account_budget
That way, we had a horizontal line while the module wasn't installed yet
2/ The fields use_task and use_issue displayed on the account.analytic.account
are just redundant information. The probable use case is to go on the project
select the issues management on it, and it will be activated on the related
analytic account. I don't think that anybody will come on the analytic account
to activate the issues. So we hide them in group_no_one
3/ On the analytic account form view, display the title label only in edit mode
Currently there is a selection field 'account_type' on the
account.analytic.account model with 2 values : Active or Archived
Let's use an active field instead and add a Archive stat button on the
form. That way, we can remove all the domain ('account_type','=','normal')
which are implicit with the generic active field behavior
The algorithm for matching analytic accounts based
on search term is only meant to be used for
simple, positive operators.
In other cases the results will not be what the user
expects. Falling back to the default name_search
behavior will be more useful.
It is using an already existing field that wasn't used anymore ('account_type') but as a lot of domains on analytic accounts were
- wrong (still using old fields state and type that have been removed as well in the same commit),
- or defined directly in the views
so, an update of some modules may be needed in order to avoid further problems.
On databases with a large number of res.partner entries,
the extended name_search of analytic accounts was prohibitively
slow, due to the expensive name_search on res.partner.
Restricting the search to the partner name is extremely
similar business-wise, but makes a huge difference in
terms of speed. E.g. sub-second results vs 10+ minutes
for a database with 30k analytic accounts and 600k partners.
If a method used as a default returns an id instead of a RecordSet,
it could fail in 'convert_to_write' (Many2One field) because it will try
to return "value.id". If "value" is an integer, it fails.
Also changed the method to a lambda expression and removed the
'_default_user' method because it's not used anywhere.
- add contract_type field on account.analytic.account and real_quantity on account.analytic.invoice.line
- refactor contract form and list views for better clarity (hide unnecessary fields depending on the type of contract)
- divide account_analityc_account class according to contract type for future work
- divide contract template menu in 3 menus depending on contract_type
- add on_change_uom behaviour on account recurring lines
- rewrite tests in python
- add new report (pivot & graph)
- end date of contract is now computed from the template recurring rules
- small fixes & usability improvements
- 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.
_track is now a method that returns the subtype to trigger in a given
tracking context. A tracking will now lead to only one subtype
being trigerred, instead of having multiple possible subtypes.
Now, one tracking leads to one message with one subtype, or without subtype
if there is none matching. This simplifies the model for future evolution of
chatter and mail.
[IMP] project, project_issue: cleaned task and issue subtypes, now having
opened for created / assigned.
Unify and refactor exception handling in framework and addons.
The generic `except_osv` is now deprecated, and replaced by more specialized exception subtypes:
- `UserError` (renamed from Warning, as it conflicts with the built-in `Warning`) raised when a non-technical error occurs during a business operation. It could be a missing information in the data provided by the user, or a misconfiguration.
- `AccessError`: raised when any operation is denied because the user conducting it does not have the required access rights.
- `AccessDenied`: raised when an operation that requires authenticated access is attempted via an unauthenticated request.
- `MissingError`: raised when an operation is attempted on a record that does not exist.
- `ValidationError`: raised when an operation violates a SQL or Python constraint.
- All other exceptions are internal errors due to a system problem or bug, and raised untouched to the client-side, which should display a traceback.
All exceptions take a single message argument.
The `test_exceptions` module has been updated to showcase both new and old (deprecated) exceptions.
A great many old `except_osv` had a useless title with "Error!" or "Warning", those have been removed, as this is handled by the client-side widget that displays the messages.
This commit introduces a more consistent policy for logging errors and warnings:
- All messages that do not require administrator attention should be logged at INFO level or lower. This includes all errors that are notified to the user in a friendly manner, even for access right problems or validation errors during business operations.
- All messages that indicate a likely misconfiguration or malicious use by the users should be logged at WARNING level, as they typically require administrator attention.
- All other unhandled internal errors cannot typically be handled by the user and should be logged at ERROR or higher level, as they require immediate administrator attention.