-
Notifications
You must be signed in to change notification settings - Fork 23.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] account: avoid adding an extra group_by to break method signatu… #51497
base: master
Are you sure you want to change the base?
Conversation
…re (and offset, limits) [IMP] account: account.invoice.report SPEED IMPROVEMENT: removed 4 unused JOIN clauses [IMP] account: account.invoice.report removed unnecessary fields currency_id: makes no sense as the values are not in this currency; confusing commercial_partner_id: users don't even know the difference with partner_id quantities: reference to "Reference UoM" instead of "Product UoM" LRU Cache is risky, if more than 32 currencies (probably not, but still)
It can't work because the SQL view doesn't depend on the context ( |
Actually we may give a shot to the following:
(the LEFT JOIN on the currency table may need to be reworked, but as is it seems to work) This way, you duplicate all lines of the report that you filter in the def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
result = super(AccountInvoiceReport, self).read_group(domain+[('company_to_id','=',self.env.company.id)], fields, groupby, offset, limit, orderby, False)
return result |
Ah, I went too quickly. It is a good idea indeed. |
We can also round the values in the SQL query so that we don't need the rounding part in the |
note to myself:
|
[FIX] account: avoid adding an extra group_by to break method signature (and offset, limits)
[IMP] account: account.invoice.report SPEED IMPROVEMENT: removed 4 unused JOIN clauses
[IMP] account: account.invoice.report removed unnecessary fields:
currency_id: makes no sense as the values are not in this currency; confusing
commercial_partner_id: users don't even know the difference with partner_id
quantities: normalize to "Reference UoM" for the category instead of "Product UoM"
LRU Cache is risky, if more than 32 currencies (probably not, but still)
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr