Use integer without grouping for year reporting
issue10731 review355501002
This commit is contained in:
1 parent
8db518f263
commit
c762768ebe
3 files changed
+6
-10
No files matched your search
+4
-8
@@ -692,7 +692,7 @@ class SaleOpportunityEmployeeContext(ModelView):
|
|||||||
class SaleOpportunityMonthly(SaleOpportunityReportMixin, ModelSQL, ModelView):
|
class SaleOpportunityMonthly(SaleOpportunityReportMixin, ModelSQL, ModelView):
|
||||||
'Sale Opportunity per Month'
|
'Sale Opportunity per Month'
|
||||||
__name__ = 'sale.opportunity_monthly'
|
__name__ = 'sale.opportunity_monthly'
|
||||||
year = fields.Char('Year')
|
year = fields.Integer("Year")
|
||||||
month = fields.Many2One('ir.calendar.month', "Month")
|
month = fields.Many2One('ir.calendar.month', "Month")
|
||||||
year_month = fields.Function(fields.Char('Year-Month'),
|
year_month = fields.Function(fields.Char('Year-Month'),
|
||||||
'get_year_month')
|
'get_year_month')
|
||||||
@@ -714,9 +714,7 @@ class SaleOpportunityMonthly(SaleOpportunityReportMixin, ModelSQL, ModelView):
|
|||||||
query = super(SaleOpportunityMonthly, cls).table_query()
|
query = super(SaleOpportunityMonthly, cls).table_query()
|
||||||
opportunity, = query.from_
|
opportunity, = query.from_
|
||||||
type_id = cls.id.sql_type().base
|
type_id = cls.id.sql_type().base
|
||||||
type_year = cls.year.sql_type().base
|
year_column = Extract('YEAR', opportunity.start_date).as_('year')
|
||||||
year_column = Extract('YEAR', opportunity.start_date
|
|
||||||
).cast(type_year).as_('year')
|
|
||||||
month_index = Extract('MONTH', opportunity.start_date)
|
month_index = Extract('MONTH', opportunity.start_date)
|
||||||
query.from_ = opportunity.join(
|
query.from_ = opportunity.join(
|
||||||
month, condition=month_index == month.index)
|
month, condition=month_index == month.index)
|
||||||
@@ -734,7 +732,7 @@ class SaleOpportunityEmployeeMonthly(
|
|||||||
SaleOpportunityReportMixin, ModelSQL, ModelView):
|
SaleOpportunityReportMixin, ModelSQL, ModelView):
|
||||||
'Sale Opportunity per Employee per Month'
|
'Sale Opportunity per Employee per Month'
|
||||||
__name__ = 'sale.opportunity_employee_monthly'
|
__name__ = 'sale.opportunity_employee_monthly'
|
||||||
year = fields.Char('Year')
|
year = fields.Integer("Year")
|
||||||
month = fields.Many2One('ir.calendar.month', "Month")
|
month = fields.Many2One('ir.calendar.month', "Month")
|
||||||
employee = fields.Many2One('company.employee', 'Employee')
|
employee = fields.Many2One('company.employee', 'Employee')
|
||||||
|
|
||||||
@@ -753,9 +751,7 @@ class SaleOpportunityEmployeeMonthly(
|
|||||||
query = super(SaleOpportunityEmployeeMonthly, cls).table_query()
|
query = super(SaleOpportunityEmployeeMonthly, cls).table_query()
|
||||||
opportunity, = query.from_
|
opportunity, = query.from_
|
||||||
type_id = cls.id.sql_type().base
|
type_id = cls.id.sql_type().base
|
||||||
type_year = cls.year.sql_type().base
|
year_column = Extract('YEAR', opportunity.start_date).as_('year')
|
||||||
year_column = Extract('YEAR', opportunity.start_date
|
|
||||||
).cast(type_year).as_('year')
|
|
||||||
month_index = Extract('MONTH', opportunity.start_date)
|
month_index = Extract('MONTH', opportunity.start_date)
|
||||||
query.from_ = opportunity.join(
|
query.from_ = opportunity.join(
|
||||||
month, condition=month_index == month.index)
|
month, condition=month_index == month.index)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||||
this repository contains the full copyright notices and license terms. -->
|
this repository contains the full copyright notices and license terms. -->
|
||||||
<tree>
|
<tree>
|
||||||
<field name="year"/>
|
<field name="year" grouping="0"/>
|
||||||
<field name="month" widget="selection"/>
|
<field name="month" widget="selection"/>
|
||||||
<field name="employee" expand="1"/>
|
<field name="employee" expand="1"/>
|
||||||
<field name="number"/>
|
<field name="number"/>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||||
this repository contains the full copyright notices and license terms. -->
|
this repository contains the full copyright notices and license terms. -->
|
||||||
<tree>
|
<tree>
|
||||||
<field name="year"/>
|
<field name="year" grouping="0"/>
|
||||||
<field name="month" widget="selection"/>
|
<field name="month" widget="selection"/>
|
||||||
<field name="number"/>
|
<field name="number"/>
|
||||||
<field name="converted"/>
|
<field name="converted"/>
|
||||||
|
|||||||
Reference in new issue
Block a user