Master analytic improvement tbe - #17499
Conversation
qdp-odoo
left a comment
There was a problem hiding this comment.
first pass done. some changes are required though you're on the right track :)
There was a problem hiding this comment.
these 2 functions should be removed since we want that on analytic lines (not account.move.line)
There was a problem hiding this comment.
must refactor the cancellation of account.move to unlink all the analytic lines created (even with a distribution).
Otherwise, currently you're duplicating the analytic entries each time you cancel-revalidate a journal entry
There was a problem hiding this comment.
remove the currency computation
There was a problem hiding this comment.
+set explicitly the company_id
There was a problem hiding this comment.
line['amount_user_currency'] += r['amount_user_currency']
There was a problem hiding this comment.
group_analytic_accounting
There was a problem hiding this comment.
dead code to remove
There was a problem hiding this comment.
Why not move.mapped('line_ids.analytic_line_ids').unlink()? That will remove all analytic entries in a single unlink call.
There was a problem hiding this comment.
"Or" between a leaf and nothing? That doesn't seem correct.
There was a problem hiding this comment.
Could you enlight me please, would something like this be better?
@api.model
def name_search(self, name, args=None, operator='ilike', limit=100):
if name:
recs = self.search([('account_id', operator, name)] + (args or []), limit=limit)
return recs.name_get()
return super(AccountAnalyticDistribution, self).search(domain, limit=limit).name_get()There was a problem hiding this comment.
I don't know what you're trying to do, the original just doesn't make any sense. The new version is at least syntactically correct.
There was a problem hiding this comment.
Well, qdp asked me to remove the 'name' field from the model and to use account_id's name for the search.
There was a problem hiding this comment.
OK, the version you posted in your comment makes more sense then.
There was a problem hiding this comment.
Why copy the context twice?
There was a problem hiding this comment.
Just call .with_context(date=line.date), there's no need to do any context copy.
There was a problem hiding this comment.
That strikes me as a pointless optimisation, the only thing it potentially saves is a rounding (which you can disable with round=True anyway).
There was a problem hiding this comment.
Why not call it domain? And why the list conversion?
There was a problem hiding this comment.
I can't call it domain since there's already a parameter named domain, the list is pointless ?
Should I do ?
__domain = '__domain' in line and line['__domain'] or []1f49cd4 to
2af953c
Compare
b4664c6 to
eeaec6c
Compare
- Categories can now be set to analytic account. - Analytic tags can now be used on journal entries without the need to activate analytic acounting. task: https://www.odoo.com/web#id=32386&view_type=form&model=project.task&action=333&active_id=967&menu_id=4720
- Added the ability to create a hierarchy to categories. - Analytic tags are now fully independent to Analytic Accounting and can be activited through the settings.
…cy/multi-company. - Added Analytic Distribution to analytic tags, Analytic Accounting and Analytic Tags must be activated. - Analytic moves are now linked to the user's company. - Analytic Analysis & analytic move are now expressed in user's currency. - Analytic Accounts do not require anymore linking them to a company.
- Added the ability to use analytic tags on analytic default. - Removed field 'analytic_amount_currency' from account analytic line.
- The childrens are now displayed anymore for categories. - The categories are now displayed with this format 'Parent n°1 / Parent n°2 / Parent n°X / Name'
eeaec6c to
4a6530c
Compare
…ies can now be set to analytic account. - Analytic tags can now be used on journal entries without the need to activate analytic acounting.
Task
https://www.odoo.com/web#id=32386&view_type=form&model=project.task&action=333&active_id=967&menu_id=4720
PR: https://github.com/odoo/enterprise/pull/1100
PR: #17499