summaryrefslogtreecommitdiff
path: root/addons/analytic/models
AgeCommit message (Collapse)Author
2019-03-11[MERGE] forward port branch saas-12.1 up to 2b3296bbf8bChristophe Simonis
2019-03-06[FIX] analytic: name_search return no resultsToufik Ben Jaa
- Since the commit 5fcf891e07bf61518e6bf0be0dc4f27859d45778 an issue has been introduced in the `analytic.account.analytic` name_search method. In some cases searching through analytic accounts will return no results when it should. The issue is due to a bug in `expression.py` that doesn't correctly handle the fields in `auto_join`. The issue is described here https://github.com/odoo/odoo/issues/25175 and will be fixed by the ORM team. closes odoo/odoo#31628 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-02-06[IMP] various: optimize _name_searchRomainLibert
In the overrides of _name_search we should avoid creating domains with huge lists of ids as it is inefficient. We can also make sure that we optimize the empty search as in this case the custom domain doesn't make sense, we can simply search on an empty domain and, thanks to the limit argument, still keep a fast query. Linked to task 1918906 Thanks to @odony and @nseinlet closes odoo/odoo#30155 closes odoo/odoo#30887
2019-02-05[IMP] various: optimize _name_searchRomainLibert
In the overrides of _name_search we should avoid creating domains with huge lists of ids as it is inefficient. We can also make sure that we optimize the empty search as in this case the custom domain doesn't make sense, we can simply search on an empty domain and, thanks to the limit argument, still keep a fast query. Linked to task 1918906 Thanks to @odony and @nseinlet closes odoo/odoo#30155
2019-01-04[REF] various: update tracking parametersThibault Delavallée
Purpose is to clean the use of tracking parameters on fields. Parameters are merged and is now tracking=<int> or tracking=True. This commit is linked to task ID 1903814 and PR #28430.
2018-09-27[REF] *: adapt code to new related default behaviourAdrian Torres
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-21[IMP]account_*: Improvement in model descriptionNimesh Jethva
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-10[MERGE] forward port branch saas-11.4 up to 1199451606cChristophe Simonis
2018-09-10Revert "[IMP] *: Define groups on res.users models"Yannick Tivisse
This reverts commit 99f497b390e680629dce3a7e2e282ada74ee9884.
2018-08-13[MOV] analytic: move uom field from account to analyticjem-odoo
2018-06-07[MERGE] forward port branch saas-11.3 up to c00df146547Christophe Simonis
2018-06-06[MERGE] forward port branch saas-11.2 up to c834c0f5879Christophe Simonis
2018-05-31[FIX] analytic: read_groupNicolas Martinelli
Oversight of forward-port 9001a75f23c014e744fc1853190297eed4c47438 opw-1853068
2018-05-29[MERGE] forward port branch saas-11.3 up to 37eed7c509fChristophe Simonis
2018-05-25[MERGE] forward port branch saas-11.2 up to 58e35522468Christophe Simonis
2018-05-23[MERGE] forward port branch 11.0 up to 02ee3fd88efChristophe Simonis
2018-05-23[IMP] various: Override _(name_)search instead of (name_)searchYannick Tivisse
Purpose ======= The method _name_search and _search add support to search as another user. All the overrides of name_search and search redefine the behavior of the search. This bring inconsistencies as the result of a call to _name_search and name_search could differ on certain modules, which is not acceptable. Specification ============= Example: ~~~~~~~~ If the name_search method is overridden to search also on the driver name, then calling name_search with a label 'JF' will return all the cars with a name containing 'JF' or all the cars with a driver name containing 'JF'. Let's say that we have a ir.rule preventing a user to read the cars of another company. Then the call to name search only returns the cars satisfying the previous condition AND belonging to his company. Now, we want to overpass this constraint. We call _name_search with the attribute name_get_uid=1. Then the call to _name_search returns all the cars from all the companies with a name like 'JF', but nothing is done about the driver_name. Example of wrong search redefinition on a model ----------------------------------------------- @api.model def name_search(self, name, args=None, operator='ilike', limit=100): domain = args or [] domain = expression.AND([domain, [('name', 'ilike', name)]]) partners = self.env['res.partner'].search([('name', operator, name)]) if partners and name: domain = expression.OR([domain, ['|', ('driver_id', 'in', partners.ids), ('driver_id', '=', False)]]) rec = self.search(domain, limit=limit) return rec.name_get() Example of correct search redefinition on a model ------------------------------------------------- @api.model def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None): domain = args or [] domain = expression.AND([domain, [('name', operator, name)]]) partner_ids = self.env['res.partner']._search([('name', operator, name)], access_rights_uid=name_get_uid) if partner_ids: domain = expression.OR([domain, ['|', ('driver_id', 'in', partner_ids), ('driver_id', '=', False)]]) rec = self._search(domain, limit=limit, access_rights_uid=name_get_uid) return self.browse(rec).name_get() The same logic should be applied on the overrides of the search method.
2018-05-18[MERGE] forward port branch saas-15 up to 021d0e6a98bChristophe Simonis
2018-05-18[MERGE] forward port branch saas-14 up to cabe0951af2Christophe Simonis
2018-05-18[IMP] analytic: Performance on _compute_debit_credit_balanceCarlos Dauden
Courtesy of Carlos Dauden. Was PR #24660
2018-04-26[IMP] *: Define groups on res.users modelsYannick Tivisse
The reified view on the res users will be dropped in the following commit. The previous commit adds support to define each group as a computed field on the res users. This commit defines: - A boolean field for each 'isolated' res.group, i.e. a group in the hidden category. - A selection field for each 'Application' res.group, i.e. a group in a application category. Example: - The group to manage pricelist in sales becomes a boolean field - The groups project user/manager become a selection field
2018-04-13[IMP] *: Replace all occurences of 'compute' by '_convert'Yannick Tivisse
2018-04-13[FIX] analytic, hr_timesheet: recompute orderNicolas Martinelli
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 802339c12d1984d1f29e574378cd8df2471ab098 and dcca2e8b9da685c13ba3fe8d3196b8e83fb429ba
2018-04-03[FIX] analytic, hr_timesheet: recompute orderNicolas Martinelli
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`).
2018-02-28[REF] models: use `parent_path` to implement parent_storeRaphael Collet
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.
2018-02-05[IMP] anlaytic: display total of balance/credit/debit on group_byrmu-odoo
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).
2018-01-31[IMP] analytic: in-depth refactoringJoren Van Onder
* 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.
2017-11-20[IMP] web: hide in kanban tag's color (#20815)Alexandre Kühn
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.
2017-08-29[IMP] account: allow to archive journal, account.tag and analytic.tagptr-odoo
Currently there is no option to Archive / Unarchive Journal + Accounting Tag + Analytic Account Tag task: https://www.odoo.com/web#id=27447&view_type=form&model=project.task&menu_id=4720 PR: #12864
2017-04-28[FIX] Various P3-related import changesxmo-odoo
* 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-01-07[IMP] *: color index - avoid lots of grey tags on kanbanFabien Pinckaers
2016-08-02[MOV][IMP] analytic: reorganize addon, remove openerp tags and rename python ↵fwi-odoo
classes
2016-03-23[IMP] account_budget,analytic,project: Some display improvementsKinjal Mehta
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
2016-03-23[IMP] analytic: Replaced account_type field by active fieldKinjal Mehta
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
2016-03-01[IMP] analytic: add tracking of customer in chatterDamien Bouvy
2016-02-17[FIX] analytic: name_search with negative operatorsOlivier Dony
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.
2015-12-16[FIX] analytic: _default_userGoffin Simon
The "user_id" linked to the employee_id set on the sheet must be used when editing a sheet. opw:659647
2015-12-11[FIX] analytic: workaround to re-enable the feature to close an analytic ↵qdp-odoo
account that has been unfortunately removed by mistake in commit 2a8c077. 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.
2015-12-02[FIX] analytic: fixed name_search() on analytic account. The partner_id ↵qdp-odoo
field is not mandatory, but the previous domain was making an inner join with the partner table, which resulted in not finding the accounts matching the search criteria on name/code if they hadn't a partner set.
2015-11-24[FIX] analytic: optimize name_search for large databasesOlivier Dony
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.
2015-09-30[FIX] analytic: hide account_typeNicolas Martinelli
`account_type` is probably not necessary anymore, but too late to remove it.
2015-09-23[FIX] analytic: remove deprecated codeNicolas Martinelli
The field 'state' has been removed, so this is now useless.
2015-09-09[FIX] analytic: methods used in default attribute should return a RecordSetOlivier Laurent
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.
2015-09-07[ADD] *: add color field on tagsMartin Geubelle
2015-08-31[IMP] analytic: remove unnecessary sequenceDamien Bouvy
$
2015-08-27[IMP] analytic: adaptation due to the new Sale moduleNicolas Martinelli
Major changes: - Remove reports - Simplify models Reason: complete rewrite of the Sale module. Responsible: fp, dbo, nim
2015-08-06[MERGE] forward port of branch saas-6 up to be58335Christophe Simonis
2015-07-28[FIX] analytic: prevent deleting contract template when in useOlivier Dony
2015-07-28[MERGE] forward port of branch saas-6 up to 51040b6Christophe Simonis
2015-07-27[MERGE] forward port of branch 8.0 up to 5e6ec89Christophe Simonis