Merged from lp:~openerp-dev/openobject-addons/trunk-dev-reporting.
bzr revid: apa@tinyerp.com-20100521100729-9g2963splsd9yzzx
This commit is contained in:
@@ -107,8 +107,11 @@ module named account_voucherss
|
||||
'company_view.xml',
|
||||
'account_installer.xml',
|
||||
'report/account_invoice_report_view.xml',
|
||||
'report/account_entries_report_view.xml',
|
||||
'report/account_report_view.xml',
|
||||
'report/account_analytic_report_view.xml',
|
||||
'report/account_account_report_view.xml',
|
||||
'report/account_analytic_entries_report_view.xml'
|
||||
],
|
||||
'demo_xml': [
|
||||
#'demo/price_accuracy00.yml',
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
groups="group_account_user"/>
|
||||
<menuitem id="menu_account_end_year_treatments" name="End of Year Treatments" parent="account.menu_finance_periodical_processing" sequence="20"/>
|
||||
|
||||
<menuitem id="menu_finance_statastic_report_statement" name="Satistic Reports" parent="account.menu_finance_reporting" sequence="3"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ import compare_account_balance
|
||||
import account_invoice_report
|
||||
import account_report
|
||||
import account_analytic_report
|
||||
|
||||
import account_account_report
|
||||
import account_entries_report
|
||||
import account_analytic_entries_report
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import tools
|
||||
from osv import fields,osv
|
||||
|
||||
class account_account_report(osv.osv):
|
||||
_name = "account.account.report"
|
||||
_description = "Account Report"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=128, readonly=True),
|
||||
'code': fields.char('Code', size=64, readonly=True),
|
||||
'type': fields.selection([
|
||||
('receivable', 'Receivable'),
|
||||
('payable', 'Payable'),
|
||||
('view', 'View'),
|
||||
('consolidation', 'Consolidation'),
|
||||
('other', 'Others'),
|
||||
('closed', 'Closed'),
|
||||
], 'Internal Type', readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'currency_mode': fields.selection([('current', 'At Date'), ('average', 'Average Rate')], 'Outgoing Currencies Rate',readonly=True),
|
||||
'user_type': fields.many2one('account.account.type', 'Account Type',readonly=True),
|
||||
'quantity': fields.float('Quantity', readonly=True),
|
||||
'amount_total': fields.float('Total Amount', readonly=True),
|
||||
'credit': fields.float('Credit', readonly=True),
|
||||
'debit': fields.float('Debit', readonly=True),
|
||||
'balance': fields.float('Balance', readonly=True),
|
||||
'nbr': fields.integer('#Accounts', readonly=True),
|
||||
'parent_account_id': fields.many2one('account.account', 'Parent Account', required=True),
|
||||
}
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'account_account_report')
|
||||
cr.execute("""
|
||||
create or replace view account_account_report as (
|
||||
select
|
||||
min(a.id) as id,
|
||||
count(distinct a.id) as nbr,
|
||||
a.name,
|
||||
a.code,
|
||||
a.type as type,
|
||||
a.company_id as company_id,
|
||||
a.currency_mode as currency_mode,
|
||||
a.user_type as user_type,
|
||||
a.parent_id as parent_account_id,
|
||||
sum(ail.quantity) as quantity,
|
||||
sum(ail.price_subtotal) as amount_total,
|
||||
sum(m.credit) as credit,
|
||||
sum(m.debit) as debit,
|
||||
(sum(m.credit)-sum(m.debit)) as balance
|
||||
from
|
||||
account_account as a
|
||||
left join account_move_line as m on m.account_id=a.id
|
||||
left join account_invoice_line as ail on ail.account_id=a.id
|
||||
left join account_invoice as ai on ai.account_id=a.id
|
||||
group by
|
||||
a.name,
|
||||
a.code,
|
||||
a.type,
|
||||
a.company_id,
|
||||
a.currency_mode,
|
||||
a.user_type,
|
||||
m.account_id,
|
||||
a.parent_id
|
||||
)
|
||||
""")
|
||||
account_account_report()
|
||||
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_account_account_report_tree" model="ir.ui.view">
|
||||
<field name="name">account.account.report.tree</field>
|
||||
<field name="model">account.account.report</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Account Report">
|
||||
<field name="name" invisible="1" string="Account"/>
|
||||
<field name="code" invisible="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="company_id" invisible="1" group="base.multi_company"/>
|
||||
<field name="currency_mode" invisible="1"/>
|
||||
<field name="nbr" sum="#Accounts"/>
|
||||
<field name="user_type" invisible="1"/>
|
||||
<field name="parent_account_id" invisible="1"/>
|
||||
<field name="quantity" sum="Quantity"/>
|
||||
<field name="amount_total" sum="Total Amount"/>
|
||||
<field name="credit" sum="Credit"/>
|
||||
<field name="debit" sum="Debit"/>
|
||||
<field name="balance" sum="Balance"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_account_report_graph" model="ir.ui.view">
|
||||
<field name="name">account.account.report.graph</field>
|
||||
<field name="model">account.account.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Accounts" type="bar">
|
||||
<field name="name"/>
|
||||
<field name="credit" operator="+"/>
|
||||
<field name="debit" operator="+"/>
|
||||
<field name="balance" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_account_report_search" model="ir.ui.view">
|
||||
<field name="name">account.account.report.search</field>
|
||||
<field name="model">account.account.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Accounts">
|
||||
<group>
|
||||
<filter icon="terp-account"
|
||||
string="At Date"
|
||||
domain="[('currency_mode','=', 'current')]"/>
|
||||
<filter icon="terp-account"
|
||||
string="Average Rate"
|
||||
domain="[('currency_mode','=','average')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" string="Account"/>
|
||||
<field name="code"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<field name="type" />
|
||||
<field name="user_type" widget="selection"/>
|
||||
<field name="parent_account_id" />
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Account" name="Account" icon="terp-account" context="{'group_by':'name'}"/>
|
||||
<filter string="Code" icon="terp-account" context="{'group_by':'code'}"/>
|
||||
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Currencies Rate" icon="terp-account" context="{'group_by':'currency_mode'}"/>
|
||||
<filter string="Internal Type" icon="terp-account" context="{'group_by':'type'}"/>
|
||||
<filter string="Account Type" icon="terp-account" context="{'group_by':'user_type'}"/>
|
||||
<filter string="Parent Account" icon="terp-account" context="{'group_by':'parent_account_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_account_report" model="ir.actions.act_window">
|
||||
<field name="name">Accounts</field>
|
||||
<field name="res_model">account.account.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{"search_default_Account":1,"search_default_At Date":1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="search_view_id" ref="view_account_account_report_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_account_report" id="menu_action_account_account_report" parent="account.menu_finance_statastic_report_statement" sequence="6"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,83 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import tools
|
||||
from osv import fields,osv
|
||||
|
||||
class analytic_entries_report(osv.osv):
|
||||
_name = "analytic.entries.report"
|
||||
_description = "Analytic Entries Statistics"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
|
||||
'user_id' : fields.many2one('res.users', 'User',readonly=True),
|
||||
'name': fields.char('Description', size=64, readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', required=True),
|
||||
'account_id': fields.many2one('account.analytic.account', 'Account', required=True),
|
||||
'general_account_id': fields.many2one('account.account', 'General Account', required=True),
|
||||
'journal_id': fields.many2one('account.analytic.journal', 'Journal', required=True),
|
||||
'move_id': fields.many2one('account.move.line', 'Move', required=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', required=True),
|
||||
'product_uom_id': fields.many2one('product.uom', 'Product UOM', required=True),
|
||||
'amount': fields.float('Amount', readonly=True),
|
||||
'unit_amount': fields.float('Unit Amount', readonly=True),
|
||||
'amount_currency': fields.float('Amount Currency', readonly=True),
|
||||
'nbr': fields.integer('#Entries', readonly=True),
|
||||
}
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'analytic_entries_report')
|
||||
cr.execute("""
|
||||
create or replace view analytic_entries_report as (
|
||||
select
|
||||
min(a.id) as id,
|
||||
count(distinct a.id) as nbr,
|
||||
a.create_date as date,
|
||||
to_char(a.create_date, 'YYYY') as year,
|
||||
to_char(a.create_date, 'MM') as month,
|
||||
to_char(a.create_date, 'YYYY-MM-DD') as day,
|
||||
a.user_id as user_id,
|
||||
a.name as name,
|
||||
a.company_id as company_id,
|
||||
a.currency_id as currency_id,
|
||||
a.account_id as account_id,
|
||||
a.general_account_id as general_account_id,
|
||||
a.journal_id as journal_id,
|
||||
a.move_id as move_id,
|
||||
a.product_id as product_id,
|
||||
a.product_uom_id as product_uom_id,
|
||||
sum(a.amount) as amount,
|
||||
sum(a.unit_amount) as unit_amount,
|
||||
sum(a.amount_currency) as amount_currency
|
||||
from
|
||||
account_analytic_line a
|
||||
group by
|
||||
a.create_date, a.user_id,a.name,company_id,a.currency_id,
|
||||
a.account_id,a.general_account_id,a.journal_id,
|
||||
a.move_id,a.product_id,a.product_uom_id
|
||||
)
|
||||
""")
|
||||
analytic_entries_report()
|
||||
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_analytic_entries_report_tree" model="ir.ui.view">
|
||||
<field name="name">analytic.entries.report.tree</field>
|
||||
<field name="model">analytic.entries.report</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Analytic Entries Statistics">
|
||||
<field name="date" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="company_id" invisible="1" groups="base.multi_company"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="account_id" invisible="1"/>
|
||||
<field name="general_account_id" invisible="1"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="product_uom_id" invisible="1"/>
|
||||
<field name="nbr" sum="Entries"/>
|
||||
<field name="amount" sum="Amount"/>
|
||||
<field name="unit_amount" sum="Unit Amount"/>
|
||||
<field name="amount_currency" sum="Amount Currency"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_analytic_entries_report_search" model="ir.ui.view">
|
||||
<field name="name">analytic.entries.report.search</field>
|
||||
<field name="model">analytic.entries.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Analytic Entries">
|
||||
<group col="10" colspan="12">
|
||||
<filter icon="terp-account" string="Last 365 DAys"
|
||||
domain="[('day','<=', time.strftime('%%Y-%%m-%%d')),('day','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Analytic Entries of the year"/>
|
||||
<filter icon="terp-account" string="Last 30 Days"
|
||||
name="month"
|
||||
domain="[('day','<=', time.strftime('%%Y-%%m-%%d')), ('day','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Analytic Entries of this month"/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days "
|
||||
separator="1"
|
||||
domain="[('day','<=', time.strftime('%%Y-%%m-%%d')), ('day','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Analytic Entries during last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-partner" domain="[('user_id','=',uid)]" help="My Case"/>
|
||||
</field>
|
||||
<field name="currency_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<field name="account_id" />
|
||||
<field name="general_account_id" widget="selection"/>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="product_id" />
|
||||
<field name="product_uom_id" widget="selection"/>
|
||||
<field name="company_id" widget="selection" groups="base.multi_company"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="User" name="User" icon="terp-account" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Currency" icon="terp-account" context="{'group_by':'currency_id'}"/>
|
||||
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.multi_company"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Account" icon="terp-account" context="{'group_by':'account_id'}"/>
|
||||
<filter string="General Account" icon="terp-account" context="{'group_by':'general_account_id'}"/>
|
||||
<filter string="Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Product UOM" icon="terp-account" context="{'group_by':'product_uom_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-account" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-account" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_analytic_entries_search" model="ir.ui.view">
|
||||
<field name="name">account.analytic.entries.graph</field>
|
||||
<field name="model">analytic.entries.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Analytic Entries" type="bar">
|
||||
<field name="user_id"/>
|
||||
<field name="amount" operator="+"/>
|
||||
<field name="unit_amount" operator="+"/>
|
||||
<field name="amount_currency" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_analytic_entries_report" model="ir.actions.act_window">
|
||||
<field name="name">Analytic Entries</field>
|
||||
<field name="res_model">analytic.entries.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="search_view_id" ref="view_analytic_entries_report_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_analytic_entries_report" id="menu_action_analytic_entries_report" parent="account.menu_finance_statastic_report_statement" sequence="4"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -35,7 +35,7 @@ class analytic_report(osv.osv):
|
||||
'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', readonly=True),
|
||||
'user_id' : fields.many2one('res.users', 'Account Manager',readonly=True),
|
||||
'product_id' : fields.many2one('product.product', 'Product',readonly=True),
|
||||
'quantity': fields.float('Quantity',readonly=True),
|
||||
'total_quantity': fields.float('# Total Quantity',readonly=True),
|
||||
'debit' : fields.float('Debit',readonly=True),
|
||||
'credit' : fields.float('Credit',readonly=True),
|
||||
'balance' : fields.float('Balance',readonly=True),
|
||||
@@ -43,6 +43,11 @@ class analytic_report(osv.osv):
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'nbr':fields.integer('# of Lines', readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'type': fields.selection([('view','View'), ('normal','Normal')], 'Account Type'),
|
||||
|
||||
'state': fields.selection([('draft','Draft'),
|
||||
('open','Open'),
|
||||
('pending','Pending'),
|
||||
@@ -50,6 +55,7 @@ class analytic_report(osv.osv):
|
||||
('close','Close'),
|
||||
('template', 'Template')],
|
||||
'State', readonly=True),
|
||||
|
||||
}
|
||||
_order = 'date_start desc'
|
||||
def init(self, cr):
|
||||
@@ -60,15 +66,18 @@ class analytic_report(osv.osv):
|
||||
min(s.id) as id,
|
||||
to_char(s.create_date, 'YYYY') as year,
|
||||
to_char(s.create_date, 'MM') as month,
|
||||
to_char(s.create_date, 'YYYY-MM-DD') as day,
|
||||
l.journal_id,
|
||||
l.product_id,
|
||||
s.parent_id,
|
||||
s.date_start,
|
||||
s.date as date_end,
|
||||
s.user_id,
|
||||
s.company_id,
|
||||
s.type,
|
||||
s.name,
|
||||
s.partner_id,
|
||||
s.quantity,
|
||||
sum(s.quantity) as total_quantity,
|
||||
s.debit,
|
||||
s.credit,
|
||||
s.balance,
|
||||
@@ -77,7 +86,8 @@ class analytic_report(osv.osv):
|
||||
from account_analytic_account s
|
||||
left join account_analytic_line l on (s.id=l.account_id)
|
||||
GROUP BY s.create_date,s.state,l.journal_id,s.name,
|
||||
s.partner_id,s.date_start,s.date,s.user_id,s.quantity,
|
||||
s.partner_id,s.date_start,s.date,s.user_id,
|
||||
s.company_id,s.type,
|
||||
s.debit,s.credit,s.balance,s.parent_id,l.product_id
|
||||
)
|
||||
""")
|
||||
|
||||
@@ -9,23 +9,26 @@
|
||||
<tree string="Analytic Accounts Statistics">
|
||||
<field name="parent_id" invisible="1" string="Analytic Account"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="journal_id" string="Analytic Journal"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
<field name="quantity"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="journal_id" string="Analytic Journal" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="date_start" invisible="1"/>
|
||||
<field name="date_end" invisible="1"/>
|
||||
<field name="total_quantity" sum=" # Total Quantity"/>
|
||||
<field name="nbr" sum ="# of Lines"/>
|
||||
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="debit"/>
|
||||
<field name="credit"/>
|
||||
<field name="balance"/>
|
||||
<field name="state"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_analytic_report_search" model="ir.ui.view">
|
||||
<field name="name">analytic.report.search</field>
|
||||
<field name="model">analytic.report</field>
|
||||
@@ -38,18 +41,15 @@
|
||||
domain="[('year','=',time.strftime('%%Y'))]"/>
|
||||
<filter icon="terp-account"
|
||||
string="This Month"
|
||||
name="This Month"
|
||||
domain="[('month','=',time.strftime('%%m'))]"/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days "
|
||||
separator="1"
|
||||
domain="[('day','<=', time.strftime('%%Y-%%m-%%d')), ('day','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Entries during last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Start" icon="terp-account" domain="[('date_start','=',time.strftime('%%Y/%%m/%%d'))]"/>
|
||||
<filter string="End" icon="terp-account" domain="[('date_end','=',time.strftime('%%Y/%%m/%%d'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="user_id" widget="selection"/>
|
||||
<field name="partner_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-account"
|
||||
<filter icon="terp-account"
|
||||
string="Draft"
|
||||
domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-account"
|
||||
@@ -58,6 +58,18 @@
|
||||
<filter icon="terp-account"
|
||||
string="Pending"
|
||||
domain="[('state','=','pending')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-account"
|
||||
string="My Accounts"
|
||||
help="My Account"
|
||||
domain="[('user_id','=',uid)]"/>
|
||||
</field>
|
||||
<field name="partner_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-account"
|
||||
string="Close"
|
||||
domain="[('state','=','close')]"/>
|
||||
@@ -65,40 +77,59 @@
|
||||
string="Template"
|
||||
domain="[('state','=','template')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<newline/>
|
||||
<field name="product_id" />
|
||||
<field name="type"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="User" name='User' icon="terp-account" context="{'group_by':'user_id'}"/>
|
||||
<filter string="User" name="User" icon="terp-account" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Associated Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Analytic Account" icon="terp-account" context="{'group_by':'parent_id'}"/>
|
||||
<filter string="Analytic Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Analytic Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Analytic Account" icon="terp-account" context="{'group_by':'parent_id'}"/>
|
||||
<filter string="Account Type" icon="terp-account" context="{'group_by':'type'}"/>
|
||||
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-account" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-account" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_analytic_report_search" model="ir.ui.view">
|
||||
<field name="name">account.analytic.report.graph</field>
|
||||
<field name="model">analytic.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Analytic Accounts" type="bar">
|
||||
<field name="user_id"/>
|
||||
<field name="credit" operator="+"/>
|
||||
<field name="debit" operator="+"/>
|
||||
<field name="balance" operator="+"/>
|
||||
<field name="nbr" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_analytic_report_all" model="ir.actions.act_window">
|
||||
<field name="name">Analytic Accounts</field>
|
||||
<field name="res_model">analytic.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="context">{'search_default_User':1,'search_default_user_id':uid}</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{'search_default_This Month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="search_view_id" ref="view_analytic_report_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_analytic_report_all" id="menu_action_analytic_report_all" parent="account.menu_finance_reporting" sequence="0"/>
|
||||
<menuitem action="action_analytic_report_all" id="menu_action_analytic_report_all" parent="account.menu_finance_statastic_report_statement" sequence="8"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import tools
|
||||
from osv import fields,osv
|
||||
|
||||
class account_entries_report(osv.osv):
|
||||
_name = "account.entries.report"
|
||||
_description = "Entries"
|
||||
_auto = False
|
||||
_rec_name = 'date'
|
||||
_columns = {
|
||||
'date': fields.date('Effective Date', readonly=True),
|
||||
'date_created': fields.date('Date Created', readonly=True),
|
||||
'date_maturity': fields.date('Date Maturity', readonly=True),
|
||||
'nbr':fields.integer('# of Entries', readonly=True),
|
||||
'nbl':fields.integer('# of Lines', readonly=True),
|
||||
'amount': fields.float('Amount',readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
|
||||
'ref': fields.char('Reference', size=64,readonly=True),
|
||||
'period_id': fields.many2one('account.period', 'Period', readonly=True),
|
||||
'account_id': fields.many2one('account.account', 'Account', readonly=True),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', readonly=True),
|
||||
'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'State',readonly=True,
|
||||
help='When new account move is created the state will be \'Draft\'. When all the payments are done it will be in \'Posted\' state.'),
|
||||
'state_2': fields.selection([('draft','Draft'), ('valid','Valid')], 'State of Move Line', readonly=True,
|
||||
help='When new move line is created the state will be \'Draft\'.\n* When all the payments are done it will be in \'Valid\' state.'),
|
||||
'partner_id': fields.many2one('res.partner','Partner', readonly=True),
|
||||
'period_id2': fields.many2one('account.period', 'Move Line Period', readonly=True),
|
||||
'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
|
||||
'journal_id2': fields.many2one('account.journal', 'Move Line Journal', readonly=True),
|
||||
'type': fields.selection([
|
||||
('pay_voucher','Cash Payment'),
|
||||
('bank_pay_voucher','Bank Payment'),
|
||||
('rec_voucher','Cash Receipt'),
|
||||
('bank_rec_voucher','Bank Receipt'),
|
||||
('cont_voucher','Contra'),
|
||||
('journal_sale_vou','Journal Sale'),
|
||||
('journal_pur_voucher','Journal Purchase'),
|
||||
('journal_voucher','Journal Voucher'),
|
||||
],'Type',readonly=True),
|
||||
'quantity': fields.float('Products Quantity', digits=(16,2), readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
}
|
||||
_order = 'date desc'
|
||||
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'account_entries_report')
|
||||
cr.execute("""
|
||||
create or replace view account_entries_report as (
|
||||
select
|
||||
min(l.id) as id,
|
||||
am.ref as ref,
|
||||
sum(l.quantity) as quantity,
|
||||
am.state as state,
|
||||
l.state as state_2,
|
||||
am.date as date,
|
||||
count(l.id) as nbr,
|
||||
count(distinct am.id) as nbl,
|
||||
l.debit as amount,
|
||||
to_char(am.date, 'YYYY') as year,
|
||||
to_char(am.date, 'MM') as month,
|
||||
to_char(am.date, 'YYYY-MM-DD') as day,
|
||||
am.company_id as company_id,
|
||||
l.account_id as account_id,
|
||||
l.analytic_account_id as analytic_account_id,
|
||||
l.date_created as date_created,
|
||||
l.date_maturity as date_maturity,
|
||||
am.journal_id as journal_id,
|
||||
l.journal_id as journal_id2,
|
||||
l.period_id as period_id2,
|
||||
am.period_id as period_id,
|
||||
l.partner_id as partner_id,
|
||||
l.product_id as product_id,
|
||||
am.type as type
|
||||
from
|
||||
account_move_line l
|
||||
left join
|
||||
account_move am on (am.id=l.move_id)
|
||||
group by am.ref,
|
||||
am.state,
|
||||
am.date,
|
||||
am.company_id,
|
||||
am.journal_id,
|
||||
l.journal_id,
|
||||
am.period_id,
|
||||
l.period_id,
|
||||
am.type,
|
||||
l.partner_id,
|
||||
l.analytic_account_id,
|
||||
l.product_id,
|
||||
l.date_created,
|
||||
l.date_maturity,
|
||||
l.account_id,
|
||||
l.state,
|
||||
l.debit
|
||||
)
|
||||
""")
|
||||
|
||||
account_entries_report()
|
||||
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_account_entries_report_tree" model="ir.ui.view">
|
||||
<field name="name">account.entries.report.tree</field>
|
||||
<field name="model">account.entries.report</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Invoices Statistics">
|
||||
<field name="date" invisible="1"/>
|
||||
<field name="date_created" invisible="1"/>
|
||||
<field name="date_maturity" invisible="1"/>
|
||||
<field name="ref" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="state_2" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
<field name="account_id" invisible="1"/>
|
||||
<field name="analytic_account_id" invisible="1"/>
|
||||
<field name="period_id" invisible="1"/>
|
||||
<field name="period_id2" invisible="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="nbr" sum="# of Entries "/>
|
||||
<field name="nbl" sum="# of Lines "/>
|
||||
<field name="amount" sum="# of Amount "/>
|
||||
<field name="quantity" sum="# of Products Qty "/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_entries_report_graph" model="ir.ui.view">
|
||||
<field name="name">account.entries.report.graph</field>
|
||||
<field name="model">account.entries.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Entries" type="bar">
|
||||
<field name="partner_id"/>
|
||||
<field name="amount"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_entries_report_search" model="ir.ui.view">
|
||||
<field name="name">account.entries.report.search</field>
|
||||
<field name="model">account.entries.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Entries">
|
||||
<group colspan="10" col="12">
|
||||
<filter icon="terp-account" string="This Year"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Entries of the year"/>
|
||||
<filter icon="terp-account" string="This Month"
|
||||
name="This Month"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Entries of this month"/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days "
|
||||
separator="1"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Entries during last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Draft"
|
||||
icon="terp-account"
|
||||
domain="[('state','=','draft')]"
|
||||
help = "Draft tasks"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<field name="account_id"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<field name="partner_id" />
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter string="Posted"
|
||||
icon="terp-account"
|
||||
domain="[('state','=','posted')]"
|
||||
help = "Posted tasks"/>
|
||||
<field name="state_2"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="period_id" widget="selection"/>
|
||||
<field name="period_id2" widget="selection"/>
|
||||
<field name="type"/>
|
||||
<field name="product_id" />
|
||||
<field name="analytic_account_id"/>
|
||||
<newline/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_created"/>
|
||||
<field name="date"/>
|
||||
<field name="date_maturity"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Journal" name="Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Account" name="Account" icon="terp-account" context="{'group_by':'account_id'}"/>
|
||||
<filter string="Analytic Account" name="Analytic Account" icon="terp-account" context="{'group_by':'analytic_account_id'}"/>
|
||||
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
|
||||
<filter string="State of Move Line" icon="terp-account" context="{'group_by':'state_2'}"/>
|
||||
<filter string="Period" icon="terp-account" context="{'group_by':'period_id'}"/>
|
||||
<filter string="Period of Move Line" icon="terp-account" context="{'group_by':'period_id2'}"/>
|
||||
<filter string="Type" icon="terp-account" context="{'group_by':'type'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-account" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-account" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_account_entries_report_all" model="ir.actions.act_window">
|
||||
<field name="name">Entries</field>
|
||||
<field name="res_model">account.entries.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{'search_default_This Month':1,'search_default_Journal':1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="search_view_id" ref="view_account_entries_report_search"/>
|
||||
</record>
|
||||
<menuitem action="action_account_entries_report_all" id="menu_action_account_entries_report_all" parent="account.menu_finance_statastic_report_statement" sequence="2"/>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -61,6 +61,13 @@ class account_invoice_report(osv.osv):
|
||||
('paid','Done'),
|
||||
('cancel','Cancelled')
|
||||
], 'Order State', readonly=True),
|
||||
'date_due': fields.date('Due Date', readonly=True),
|
||||
'address_contact_id': fields.many2one('res.partner.address', 'Contact Address Name', readonly=True),
|
||||
'address_invoice_id': fields.many2one('res.partner.address', 'Invoice Address Name', readonly=True),
|
||||
'account_id': fields.many2one('account.account', 'Account',readonly=True),
|
||||
'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',readonly=True),
|
||||
'residual':fields.float('Total Residual', readonly=True),
|
||||
'delay_to_pay':fields.float('Avg. Delay To Pay', readonly=True, group_operator="avg"),
|
||||
}
|
||||
_order = 'date desc'
|
||||
def init(self, cr):
|
||||
@@ -87,12 +94,24 @@ class account_invoice_report(osv.osv):
|
||||
(sum(l.quantity*l.price_unit)/sum(l.quantity * u.factor))::decimal(16,2) as price_average,
|
||||
count(*) as nbr,
|
||||
s.type as type,
|
||||
s.state
|
||||
from
|
||||
s.state,
|
||||
s.date_due as date_due,
|
||||
s.address_contact_id as address_contact_id,
|
||||
s.address_invoice_id as address_invoice_id,
|
||||
s.account_id as account_id,
|
||||
s.partner_bank as partner_bank,
|
||||
s.residual as residual,
|
||||
case when s.state != 'paid' then null else
|
||||
extract(epoch from avg(am.date_created-l.create_date))/(24*60*60)::decimal(16,2)
|
||||
end as delay_to_pay
|
||||
from
|
||||
account_invoice_line l
|
||||
left join
|
||||
account_invoice s on (s.id=l.invoice_id)
|
||||
left join product_uom u on (u.id=l.uos_id)
|
||||
left join product_uom u on (u.id=l.uos_id),
|
||||
account_move_line am left join account_invoice i on (i.move_id=am.move_id)
|
||||
where
|
||||
am.account_id=i.account_id
|
||||
group by
|
||||
s.type,
|
||||
s.date_invoice,
|
||||
@@ -101,12 +120,18 @@ class account_invoice_report(osv.osv):
|
||||
l.uos_id,
|
||||
s.user_id,
|
||||
s.state,
|
||||
s.residual,
|
||||
s.company_id,
|
||||
s.payment_term,
|
||||
s.period_id,
|
||||
s.fiscal_position,
|
||||
s.currency_id,
|
||||
s.journal_id
|
||||
s.journal_id,
|
||||
s.date_due,
|
||||
s.address_contact_id,
|
||||
s.address_invoice_id,
|
||||
s.account_id,
|
||||
s.partner_bank
|
||||
)
|
||||
""")
|
||||
account_invoice_report()
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
<field name="fiscal_position" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
<field name="date_due" invisible="1"/>
|
||||
<field name="address_contact_id" invisible="1"/>
|
||||
<field name="address_invoice_id" invisible="1"/>
|
||||
<field name="account_id" invisible="1"/>
|
||||
<field name="partner_bank" invisible="1"/>
|
||||
<field name="residual" sum="Total Residual"/>
|
||||
<field name="delay_to_pay" avg="Avg. Delay To Pay"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -49,7 +56,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Invoices">
|
||||
<group>
|
||||
<group col="10" colspan="12">
|
||||
<filter icon="terp-account" string="This Year"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Invoices of the year"/>
|
||||
@@ -76,7 +83,6 @@
|
||||
domain="[('state', '=' ,'open')]"
|
||||
help = "In progress tasks"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="product_id"/>
|
||||
<field name="user_id" widget="selection">
|
||||
|
||||
<filter icon="terp-account"
|
||||
@@ -84,6 +90,7 @@
|
||||
help="Invoices Non Users"
|
||||
domain="[('user_id','=',False)]"/>
|
||||
</field>
|
||||
<field name="product_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
@@ -98,34 +105,50 @@
|
||||
domain="[('state', '=' ,'cancel')]"
|
||||
help = "Cancelled tasks"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="type"/>
|
||||
<field name="payment_term" widget="selection"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="currency_id" widget="selection"/>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<newline/>
|
||||
<field name="type"/>
|
||||
<field name="address_contact_id"/>
|
||||
<field name="address_invoice_id"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="account_id"/>
|
||||
<field name="partner_bank" widget="selection"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="period_id" widget="selection"/>
|
||||
<field name="fiscal_position" widget="selection"/>
|
||||
<field name="date"/>
|
||||
<newline/>
|
||||
<field name="date" string="Date Invoiced"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_due"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Salesman" name='User' icon="terp-account" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
|
||||
<filter string="Type" icon="terp-account" context="{'group_by':'type'}"/>
|
||||
<filter string="Payment Term" icon="terp-account" context="{'group_by':'payment_term'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Currency" icon="terp-account" context="{'group_by':'currency_id'}"/>
|
||||
<filter string="Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Type" icon="terp-account" context="{'group_by':'type'}"/>
|
||||
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
|
||||
<filter string="Account" icon="terp-account" context="{'group_by':'account_id'}"/>
|
||||
<filter string="Bank Account" icon="terp-account" context="{'group_by':'partner_bank'}"/>
|
||||
<newline/>
|
||||
<filter string="Contact Address Name" icon="terp-account" context="{'group_by':'address_contact_id'}"/>
|
||||
<filter string="Invoice Address Name" icon="terp-account" context="{'group_by':'address_invoice_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Force Period" icon="terp-account" context="{'group_by':'period_id'}"/>
|
||||
<filter string="Fiscal Position" icon="terp-account" context="{'group_by':'fiscal_position'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-account" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-account" context="{'group_by':'date'}"/>
|
||||
<filter string="Month" icon="terp-account" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
@@ -141,7 +164,7 @@
|
||||
<field name="search_view_id" ref="view_account_invoice_report_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_invoice_report_all" id="menu_action_account_invoice_report_all" parent="account.menu_finance_reporting" sequence="0"/>
|
||||
<menuitem action="action_account_invoice_report_all" id="menu_action_account_invoice_report_all" parent="account.menu_finance_statastic_report_statement" sequence="0"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
</record>
|
||||
<menuitem action="action_account_receivable_graph" id="menu_account_receivable_graph" parent="account.menu_finance_reporting"/>
|
||||
<!-- <menuitem action="action_account_receivable_graph" id="menu_account_receivable_graph" parent="account.menu_finance_reporting"/> -->
|
||||
|
||||
<!-- Report for Aged Receivable -->
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
</record>
|
||||
|
||||
<!-- <menuitem id="menu_report_this_month" name="This Month" parent="account.menu_finance_reporting"/>-->
|
||||
<menuitem id="menu_report_all_months" name="Sales by Account" parent="account.menu_finance_reporting"/>
|
||||
<!-- <menuitem id="menu_report_all_months" name="Sales by Account" parent="account.menu_finance_reporting"/> -->
|
||||
<!-- Report of the sales by product and account -->
|
||||
<record id="view_report_account_sales_tree" model="ir.ui.view">
|
||||
<field name="name">report.account.sales.tree</field>
|
||||
@@ -169,7 +169,7 @@
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="search_view_id" ref="view_report_account_sales_search"/>
|
||||
</record>
|
||||
<menuitem action="action_report_account_sales_tree_all" id="menu_report_account_sales_all" parent="menu_report_all_months"/>
|
||||
<!-- <menuitem action="action_report_account_sales_tree_all" id="menu_report_account_sales_all" parent="menu_report_all_months"/> -->
|
||||
|
||||
<!-- Report of the sales by product and account type -->
|
||||
<record id="view_report_account_type_sales_tree" model="ir.ui.view">
|
||||
@@ -237,7 +237,7 @@
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="search_view_id" ref="view_report_account_type_sales_search"/>
|
||||
</record>
|
||||
<menuitem action="action_report_account_type_sales_tree_all" id="menu_report_account_type_sales_all" parent="menu_report_all_months"/>
|
||||
<!-- <menuitem action="action_report_account_type_sales_tree_all" id="menu_report_account_type_sales_all" parent="menu_report_all_months"/> -->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
'wizard/base_calendar_invite_attendee_view.xml',
|
||||
'base_calendar_view.xml'
|
||||
],
|
||||
"test" : ['test/base_calendar_test.yml'],
|
||||
# "test" : ['test/base_calendar_test.yml'],
|
||||
"installable" : True,
|
||||
"active" : False,
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<field name="name">My Expenses</field>
|
||||
<field name="res_model">hr.expense.expense</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain">[('state','=','draft'),('user_id','=',uid)]</field>
|
||||
<field name="domain">[('state','in',('draft', 'confirm')),('user_id','=',uid)]</field>
|
||||
<field name="view_id" ref="hr_expense.view_editable_expenses_tree"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -7,24 +7,72 @@
|
||||
<field name="res_model">project.issue</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('create_date', '>=', time.strftime('%Y-%m-%d 00:00:00')),('create_date', '<=', time.strftime('%Y-%m-%d 23:59:59'))]</field>
|
||||
<field name="domain">[('user_id','=',uid),('state','in',['draft','open'])]</field>
|
||||
<field name="view_id" ref="project_issue.project_issue_tree_view"/>
|
||||
</record>
|
||||
|
||||
<record id="action_view_pending_project_issue_tree" model="ir.actions.act_window">
|
||||
<field name="name">Project issues</field>
|
||||
<field name="res_model">project.issue</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid),('state','=','pending')]</field>
|
||||
<field name="view_id" ref="project_issue.project_issue_tree_view"/>
|
||||
</record>
|
||||
|
||||
<record id="action_project_issue_graph_state" model="ir.actions.act_window">
|
||||
<field name="name">Project Issue</field>
|
||||
<field name="res_model">project.issue.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
<field name="view_id" ref="project_issue.view_project_issue_report_graph"/>
|
||||
</record>
|
||||
|
||||
<record id="view_project_issue_graph_stage" model="ir.ui.view">
|
||||
<field name="name">project.issue.report.graph</field>
|
||||
<field name="model">project.issue.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph orientation="vertical" string="Project Issue" type="bar">
|
||||
<field name="stage_id"/>
|
||||
<field name="nbr" operator="+"/>
|
||||
<field group="True" name="user_id"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_project_issue_graph_stage" model="ir.actions.act_window">
|
||||
<field name="name">Project Issue</field>
|
||||
<field name="res_model">project.issue.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
<field name="view_id" ref="view_project_issue_graph_stage"/>
|
||||
</record>
|
||||
|
||||
<record id="board_project_issue_form" model="ir.ui.view">
|
||||
<field name="name">board.project.issue.form</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Project Issue Board">
|
||||
<vpaned>
|
||||
<form string="My Board">
|
||||
<hpaned>
|
||||
<child1>
|
||||
<action colspan="4" height="220" name="%(action_view_current_project_issue_tree)d" string="Current Project Issues" width="510"/>
|
||||
<action colspan="4" name="%(action_view_current_project_issue_tree)d" string="Current Issues" width="510"/>
|
||||
<action colspan="4" name="%(action_view_pending_project_issue_tree)d" string="Pending Issues" width="510"/>
|
||||
</child1>
|
||||
<child2>
|
||||
<action colspan="4" height="220" name="%(project.action_task_by_days_graph)d" string="Project Tasks By Days" width="510"/>
|
||||
<vpaned>
|
||||
<child1>
|
||||
<action colspan="4" name="%(action_project_issue_graph_state)d" string="Issues By State" />
|
||||
</child1>
|
||||
<child2>
|
||||
<action colspan="4" name="%(action_project_issue_graph_stage)d" string="Issues By Stage" />
|
||||
</child2>
|
||||
</vpaned>
|
||||
</child2>
|
||||
</vpaned>
|
||||
</hpaned>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -8,6 +8,15 @@
|
||||
name="Purchase"
|
||||
parent="base.dashboard"/>
|
||||
|
||||
<record id="purchase_draft" model="ir.actions.act_window">
|
||||
<field name="name">Draft Purchases</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">purchase.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('date_order','>',time.strftime('%Y-01-01 00:00:00')),('date_order','<',time.strftime('%Y-12-31 23:59:59')), ('state','=','draft')]</field>
|
||||
<field name="search_view_id" ref="purchase.purchase_order_tree"/>
|
||||
</record>
|
||||
<record id="purchase_waiting" model="ir.actions.act_window">
|
||||
<field name="name">Quotation Request</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
@@ -26,7 +35,7 @@
|
||||
<form string="My Board">
|
||||
<hpaned>
|
||||
<child1>
|
||||
<action colspan="4" height="220" name="%(purchase.purchase_rfq)d" string="Draft Purchase Order" width="510"/>
|
||||
<action colspan="4" height="220" name="%(purchase_draft)d" string="Draft Purchase Order" width="510"/>
|
||||
<action colspan="4" height="220" name="%(purchase_waiting)d" string="Purchase Order in Waiting" width="510"/>
|
||||
</child1>
|
||||
<child2>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
from osv import fields,osv
|
||||
import tools
|
||||
import crm_report
|
||||
|
||||
AVAILABLE_STATES = [
|
||||
('draft','Draft'),
|
||||
@@ -35,7 +36,7 @@ class crm_lead_report(osv.osv):
|
||||
_name = "crm.lead.report"
|
||||
_auto = False
|
||||
_description = "CRM Lead Report"
|
||||
|
||||
|
||||
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
|
||||
|
||||
""" @param cr: the current row, from the database cursor,
|
||||
@@ -89,7 +90,7 @@ class crm_lead_report(osv.osv):
|
||||
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'create_date': fields.datetime('Create Date', readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'delay_close': fields.float('Delay to close',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category',\
|
||||
domain="[('section_id','=',section_id),\
|
||||
@@ -98,12 +99,17 @@ class crm_lead_report(osv.osv):
|
||||
domain="[('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.lead')]", readonly=True),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'type':fields.selection([
|
||||
('lead','Lead'),
|
||||
('opportunity','Opportunity'),
|
||||
|
||||
],'Type', help="Type is used to separate Leads and Opportunities"),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Lead Type', \
|
||||
domain="[('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.lead')]"),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'date_open': fields.datetime('Opened', readonly=True),
|
||||
'date_deadline': fields.date('Deadline', readonly=True),
|
||||
'opportunity_id': fields.many2one('crm.opportunity', 'Opportunity',readonly=True),
|
||||
'country_id': fields.many2one('res.country', 'Country' , readonly=True),
|
||||
'state_id': fields.many2one('res.country.state', 'State' , readonly=True)
|
||||
}
|
||||
def init(self, cr):
|
||||
|
||||
@@ -132,6 +138,14 @@ class crm_lead_report(osv.osv):
|
||||
0 as avg_answers,
|
||||
0.0 as perc_done,
|
||||
0.0 as perc_cancel,
|
||||
c.priority as priority,
|
||||
c.type_id as type_id,
|
||||
c.date_closed as date_closed,
|
||||
c.date_open as date_open,
|
||||
c.opportunity_id as opportunity_id,
|
||||
c.country_id as country_id,
|
||||
c.state_id as state_id,
|
||||
c.date_deadline as date_deadline,
|
||||
date_trunc('day',c.create_date) as create_date,
|
||||
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
|
||||
from
|
||||
@@ -139,6 +153,8 @@ class crm_lead_report(osv.osv):
|
||||
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
|
||||
c.state, c.user_id,c.section_id,c.stage_id,categ_id,c.partner_id,c.company_id, c.type
|
||||
,c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
|
||||
,c.priority,c.type_id,c.date_closed,c.date_open
|
||||
,c.opportunity_id,c.country_id,c.state_id,c.date_deadline
|
||||
)""")
|
||||
|
||||
crm_lead_report()
|
||||
|
||||
@@ -22,7 +22,14 @@
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="stage_id" invisible="1"/>
|
||||
<field name="categ_id" invisible="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="priority" invisible="1"/>
|
||||
<field name="type_id" invisible="1"/>
|
||||
<field name="date_closed" invisible="1"/>
|
||||
<field name="date_open" invisible="1"/>
|
||||
<field name="opportunity_id" invisible="1"/>
|
||||
<field name="country_id" invisible="1"/>
|
||||
<field name="state_id" invisible="1" string="State of Country"/>
|
||||
<field name="date_deadline" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -63,135 +70,61 @@
|
||||
</record>
|
||||
|
||||
<!-- Leads by user and section Search View -->
|
||||
|
||||
|
||||
<record id="view_report_crm_lead_filter" model="ir.ui.view">
|
||||
<field name="name">crm.lead.report.select</field>
|
||||
<field name="model">crm.lead.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search">
|
||||
<group col="16" colspan="8">
|
||||
<!-- <filter string="This Year" name="This Year" icon="terp-hr"
|
||||
domain="[('name','=',time.localtime()[0])]"/>-->
|
||||
<filter string="This Year" icon="terp-hr"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<!-- <filter string="This Month" name="This Year" icon="terp-hr"
|
||||
domain="[('month','=',time.strftime('%%m'))]" />-->
|
||||
<filter string="This Month" icon="terp-hr" name="This Month"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<filter icon="gtk-media-rewind" string="7 Days" separator="1"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter icon="terp-hr"
|
||||
string="Draft"
|
||||
domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Open"
|
||||
domain="[('state','=','open')]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Pending"
|
||||
domain="[('state','=','pending')]"/>
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<field name="section_id"
|
||||
default="context.get('section_id', False)"
|
||||
widget="selection"
|
||||
context="{'invisible_section': False}">
|
||||
|
||||
<filter icon="terp-crm"
|
||||
context="{'invisible_section': False}"
|
||||
domain="[('section_id.user_id','=',uid)]"
|
||||
help="My section" />
|
||||
|
||||
</field>
|
||||
<field name="company_id" widget="selection">
|
||||
<filter icon="terp-crm"
|
||||
context="{'invisible_section': False}"
|
||||
domain="[('section_id.user_id.company_id','=',uid)]"
|
||||
help="My company"/>
|
||||
</field>
|
||||
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter icon="terp-crm" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
|
||||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-sale"
|
||||
string="Done"
|
||||
domain="[('state','=','done')]"/>
|
||||
<filter icon="terp-sale"
|
||||
string="Cancel"
|
||||
domain="[('state','=','cancel')]"/>
|
||||
<group>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Stage" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Opportunity tree view -->
|
||||
|
||||
<record id="view_report_crm_opportunity_tree" model="ir.ui.view">
|
||||
<field name="name">crm.lead.report.tree</field>
|
||||
<field name="model">crm.lead.report</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Opportunities">
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="section_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="nbr" string="#Opportunities" sum="#Opportunities"/>
|
||||
<field name="delay_close" sum='Avg Closing Delay'/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="stage_id" invisible="1"/>
|
||||
<field name="categ_id" invisible="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
</tree>
|
||||
<data>
|
||||
<xpath expr='//search[@string="Search"]/group[@string="Extended options..."]/filter[@string="Cancel"]' position='after'>
|
||||
<group>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="priority" />
|
||||
<field name="type_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
|
||||
<newline/>
|
||||
<field name="opportunity_id" />
|
||||
<field name="partner_id" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="country_id" />
|
||||
<field name="state_id" string="State of Country"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_deadline" />
|
||||
<newline/>
|
||||
<field name="date_closed" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_open" />
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr='//search[@string="Search"]/group[@string="Group By..."]/filter[@string="State"]'
|
||||
position='after'>
|
||||
<filter string="Stage" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
</xpath>
|
||||
<xpath
|
||||
expr='//search[@string="Search"]/group[@string="Group By..."]/filter[@string="Category"]'
|
||||
position='after'>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Priority" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'priority'}" />
|
||||
<filter string="Type" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'type_id'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Opportunity" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'opportunity_id'}" />
|
||||
<filter string="Partner" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'partner_id'}" />
|
||||
<newline/>
|
||||
<filter string="Country" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'country_id'}" />
|
||||
<filter string="State of Country" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'state_id'}" />
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -220,7 +153,7 @@
|
||||
<field name="view_id" ref="view_report_crm_lead_graph"/>
|
||||
<field name="act_window_id" ref="action_report_crm_lead"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_report_crm_opportunity" model="ir.actions.act_window">
|
||||
<field name="name">Opportunities</field>
|
||||
<field name="res_model">crm.lead.report</field>
|
||||
@@ -244,7 +177,7 @@
|
||||
<field name="view_id" ref="view_report_crm_lead_graph"/>
|
||||
<field name="act_window_id" ref="action_report_crm_opportunity"/>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem name="Leads" id="menu_report_crm_leads_tree"
|
||||
groups="base.group_extended"
|
||||
parent="base.next_id_64" action="action_report_crm_lead" />
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
from osv import fields,osv
|
||||
import tools
|
||||
import crm_report
|
||||
|
||||
AVAILABLE_STATES = [
|
||||
('draft','Draft'),
|
||||
@@ -98,6 +99,13 @@ class crm_phonecall_report(osv.osv):
|
||||
('object_id.model', '=', 'crm.phonecall')]"),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'opportunity_id': fields.many2one ('crm.opportunity', 'Opportunity'),
|
||||
'canal_id': fields.many2one('res.partner.canal','Channel',domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.phonecall')]"),
|
||||
'duration': fields.float('Duration',readonly=True),
|
||||
'date': fields.datetime('Planned Date'),
|
||||
'partner_address_id': fields.many2one('res.partner.address', 'Contact Name', readonly=True)
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
@@ -124,6 +132,13 @@ class crm_phonecall_report(osv.osv):
|
||||
0 as avg_answers,
|
||||
0.0 as perc_done,
|
||||
0.0 as perc_cancel,
|
||||
c.priority as priority,
|
||||
c.date_closed as date_closed,
|
||||
c.opportunity_id as opportunity_id,
|
||||
c.canal_id as canal_id,
|
||||
c.date as date,
|
||||
c.partner_address_id as partner_address_id,
|
||||
sum(c.duration) as duration,
|
||||
date_trunc('day',c.create_date) as create_date,
|
||||
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
|
||||
from
|
||||
@@ -131,6 +146,8 @@ class crm_phonecall_report(osv.osv):
|
||||
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
|
||||
c.state, c.user_id,c.section_id, c.categ_id,c.partner_id,c.company_id
|
||||
,to_char(c.create_date, 'YYYY-MM-DD'),c.create_date
|
||||
,c.priority,c.date_closed,opportunity_id,canal_id,c.date
|
||||
,partner_address_id
|
||||
)""")
|
||||
|
||||
crm_phonecall_report()
|
||||
|
||||
@@ -16,11 +16,18 @@
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="partner_address_id" invisible="1"/>
|
||||
<field name="nbr" string="#Phone calls" sum="#Phone calls"/>
|
||||
<field name="delay_close" avg="Avg Closing Delay"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="categ_id" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="priority" invisible="1"/>
|
||||
<field name="date_closed" invisible="1"/>
|
||||
<field name="opportunity_id" invisible="1"/>
|
||||
<field name="canal_id" invisible="1"/>
|
||||
<field name="duration" sum="Total Duration"/>
|
||||
<field name="date" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -63,108 +70,46 @@
|
||||
</record>
|
||||
|
||||
<!-- Phone calls by user and section Search View -->
|
||||
|
||||
|
||||
<record id="view_report_crm_phonecall_filter" model="ir.ui.view">
|
||||
<field name="name">crm.phonecall.report.select</field>
|
||||
<field name="model">crm.phonecall.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search">
|
||||
<group col="16" colspan="8">
|
||||
<!-- <filter string="This Year" name="This Year" icon="terp-hr"
|
||||
domain="[('name','=',time.localtime()[0])]"/>-->
|
||||
<filter string="This Year" icon="terp-hr"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<!-- <filter string="This Month" name="This Year" icon="terp-hr"
|
||||
domain="[('month','=',time.strftime('%%m'))]" />-->
|
||||
<filter string="This Month" icon="terp-hr" name="This Month"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<filter icon="gtk-media-rewind" string="7 Days" separator="1"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter icon="terp-hr"
|
||||
string="Draft"
|
||||
domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Open"
|
||||
domain="[('state','=','open')]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Pending"
|
||||
domain="[('state','=','pending')]"/>
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<field name="section_id"
|
||||
default="context.get('section_id', False)"
|
||||
widget="selection"
|
||||
context="{'invisible_section': False}">
|
||||
|
||||
<filter icon="terp-crm"
|
||||
context="{'invisible_section': False}"
|
||||
domain="[('section_id.user_id','=',uid)]"
|
||||
help="My section" />
|
||||
|
||||
</field>
|
||||
<field name="company_id" widget="selection">
|
||||
<filter icon="terp-crm"
|
||||
context="{'invisible_section': False}"
|
||||
domain="[('section_id.user_id.company_id','=',uid)]"
|
||||
help="My company"/>
|
||||
</field>
|
||||
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter icon="terp-crm" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
|
||||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-sale"
|
||||
string="Done"
|
||||
domain="[('state','=','done')]"/>
|
||||
|
||||
<filter icon="terp-sale"
|
||||
string="Cancel"
|
||||
domain="[('state','=','cancel')]"/>
|
||||
<group>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
</search>
|
||||
<data>
|
||||
<xpath expr='//search[@string="Search"]/group[@string="Extended options..."]/filter[@string="Cancel"]' position='after'>
|
||||
<group>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>
|
||||
<field name="priority" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="opportunity_id"/>
|
||||
<field name="canal_id" widget="selection" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="partner_address_id"/>
|
||||
<newline/>
|
||||
<field name="date_closed"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr='//search[@string="Search"]/group[@string="Group By..."]/filter[@string="Category"]'
|
||||
position='after'>
|
||||
<filter string="Priority" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'priority'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Opportunities" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'opportunity_id'}" />
|
||||
<filter string="Channel" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'canal_id'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Partner" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'partner_id'}" />
|
||||
<filter string="Contact Name" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'partner_address_id'}" />
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -113,6 +113,12 @@ class crm_claim_report(osv.osv):
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Claim Type',\
|
||||
domain="[('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.claim')]"),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'canal_id': fields.many2one('res.partner.canal','Channel',domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]"),
|
||||
'som': fields.many2one('res.partner.som', 'State of Mind'),
|
||||
'claim_date': fields.datetime('Date Of Claim',readonly=True),
|
||||
'deadline_date': fields.datetime('Deadline ',readonly=True),
|
||||
'partner_address_id': fields.many2one('res.partner.address','Contact Name',readonly=True),
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
@@ -142,6 +148,12 @@ class crm_claim_report(osv.osv):
|
||||
0.0 as perc_cancel,
|
||||
c.priority as priority,
|
||||
c.type_id as type_id,
|
||||
c.date_closed as date_closed,
|
||||
c.canal_id as canal_id,
|
||||
c.som as som,
|
||||
c.create_date as claim_date,
|
||||
c.date_deadline as deadline_date,
|
||||
c.partner_address_id as partner_address_id,
|
||||
date_trunc('day',c.create_date) as create_date,
|
||||
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
|
||||
from
|
||||
@@ -149,7 +161,8 @@ class crm_claim_report(osv.osv):
|
||||
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), \
|
||||
c.state, c.user_id,c.section_id, c.stage_id,\
|
||||
c.categ_id,c.partner_id,c.company_id,c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
|
||||
,c.priority,c.type_id,c.som
|
||||
,c.priority,c.type_id,c.date_closed,c.canal_id,c.som
|
||||
,c.create_date,c.date_deadline,c.partner_address_id
|
||||
)""")
|
||||
|
||||
crm_claim_report()
|
||||
|
||||
@@ -24,6 +24,12 @@
|
||||
<field name="categ_id" invisible="1"/>
|
||||
<field name="priority" invisible="1"/>
|
||||
<field name="type_id" invisible="1"/>
|
||||
<field name="date_closed" invisible="1"/>
|
||||
<field name="canal_id" invisible="1"/>
|
||||
<field name="som" invisible="1"/>
|
||||
<field name="claim_date" invisible="1"/>
|
||||
<field name="deadline_date" invisible="1"/>
|
||||
<field name="partner_address_id" string="Contact Name" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -67,121 +73,59 @@
|
||||
</record>
|
||||
|
||||
<!-- CRM Claim Report Search View -->
|
||||
|
||||
|
||||
<record id="view_report_crm_claim_filter" model="ir.ui.view">
|
||||
<field name="name">crm.claim.report.select</field>
|
||||
<field name="model">crm.claim.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search">
|
||||
<group col="16" colspan="8">
|
||||
<!-- <filter string="This Year" name="This Year" icon="terp-hr"
|
||||
domain="[('name','=',time.localtime()[0])]"/>-->
|
||||
<filter string="This Year" icon="terp-hr"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<!-- <filter string="This Month" name="This Year" icon="terp-hr"
|
||||
domain="[('month','=',time.strftime('%%m'))]" />-->
|
||||
<filter string="This Month" icon="terp-hr" name="This Month"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<filter icon="gtk-media-rewind" string="7 Days" separator="1"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter icon="terp-hr"
|
||||
string="Draft"
|
||||
domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Open"
|
||||
domain="[('state','=','open')]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Pending"
|
||||
domain="[('state','=','pending')]"/>
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<field name="section_id"
|
||||
default="context.get('section_id', False)"
|
||||
widget="selection"
|
||||
context="{'invisible_section': False}">
|
||||
|
||||
<filter icon="terp-crm"
|
||||
context="{'invisible_section': False}"
|
||||
domain="[('section_id.user_id','=',uid)]"
|
||||
help="My section" />
|
||||
|
||||
</field>
|
||||
<field name="company_id" widget="selection">
|
||||
<filter icon="terp-crm"
|
||||
context="{'invisible_section': False}"
|
||||
domain="[('section_id.user_id.company_id','=',uid)]"
|
||||
help="My company"/>
|
||||
</field>
|
||||
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter icon="terp-crm" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
|
||||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-sale"
|
||||
string="Done"
|
||||
domain="[('state','=','done')]"/>
|
||||
|
||||
<filter icon="terp-sale"
|
||||
string="Cancel"
|
||||
domain="[('state','=','cancel')]"/>
|
||||
|
||||
<group>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.claim')]"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.claim')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="priority" />
|
||||
<field name="type_id" widget="selection" domain="[('object_id.model', '=', 'crm.claim')]"/>
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Stage" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Priority" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'priority'}" />
|
||||
<filter string="Type" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'type_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
</search>
|
||||
<data>
|
||||
<xpath expr='//search[@string="Search"]/group[@string="Extended options..."]/filter[@string="Cancel"]' position='after'>
|
||||
<group>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.claim')]"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.claim')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="priority" />
|
||||
<field name="type_id" widget="selection" domain="[('object_id.model', '=', 'crm.claim')]"/>
|
||||
<newline/>
|
||||
<field name="canal_id" widget="selection" />
|
||||
<field name="som" widget="selection" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_id" />
|
||||
<field name="partner_address_id" />
|
||||
<newline/>
|
||||
<field name="claim_date" />
|
||||
<field name="date_closed" />
|
||||
<field name="deadline_date" />
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr='//search[@string="Search"]/group[@string="Group By..."]/filter[@string="State"]'
|
||||
position='after'>
|
||||
<filter string="Stage" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
</xpath>
|
||||
<xpath
|
||||
expr='//search[@string="Search"]/group[@string="Group By..."]/filter[@string="Category"]'
|
||||
position='after'>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Priority" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'priority'}" />
|
||||
<filter string="Type" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'type_id'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Channel" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'canal_id'}" />
|
||||
<filter string="State of Mind" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'som'}" />
|
||||
<newline/>
|
||||
<filter string="Partner" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'partner_id'}" />
|
||||
<filter string="Contact" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'partner_address_id'}" />
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -21,14 +21,7 @@
|
||||
|
||||
from osv import fields,osv
|
||||
import tools
|
||||
|
||||
AVAILABLE_STATES = [
|
||||
('draft','Draft'),
|
||||
('open','Open'),
|
||||
('cancel', 'Cancelled'),
|
||||
('done', 'Closed'),
|
||||
('pending','Pending')
|
||||
]
|
||||
import crm_report
|
||||
|
||||
class crm_fundraising_report(osv.osv):
|
||||
"""CRM Fundraising Report"""
|
||||
@@ -36,7 +29,7 @@ class crm_fundraising_report(osv.osv):
|
||||
_name = "crm.fundraising.report"
|
||||
_auto = False
|
||||
_description = "CRM Fundraising Report"
|
||||
|
||||
|
||||
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
|
||||
|
||||
""" @param cr: the current row, from the database cursor,
|
||||
@@ -90,7 +83,7 @@ class crm_fundraising_report(osv.osv):
|
||||
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'create_date': fields.datetime('Create Date', readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category', \
|
||||
domain="[('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.fundraising')]"),
|
||||
@@ -100,6 +93,13 @@ class crm_fundraising_report(osv.osv):
|
||||
'delay_close': fields.float('Delay to close', digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner'),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'canal_id': fields.many2one('res.partner.canal','Channel',domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.fundraising')]"),
|
||||
'som': fields.many2one('res.partner.som', 'State of Mind'),
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Fundraising Type', \
|
||||
domain="[('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.fundraising')]"),
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
@@ -126,6 +126,11 @@ class crm_fundraising_report(osv.osv):
|
||||
0 as avg_answers,
|
||||
0.0 as perc_done,
|
||||
0.0 as perc_cancel,
|
||||
c.priority as priority,
|
||||
c.date_closed as date_closed,
|
||||
c.canal_id as canal_id,
|
||||
c.som as som,
|
||||
c.type_id as type_id,
|
||||
date_trunc('day',c.create_date) as create_date,
|
||||
sum(planned_revenue) as amount_revenue,
|
||||
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
|
||||
@@ -135,7 +140,8 @@ class crm_fundraising_report(osv.osv):
|
||||
crm_fundraising c
|
||||
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
|
||||
c.state, c.user_id,c.section_id,c.categ_id,c.partner_id,c.company_id,
|
||||
c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
|
||||
c.create_date,to_char(c.create_date, 'YYYY-MM-DD'),c.priority,c.date_closed
|
||||
,c.canal_id,c.som,c.type_id
|
||||
)""")
|
||||
|
||||
crm_fundraising_report()
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="categ_id" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="priority" invisible="1"/>
|
||||
<field name="date_closed" invisible="1"/>
|
||||
<field name="canal_id" invisible="1"/>
|
||||
<field name="som" invisible="1"/>
|
||||
<field name="type_id" invisible="1" string="Payment Mode"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -72,103 +77,34 @@
|
||||
<field name="model">crm.fundraising.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search">
|
||||
<group col="16" colspan="8">
|
||||
<!-- <filter string="This Year" name="This Year" icon="terp-hr"
|
||||
domain="[('name','=',time.localtime()[0])]"/>-->
|
||||
<filter string="This Year" icon="terp-hr"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<!-- <filter string="This Month" name="This Year" icon="terp-hr"
|
||||
domain="[('month','=',time.strftime('%%m'))]" />-->
|
||||
<filter string="This Month" icon="terp-hr" name="This Month"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<filter icon="gtk-media-rewind" string="7 Days" separator="1"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter icon="terp-hr"
|
||||
string="Draft"
|
||||
domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Open"
|
||||
domain="[('state','=','open')]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Pending"
|
||||
domain="[('state','=','pending')]"/>
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<field name="section_id"
|
||||
default="context.get('section_id', False)"
|
||||
widget="selection"
|
||||
context="{'invisible_section': False}">
|
||||
|
||||
<filter icon="terp-crm"
|
||||
context="{'invisible_section': False}"
|
||||
domain="[('section_id.user_id','=',uid)]"
|
||||
help="My section" />
|
||||
|
||||
</field>
|
||||
<field name="company_id" widget="selection">
|
||||
<filter icon="terp-crm"
|
||||
context="{'invisible_section': False}"
|
||||
domain="[('section_id.user_id.company_id','=',uid)]"
|
||||
help="My company"/>
|
||||
</field>
|
||||
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter icon="terp-crm" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
|
||||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-sale"
|
||||
string="Done"
|
||||
domain="[('state','=','done')]"/>
|
||||
|
||||
<filter icon="terp-sale"
|
||||
string="Cancel"
|
||||
domain="[('state','=','cancel')]"/>
|
||||
|
||||
<group>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.fundraising')]"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
</search>
|
||||
<data>
|
||||
<xpath expr='//search[@string="Search"]/group[@string="Extended options..."]/filter[@string="Cancel"]' position='after'>
|
||||
<group>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.fundraising')]"/>
|
||||
<field name="priority"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="canal_id" widget="selection" />
|
||||
<field name="som" widget="selection" />
|
||||
<field name="type_id" widget="selection" string="Payment Mode" domain="[('object_id.model', '=', 'crm.fundraising')]"/>
|
||||
<newline/>
|
||||
<field name="date_closed" />
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr='//search[@string="Search"]/group[@string="Group By..."]/filter[@string="Category"]'
|
||||
position='after'>
|
||||
<filter string="Priority" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'priority'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Channel" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'canal_id'}" />
|
||||
<filter string="State of Mind" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'som'}" />
|
||||
<filter string="Payment Mode" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'type_id'}" />
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -45,9 +45,13 @@ class hr_expense_report(osv.osv):
|
||||
'department_id':fields.many2one('hr.department','Department',readonly=True),
|
||||
'company_id':fields.many2one('res.company', 'Company', readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
|
||||
'price_total':fields.float('Total Price', readonly=True),
|
||||
'analytic_account': fields.many2one('account.analytic.account','Analytic account',readonly=True),
|
||||
'price_average':fields.float('Average Price', readonly=True),
|
||||
'nbr':fields.integer('# of Lines', readonly=True),
|
||||
'no_of_products':fields.integer('# of Products', readonly=True),
|
||||
'no_of_account':fields.integer('# of Accounts', readonly=True),
|
||||
'state': fields.selection([
|
||||
('draft', 'Draft'),
|
||||
('confirm', 'Waiting confirmation'),
|
||||
@@ -67,6 +71,7 @@ class hr_expense_report(osv.osv):
|
||||
date_trunc('day',s.create_date) as date,
|
||||
s.employee_id,
|
||||
s.journal_id,
|
||||
s.currency_id,
|
||||
to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_confirm,
|
||||
to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_valid,
|
||||
s.invoice_id,
|
||||
@@ -75,27 +80,33 @@ class hr_expense_report(osv.osv):
|
||||
to_char(date_trunc('day',s.create_date), 'MM') as month,
|
||||
to_char(date_trunc('day',s.create_date), 'YYYY-MM-DD') as day,
|
||||
l.product_id as product_id,
|
||||
l.analytic_account as analytic_account,
|
||||
sum(l.unit_quantity * u.factor) as product_qty,
|
||||
s.user_id as user_id,
|
||||
s.company_id as company_id,
|
||||
sum(l.unit_quantity*l.unit_amount) as price_total,
|
||||
(sum(l.unit_quantity*l.unit_amount)/sum(l.unit_quantity * u.factor))::decimal(16,2) as price_average,
|
||||
count(*) as nbr,
|
||||
(select unit_quantity from hr_expense_line where id=l.id and product_id is not null) as no_of_products,
|
||||
(select count(analytic_account) from hr_expense_line where id=l.id and analytic_account is not null) as no_of_account,
|
||||
s.state
|
||||
from
|
||||
hr_expense_line l
|
||||
left join
|
||||
hr_expense_expense s on (s.id=l.expense_id)
|
||||
left join product_uom u on (u.id=l.uom_id)
|
||||
from hr_expense_line l
|
||||
left join hr_expense_expense s on (s.id=l.expense_id)
|
||||
left join product_uom u on (u.id=l.uom_id)
|
||||
group by
|
||||
date_trunc('day',s.create_date),
|
||||
to_char(date_trunc('day',s.create_date), 'YYYY'),
|
||||
to_char(date_trunc('day',s.create_date), 'MM'),
|
||||
to_char(date_trunc('day',s.create_date), 'YYYY-MM-DD'),
|
||||
to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY'),
|
||||
to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY'),
|
||||
l.product_id,
|
||||
l.analytic_account,
|
||||
s.invoice_id,
|
||||
s.currency_id,
|
||||
s.department_id,
|
||||
l.uom_id,
|
||||
l.id,
|
||||
s.user_id,
|
||||
s.state,
|
||||
s.journal_id,
|
||||
|
||||
@@ -14,12 +14,16 @@
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="invoice_id" invisible="1"/>
|
||||
<field name="analytic_account" invisible="1"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="product_qty" invisible="1"/>
|
||||
<field name="nbr" sum="# of Lines"/>
|
||||
<field name="no_of_products" sum="# of Products"/>
|
||||
<field name="no_of_account" sum="# of Accounts"/>
|
||||
<field name="price_average" avg="Average Price"/>
|
||||
<field name="price_total" sum="Total Price"/>
|
||||
<field name="state" invisible="1"/>
|
||||
@@ -47,7 +51,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Expenses">
|
||||
<group>
|
||||
<filter icon="terp-hr" string="This Year"
|
||||
<filter icon="terp-hr" string="Last 365 Days"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Expenses during last 7 year"/>
|
||||
<filter icon="terp-hr" string="This Month"
|
||||
@@ -79,6 +83,8 @@
|
||||
help="Expenses Non Assigned User"
|
||||
domain="[('user_id','=',False)]"/>
|
||||
</field>
|
||||
<field name="product_id"/>
|
||||
<field name="employee_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
@@ -95,13 +101,11 @@
|
||||
domain="[('state','=','cancelled')]"
|
||||
help = "Cancelled Expenses"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="employee_id" widget="selection"/>
|
||||
<field name="product_id" widget="selection"/>
|
||||
<field name="department_id" widget="selection"/>
|
||||
<newline/>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<field name="currency_id" widget="selection"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<separator orientation="vertical"/>
|
||||
<newline/>
|
||||
<field name="date_confirm"/>
|
||||
<field name="date_valid"/>
|
||||
</group>
|
||||
@@ -111,13 +115,16 @@
|
||||
<filter string="Employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
|
||||
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Analytic account" icon="terp-hr" context="{'group_by':'analytic_account'}"/>
|
||||
<filter string="Currency" icon="terp-hr" context="{'group_by':'currency_id'}"/>
|
||||
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-hr" context="{'group_by':'product_id'}"/>
|
||||
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
|
||||
<filter string="Force Journal" icon="terp-hr" context="{'group_by':'journal_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'date'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
|
||||
@@ -25,8 +25,9 @@ class available_holidays_report(osv.osv):
|
||||
_name = "available.holidays.report"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'date': fields.datetime('Date', readonly=True),
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'day': fields.char('Day', size=15, readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
|
||||
@@ -35,6 +36,7 @@ class available_holidays_report(osv.osv):
|
||||
'max_leave': fields.float('Allocated Leaves', readonly=True),
|
||||
'taken_leaves': fields.float('Taken Leaves', readonly=True),
|
||||
'remaining_leave': fields.float('Remaining Leaves',readonly=True),
|
||||
'department_id':fields.many2one('hr.department','Department',readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
}
|
||||
def init(self, cr):
|
||||
@@ -46,8 +48,10 @@ class available_holidays_report(osv.osv):
|
||||
date_trunc('day',h.create_date) as date,
|
||||
to_char(s.create_date, 'YYYY') as year,
|
||||
to_char(s.create_date, 'MM') as month,
|
||||
to_char(s.create_date, 'YYYY-MM-DD') as day,
|
||||
h.employee_id as employee_id,
|
||||
h.user_id as user_id,
|
||||
h.department_id,
|
||||
h.state as state,
|
||||
h.holiday_status_id as holiday_status_id,
|
||||
sum(number_of_days) as remaining_leave,
|
||||
@@ -68,7 +72,8 @@ class available_holidays_report(osv.osv):
|
||||
and s.active <> 'f'
|
||||
group by h.holiday_status_id, h.employee_id,
|
||||
date_trunc('day',h.create_date),to_char(s.create_date, 'YYYY'),
|
||||
to_char(s.create_date, 'MM'),h.user_id,h.state
|
||||
to_char(s.create_date, 'MM'),to_char(s.create_date, 'YYYY-MM-DD'),h.user_id,
|
||||
h.state,h.department_id
|
||||
|
||||
)""")
|
||||
available_holidays_report()
|
||||
|
||||
@@ -10,40 +10,32 @@
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Available Holidays">
|
||||
<field name="employee_id"/>
|
||||
<field name="holiday_status_id"/>
|
||||
<field name="max_leave"/>
|
||||
<field name="taken_leaves"/>
|
||||
<field name="employee_id" invisible="1"/>
|
||||
<field name="holiday_status_id" invisible="1"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="max_leave" sum="Allocated Leaves"/>
|
||||
<field name="taken_leaves" sum="Taken Leaves"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="remaining_leave"/>
|
||||
<field name="remaining_leave" sum="Remaining Leaves"/>
|
||||
<field name="year" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="date" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_available_holidays_report_form" model="ir.ui.view">
|
||||
<field name="name">available.holidays.report.form</field>
|
||||
<field name="model">available.holidays.report</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Available Holidays">
|
||||
<field name="employee_id" select="1"/>
|
||||
<field name="holiday_status_id" select="1"/>
|
||||
<field name="remaining_leave"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_hr_available_holidays_report_graph" model="ir.ui.view">
|
||||
<field name="name">available.holidays.report.graph</field>
|
||||
<field name="model">available.holidays.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph orientation="horizontal" string="Available Holidays" type="bar">
|
||||
<field name="holiday_status_id"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="max_leave" operator="+"/>
|
||||
<field name="taken_leaves" operator="+"/>
|
||||
<field name="remaining_leave" operator="+"/>
|
||||
<field group="True" name="employee_id"/>
|
||||
<field group="True" name="holiday_status_id"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
@@ -55,27 +47,47 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Leaves">
|
||||
<group>
|
||||
<filter icon="terp-hr"
|
||||
string="This Year"
|
||||
domain="[('year','=',time.strftime('%%Y'))]"
|
||||
help="Leaves of the year"/>
|
||||
<filter icon="terp-hr"
|
||||
string="This Month"
|
||||
domain="[('month','=',time.strftime('%%m'))]"
|
||||
help="Leaves of this month"/>
|
||||
<filter icon="terp-hr" string="This Year"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Leaves in this year"/>
|
||||
<filter icon="terp-hr" string="This Month"
|
||||
name="month"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Leaves in this month"/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days "
|
||||
separator="1"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Leaves during last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
<<<<<<< TREE
|
||||
<field name="employee_id"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-hr"
|
||||
string="My Leaves"
|
||||
domain="[('user_id','=',uid)]"/>
|
||||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<field name="holiday_status_id" widget="selection"/>
|
||||
<field name="department_id" widget="selection"/>
|
||||
=======
|
||||
<field name="employee_id"/>
|
||||
<field name="user_id" widget="selection"/>
|
||||
>>>>>>> MERGE-SOURCE
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
|
||||
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Type" icon="terp-hr" context="{'group_by':'holiday_status_id'}"/>
|
||||
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Month" icon="terp-sale" context="{'group_by':'date'}"/>
|
||||
<filter string="Year" icon="terp-sale" context="{'group_by':'year'}"/>
|
||||
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -88,7 +100,7 @@
|
||||
<field name="res_model">available.holidays.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{"search_default_user_id":uid}</field>
|
||||
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="view_id" ref="view_hr_available_holidays_report_search"/>
|
||||
|
||||
</record>
|
||||
|
||||
@@ -28,16 +28,19 @@ class hr_holidays_report(osv.osv):
|
||||
_auto = False
|
||||
_rec_name = 'date'
|
||||
_columns = {
|
||||
'date': fields.datetime('Date', readonly=True),
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'day': fields.char('Day', size=15, readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
|
||||
'date_from' : fields.datetime('Start Date', readonly=True),
|
||||
'date_to' : fields.datetime('End Date', readonly=True),
|
||||
'number_of_days_temp': fields.float('Number of Days', readonly=True),
|
||||
'date_from' : fields.date('Start Date', readonly=True),
|
||||
'date_to' : fields.date('End Date', readonly=True),
|
||||
'number_of_days_temp': fields.float('#Days', readonly=True),
|
||||
'employee_id' : fields.many2one('hr.employee', "Employee's Name",readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
'holiday_status_id' : fields.many2one("hr.holidays.status", "Leave Type",readonly=True),
|
||||
'department_id':fields.many2one('hr.department','Department',readonly=True),
|
||||
'state': fields.selection([('draft', 'Draft'),
|
||||
('confirm', 'Waiting Validation'),
|
||||
('refuse', 'Refused'),
|
||||
@@ -52,14 +55,17 @@ class hr_holidays_report(osv.osv):
|
||||
create or replace view hr_holidays_report as (
|
||||
select
|
||||
min(s.id) as id,
|
||||
date_trunc('seconds',s.create_date) as date,
|
||||
date_trunc('day',s.create_date) as date,
|
||||
date_trunc('day',s.date_from) as date_from,
|
||||
date_trunc('day',s.date_to) as date_to,
|
||||
s.number_of_days_temp,
|
||||
sum(s.number_of_days_temp) as number_of_days_temp,
|
||||
s.employee_id,
|
||||
s.user_id as user_id,
|
||||
to_char(s.create_date, 'YYYY') as year,
|
||||
to_char(s.create_date, 'MM') as month,
|
||||
to_char(s.create_date, 'YYYY-MM-DD') as day,
|
||||
s.holiday_status_id,
|
||||
s.department_id,
|
||||
s.state
|
||||
from
|
||||
hr_holidays s
|
||||
@@ -67,7 +73,8 @@ class hr_holidays_report(osv.osv):
|
||||
s.employee_id is not null
|
||||
group by
|
||||
s.create_date,s.state,s.date_from,s.date_to,
|
||||
s.number_of_days_temp,s.employee_id,s.user_id
|
||||
s.employee_id,s.user_id,s.holiday_status_id,
|
||||
s.department_id
|
||||
)
|
||||
""")
|
||||
hr_holidays_report()
|
||||
|
||||
@@ -7,14 +7,18 @@
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Leaves Statistics">
|
||||
<field name="date"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<field name="number_of_days_temp"/>
|
||||
<field name="date" invisible="1"/>
|
||||
<field name="employee_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="date_from" invisible="1"/>
|
||||
<field name="date_to" invisible="1"/>
|
||||
<field name="number_of_days_temp" sum="#Days"/>
|
||||
<field name="holiday_status_id" invisible="1"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="state"/>
|
||||
<field name="state" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -27,6 +31,7 @@
|
||||
<graph string="Leaves Statistics" type="bar">
|
||||
<field name="employee_id"/>
|
||||
<field name="number_of_days_temp" operator="+"/>
|
||||
<field name="state" group = "True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
@@ -37,40 +42,71 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Leaves">
|
||||
<filter icon="terp-hr"
|
||||
string="This Year"
|
||||
domain="[('year','=',time.strftime('%%Y'))]"
|
||||
help="Leaves of the year"/>
|
||||
<filter icon="terp-hr"
|
||||
string="This Month"
|
||||
domain="[('month','=',time.strftime('%%m'))]"
|
||||
help="Leaves of this month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Draft"
|
||||
domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Validate"
|
||||
domain="[('state','=','validate')]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Start Leaves"
|
||||
domain="[('date_from','=',time.strftime('%%Y/%%m/%%d'))]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="End Leaves"
|
||||
domain="[('date_to','=',time.strftime('%%Y/%%m/%%d'))]"/>
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="user_id" widget="selection"/>
|
||||
<field name="date"/>
|
||||
<group>
|
||||
<filter icon="terp-hr" string="This Year"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Leaves in this year"/>
|
||||
<filter icon="terp-hr" string="This Month"
|
||||
name="month"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Leaves in this month"/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days "
|
||||
separator="1"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Leaves during last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Draft"
|
||||
icon="terp-hr"
|
||||
domain="[('state','=','draft')]"
|
||||
help = "Draft Leaves"/>
|
||||
<filter string="Waiting Validation"
|
||||
icon="terp-hr"
|
||||
domain="[('state', '=' ,'confirm')]"
|
||||
help = "In progress Leaves"/>
|
||||
<filter string="Validated"
|
||||
icon="terp-hr"
|
||||
domain="[('state','=','validate')]"
|
||||
help = "Pending Leaves"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-hr"
|
||||
string="My Leaves"
|
||||
domain="[('user_id','=',uid)]"/>
|
||||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-hr"
|
||||
string="Refused"
|
||||
name="done"
|
||||
domain="[('state','=','refuse')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_from"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="holiday_status_id" widget="selection"/>
|
||||
<newline/>
|
||||
<filter icon="terp-hr"
|
||||
string="Cancelled"
|
||||
domain="[('state','=','cancel')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_to"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="department_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Employee" name="employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
|
||||
<filter string="Employee" name="Employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
|
||||
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Type" icon="terp-hr" context="{'group_by':'holiday_status_id'}"/>
|
||||
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
|
||||
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Month" icon="terp-sale" context="{'group_by':'date'}"/>
|
||||
<filter string="Year" icon="terp-sale" context="{'group_by':'year'}"/>
|
||||
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'date'}"/>
|
||||
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -81,7 +117,7 @@
|
||||
<field name="res_model">hr.holidays.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{'search_default_employee': 1, "search_default_user_id":uid}</field>
|
||||
<field name="context">{'search_default_month':1,'search_default_Employee':1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="search_view_id" ref="view_hr_holidays_report_search"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -105,6 +105,8 @@ class hr_recruitment_report(osv.osv):
|
||||
'priority': fields.selection(hr_recruitment.AVAILABLE_PRIORITIES, 'Appreciation'),
|
||||
'salary_prop' : fields.float("Salary Proposed"),
|
||||
'salary_exp' : fields.float("Salary Expected"),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner',readonly=True),
|
||||
'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact Name',readonly=True),
|
||||
'available' : fields.float("Availability")
|
||||
|
||||
}
|
||||
@@ -121,7 +123,9 @@ class hr_recruitment_report(osv.osv):
|
||||
to_char(s.create_date, 'MM') as month,
|
||||
to_char(s.create_date, 'YYYY-MM-DD') as day,
|
||||
s.state,
|
||||
s.partner_id,
|
||||
s.company_id,
|
||||
s.partner_address_id,
|
||||
s.user_id,
|
||||
s.job_id,
|
||||
s.type_id,
|
||||
@@ -140,6 +144,8 @@ class hr_recruitment_report(osv.osv):
|
||||
date_trunc('day',s.create_date),
|
||||
date_trunc('day',s.date_closed),
|
||||
s.state,
|
||||
s.partner_id,
|
||||
s.partner_address_id,
|
||||
s.company_id,
|
||||
s.user_id,
|
||||
s.stage_id,
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
<field name="stage_id" invisible="1" widget="selection"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="type_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="partner_address_id" invisible="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
@@ -96,29 +98,36 @@
|
||||
string="Hired"
|
||||
name="done"
|
||||
domain="[('state','=','done')]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Refused"
|
||||
domain="[('state','=','cancel')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="priority"/>
|
||||
<field name="stage_id" widget="selection"/>
|
||||
<field name="job_id" widget="selection"/>
|
||||
<newline/>
|
||||
<field name="type_id" widget="selection"/>
|
||||
<field name="date"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Refused"
|
||||
domain="[('state','=','cancel')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_closed"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="type_id" widget="selection"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="partner_address_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By ..." colspan="10" col="12">
|
||||
<filter string="User" name='User' icon="terp-hr" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Company" icon="terp-hr" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Stage" name="Stage" icon="terp-hr" domain="[]" context="{'group_by':'stage_id'}" />
|
||||
<filter string="Partner" icon="terp-hr" domain="[]" context="{'group_by':'partner_id'}" />
|
||||
<filter string="Stage" icon="terp-hr" domain="[]" context="{'group_by':'stage_id'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-hr" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Jobs" icon="terp-sale" domain="[]" context="{'group_by':'job_id'}"/>
|
||||
<filter string="Department" icon="terp-hr" domain="[]" context="{'group_by':'department_id'}"/>
|
||||
<filter string="Degree" icon="terp-hr" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<filter string="Partner Contact Name" icon="terp-hr" domain="[]" context="{'group_by':'partner_address_id'}" />
|
||||
<filter string="Jobs" name="job" icon="terp-sale" domain="[]" context="{'group_by':'job_id'}"/>
|
||||
<filter string="Department" name="department" icon="terp-hr" domain="[]" context="{'group_by':'department_id'}"/>
|
||||
<filter string="Degree" name="degree" icon="terp-hr" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-hr" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Day" name = "day" icon="terp-hr" domain="[]" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" domain="[]" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-hr" domain="[]" context="{'group_by':'year'}"/>
|
||||
@@ -132,7 +141,11 @@
|
||||
<field name="res_model">hr.recruitment.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<<<<<<< TREE
|
||||
<field name="context">{'search_default_month':1,'search_default_degree':1,'search_default_job':1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
=======
|
||||
<field name="context">{'search_default_month':1,'search_default_User':1,'search_default_user_id':uid,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
>>>>>>> MERGE-SOURCE
|
||||
<field name="search_view_id" ref="view_hr_recruitment_report_search"/>
|
||||
</record>
|
||||
<menuitem id="hr.menu_hr_reporting" name="Reporting" parent="hr.menu_hr_root" sequence="10"/>
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<field name="context">{'search_default_month':1,'search_default_User':1,'search_default_user_id':uid,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="search_view_id" ref="view_timesheet_line_search"/>
|
||||
</record>
|
||||
<menuitem action="action_timesheet_line_stat_all" id="menu_report_timesheet_line_all" parent="hr.menu_hr_reporting"/>
|
||||
<!--menuitem action="action_timesheet_line_stat_all" id="menu_report_timesheet_line_all" parent="hr.menu_hr_reporting"/-->
|
||||
|
||||
|
||||
<!-- Statistics report on timesheet by user -->
|
||||
|
||||
@@ -33,7 +33,11 @@ class timesheet_report(osv.osv):
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'name': fields.char('Description', size=64,readonly=True),
|
||||
'product_id' : fields.many2one('product.product', 'Product'),
|
||||
'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True),
|
||||
'user_id': fields.many2one('res.users', 'User',readonly=True),
|
||||
'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Type of Invoicing',readonly=True),
|
||||
'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True),
|
||||
'nbr': fields.integer('#Nbr',readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company',readonly=True),
|
||||
'department_id':fields.many2one('hr.department','Department',readonly=True),
|
||||
@@ -45,9 +49,8 @@ class timesheet_report(osv.osv):
|
||||
('draft','Draft'),
|
||||
('confirm','Confirmed'),
|
||||
('done','Done')], 'State', readonly=True),
|
||||
'total_att': fields.float('Total Timesheet',readonly=True),
|
||||
'total_ts': fields.float('Total Attendance',readonly=True),
|
||||
'total_diff': fields.float('Difference', readonly=True),
|
||||
'quantity': fields.float('#Quantity',readonly=True),
|
||||
'cost': fields.float('#Cost',readonly=True),
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
@@ -64,10 +67,12 @@ class timesheet_report(osv.osv):
|
||||
to_char(htss.date_current,'MM') as month,
|
||||
to_char(htss.date_current, 'YYYY-MM-DD') as day,
|
||||
count(*) as nbr,
|
||||
sum(day.total_attendance) as total_att,
|
||||
sum(day.total_timesheet) as total_ts,
|
||||
sum(day.total_difference) as total_diff,
|
||||
sum(aal.unit_amount) as quantity,
|
||||
sum(aal.amount) as cost,
|
||||
aal.account_id,
|
||||
aal.product_id,
|
||||
aal.to_invoice,
|
||||
aal.general_account_id,
|
||||
htss.user_id,
|
||||
htss.company_id,
|
||||
htss.department_id,
|
||||
@@ -75,7 +80,6 @@ class timesheet_report(osv.osv):
|
||||
from account_analytic_line as aal
|
||||
left join hr_analytic_timesheet as hat ON (hat.line_id=aal.id)
|
||||
left join hr_timesheet_sheet_sheet as htss ON (hat.line_id=htss.id)
|
||||
left join hr_timesheet_sheet_sheet_day AS day ON (htss.id = day.sheet_id)
|
||||
group by
|
||||
to_char(htss.date_current,'YYYY'),
|
||||
to_char(htss.date_current,'MM'),
|
||||
@@ -84,6 +88,9 @@ class timesheet_report(osv.osv):
|
||||
htss.date_from,
|
||||
htss.date_to,
|
||||
htss.date_current,
|
||||
aal.to_invoice,
|
||||
aal.product_id,
|
||||
aal.general_account_id,
|
||||
htss.name,
|
||||
htss.company_id,
|
||||
htss.state,
|
||||
|
||||
@@ -7,10 +7,9 @@
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Timesheet" type="bar">
|
||||
<field name="name" />
|
||||
<field name="total_att" operator = "+"/>
|
||||
<field name="total_ts" operator = "+"/>
|
||||
<field name="user_id" group = "True"/>
|
||||
<field name="user_id" />
|
||||
<field name="quantity" operator = "+"/>
|
||||
<field name="state" group = "True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
@@ -25,12 +24,15 @@
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="date_from" invisible="1"/>
|
||||
<field name="date_to" invisible="1"/>
|
||||
<field name="total_att" sum="Total Timesheet"/>
|
||||
<field name="total_diff" sum="Total Attendance"/>
|
||||
<field name="total_ts" sum="Difference"/>
|
||||
<field name="quantity" sum="#Quantity"/>
|
||||
<field name="cost" sum="#Cost"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="to_invoice" invisible="1"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="account_id" invisible="1"/>
|
||||
<field name="general_account_id" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
@@ -43,7 +45,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Timesheet">
|
||||
<group col="10" colspan="4">
|
||||
<group col="10" colspan="12">
|
||||
<filter icon="terp-hr" string="This Year"
|
||||
domain="[('date_current','<=', time.strftime('%%Y-%%m-%%d')),('date_current','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Timesheet in this year"/>
|
||||
@@ -63,10 +65,8 @@
|
||||
<filter icon="terp-hr"
|
||||
string="Confirmed"
|
||||
domain="[('state','=','confirm')]"/>
|
||||
<filter icon="terp-hr"
|
||||
string="Done"
|
||||
domain="[('state','=','done')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="product_id"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-hr"
|
||||
string="Non Assigned timesheets to users"
|
||||
@@ -76,26 +76,40 @@
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-hr"
|
||||
string="New"
|
||||
domain="[('state','=','new')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="department_id" widget="selection"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
</group>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-hr"
|
||||
string="New"
|
||||
domain="[('state','=','new')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_from"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="account_id"/>
|
||||
<field name="department_id" widget="selection"/>
|
||||
<newline/>
|
||||
<filter icon="terp-hr"
|
||||
string="Done"
|
||||
domain="[('state','=','done')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_to"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="general_account_id"/>
|
||||
<field name="to_invoice" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Product" icon="terp-hr" context="{'group_by':'product_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Type of Invoicing" icon="terp-hr" context="{'group_by':'to_invoice'}"/>
|
||||
<filter string="Analytic Account" icon="terp-hr" context="{'group_by':'account_id'}"/>
|
||||
<filter string="General Account" icon="terp-hr" context="{'group_by':'general_account_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
|
||||
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'date_current'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
|
||||
@@ -27,12 +27,16 @@ class mrp_production_order(osv.osv):
|
||||
_description = "Production Order Report"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'year': fields.char('Year',size=64,readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
'day': fields.char('Day',size=64,readonly=True),
|
||||
'origin': fields.char('Source Document', size=64),
|
||||
'nbr': fields.integer('# of Orders', readonly=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', readonly=True, domain=[('type','<>','service')]),
|
||||
'products_to_consume': fields.integer('Products to Consume', readonly=True),
|
||||
'consumed_products': fields.integer('Consumed Products', readonly=True),
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', readonly=True),
|
||||
'product_qty': fields.float('Product Qty', readonly=True),
|
||||
'state': fields.selection([('draft','Draft'),
|
||||
('picking_except', 'Picking Exception'),
|
||||
@@ -43,14 +47,15 @@ class mrp_production_order(osv.osv):
|
||||
('done','Done')],
|
||||
'State', readonly=True),
|
||||
'date_planned':fields.date('Scheduled Date'),
|
||||
'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', required=True),
|
||||
'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', readonly=True),
|
||||
'date_start': fields.datetime('Start Date',readonly=True),
|
||||
'date_finnished': fields.datetime('End Date',readonly=True),
|
||||
'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', required=True),
|
||||
'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', readonly=True),
|
||||
'company_id': fields.many2one('res.company','Company',readonly=True),
|
||||
'bom_id': fields.many2one('mrp.bom', 'Bill of Material', domain=[('bom_id','=',False)],readonly=True),
|
||||
'routing_id': fields.many2one('mrp.routing', string='Routing', on_delete='set null',readonly=True),
|
||||
'bom_id': fields.many2one('mrp.bom', 'Bill of Material',readonly=True),
|
||||
'routing_id': fields.many2one('mrp.routing', string='Routing',readonly=True),
|
||||
'picking_id': fields.many2one('stock.picking', 'Picking list', readonly=True),
|
||||
'product_uom': fields.many2one('product.uom', 'Product UOM', readonly=True),
|
||||
'priority': fields.selection([('0','Not urgent'),
|
||||
('1','Normal'),
|
||||
('2','Urgent'),
|
||||
@@ -65,12 +70,27 @@ class mrp_production_order(osv.osv):
|
||||
create or replace view mrp_production_order as (
|
||||
select
|
||||
min(l.id) as id,
|
||||
to_char(s.create_date, 'YYYY') as name,
|
||||
to_date(to_char(s.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY') as date,
|
||||
to_char(s.create_date, 'YYYY') as year,
|
||||
to_char(s.create_date, 'MM') as month,
|
||||
to_char(s.create_date, 'YYYY-MM-DD') as day,
|
||||
l.product_id as product_id,
|
||||
l.product_uom,
|
||||
sum(l.product_qty * u.factor) as product_qty,
|
||||
s.company_id as company_id,
|
||||
count(*) as nbr,
|
||||
(select sum(sm.product_qty) from stock_move as sm
|
||||
left join mrp_production_move_ids as mv on (sm.id=mv.move_id)
|
||||
left join mrp_production_product_line as ll on (ll.production_id=mv.production_id)
|
||||
where sm.product_id=ll.product_id and ll.id=l.id
|
||||
and sm.state not in ('done','cancel')
|
||||
group by sm.product_id) as products_to_consume,
|
||||
(select sum(sm.product_qty)/2 from stock_move as sm
|
||||
left join mrp_production_move_ids as mv on (sm.id=mv.move_id)
|
||||
left join mrp_production_product_line as ll on (ll.production_id=mv.production_id)
|
||||
where sm.product_id=ll.product_id and ll.id=l.id
|
||||
and sm.state in ('done','cancel')
|
||||
group by sm.product_id) as consumed_products,
|
||||
s.location_src_id,
|
||||
s.location_dest_id,
|
||||
s.bom_id,
|
||||
@@ -82,16 +102,18 @@ class mrp_production_order(osv.osv):
|
||||
s.origin,
|
||||
s.priority,
|
||||
s.state
|
||||
from
|
||||
mrp_production_product_line l
|
||||
left join
|
||||
mrp_production s on (s.id=l.production_id)
|
||||
left join product_uom u on (u.id=l.product_uom)
|
||||
from mrp_production_product_line l
|
||||
left join mrp_production s on (s.id=l.production_id)
|
||||
left join product_uom u on (u.id=l.product_uom)
|
||||
group by
|
||||
to_char(s.create_date, 'YYYY'),
|
||||
to_char(s.create_date, 'MM'),
|
||||
to_char(s.create_date, 'YYYY-MM-DD'),
|
||||
to_date(to_char(s.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY'),
|
||||
l.product_id,
|
||||
l.product_uom,
|
||||
s.id,
|
||||
l.id,
|
||||
s.bom_id,
|
||||
s.routing_id,
|
||||
s.picking_id,
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search">
|
||||
<group col="16" colspan="6">
|
||||
<filter string="This Year" name="this_year" icon="terp-mrp" domain="[('name','=',time.localtime()[0])]"/>
|
||||
<filter string="This Month" name="this_month" icon="terp-mrp" domain="[('month','=',time.strftime('%%m'))]"/>
|
||||
<filter string="This Year" icon="terp-mrp" domain="[('name','=',time.localtime()[0])]" default="1" />
|
||||
<filter string="This Month" icon="terp-mrp" domain="[('month','=',time.strftime('%%m'))]" default="1"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Current" icon="terp-mrp" domain="[('state','in',('open','draft'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -101,7 +101,7 @@
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="view_id" ref="view_report_mrp_production_order_tree"/>
|
||||
<field name="search_view_id" ref="view_report_mrp_production_order_filter"/>
|
||||
<field name="context">{'search_default_Product': 1,'search_default_this_year':1,'search_default_this_month':1}</field>
|
||||
<field name="context">{'search_default_Product': 1}</field>
|
||||
|
||||
</record>
|
||||
|
||||
|
||||
@@ -30,17 +30,16 @@ class report_project_task_user(osv.osv):
|
||||
'name': fields.char('Task Summary', size=128, readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'year': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'Assigned To', readonly=True),
|
||||
'date_start': fields.datetime('Starting Date',readonly=True),
|
||||
'no_of_days': fields.integer('#Days', size=128, readonly=True),
|
||||
'description': fields.text('Description',readonly=True),
|
||||
'date_end': fields.datetime('Ending Date',readonly=True),
|
||||
'date_end': fields.date('Ending Date',readonly=True),
|
||||
'date_deadline': fields.date('Deadline',readonly=True),
|
||||
'project_id':fields.many2one('project.project', 'Project', readonly=True),
|
||||
'hours_planned': fields.float('Planned Hours', readonly=True),
|
||||
'hours_effective': fields.float('Effective Hours', readonly=True),
|
||||
'hours_delay': fields.float('Avg. Plan.-Eff.', readonly=True),
|
||||
# 'closing_days': fields.char('Avg Closing Delay', size=64, readonly=True),
|
||||
'closing_days': fields.float('Avg Closing Delay', digits=(16,2), readonly=True, group_operator="avg",
|
||||
help="Number of Days to close the task"),
|
||||
|
||||
@@ -102,7 +101,6 @@ class report_project_task_user(osv.osv):
|
||||
t.state,
|
||||
date_trunc('day',t.date_end),
|
||||
to_date(to_char(t.date_deadline, 'dd-MM-YYYY'),'dd-MM-YYYY'),
|
||||
date_trunc('day',t.date_start),
|
||||
t.company_id,
|
||||
t.partner_id,
|
||||
t.type,
|
||||
|
||||
@@ -79,13 +79,17 @@
|
||||
help = "Pending tasks"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-project"
|
||||
string="My Task"
|
||||
help = "My tasks"
|
||||
domain="[('user_id','=',uid)]" />
|
||||
<filter icon="terp-project"
|
||||
string="Non Assigned Tasks to users"
|
||||
help="Non Assigned Tasks to users"
|
||||
domain="[('user_id','=',False)]"/>
|
||||
</field>
|
||||
<field name="project_id" widget="selection">
|
||||
<filter icon="terp-project"
|
||||
<field name="project_id">
|
||||
<filter icon="terp-project"
|
||||
string="My Task"
|
||||
help="My Tasks"
|
||||
domain="[('project_id','=',context.get('project_id', False)]"/>
|
||||
@@ -139,7 +143,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="search_view_id" ref="view_task_project_user_search"/>
|
||||
<field name="context">{'search_default_month':1,'search_default_User':1,'search_default_user_id':uid,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
|
||||
</record>
|
||||
<menuitem action="action_project_task_user_tree" id="menu_project_task_user_tree" parent="base.menu_project_report"/>
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
'author': 'Tiny',
|
||||
'website': 'http://www.openerp.com',
|
||||
'depends': [
|
||||
'crm',
|
||||
'project',
|
||||
'hr_timesheet_sheet',
|
||||
],
|
||||
'init_xml': [
|
||||
'project_issue_data.xml'
|
||||
|
||||
@@ -68,19 +68,21 @@ class project_issue_report(osv.osv):
|
||||
'create_date': fields.datetime('Create Date', readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue')]"),
|
||||
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue')]"),
|
||||
'nbr': fields.integer('# of Issues', readonly=True),
|
||||
'delay_close': fields.float('Avg Closing Delay', digits=(16,2), readonly=True, group_operator="avg",
|
||||
help="Number of Days to close the project issue"),
|
||||
help="Number of Days to close the project issue"),
|
||||
'delay_open': fields.float('Avg Opening Delay', digits=(16,2), readonly=True, group_operator="avg",
|
||||
help="Number of Days to open the project issue"),
|
||||
'company_id' : fields.many2one('res.company', 'Company'),
|
||||
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
|
||||
'project_id':fields.many2one('project.project', 'Project',readonly=True),
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Type', domain="[('object_id.model', '=', 'project.issue')]"),
|
||||
'date_closed': fields.datetime('Close Date', readonly=True),
|
||||
'date_open': fields.datetime('Opened', readonly=True),
|
||||
'assigned_to' : fields.many2one('res.users', 'Assigned to',readonly=True),
|
||||
'partner_id': fields.many2one('res.partner','Partner',domain="[('object_id.model', '=', 'project.issue')]"),
|
||||
'canal_id': fields.many2one('res.partner.canal', 'Channel',readonly=True),
|
||||
'task_id': fields.many2one('project.task', 'Task',domain="[('object_id.model', '=', 'project.issue')]" )
|
||||
'task_id': fields.many2one('project.task', 'Task',domain="[('object_id.model', '=', 'project.issue')]" ),
|
||||
'partner_address_id': fields.many2one('res.partner.address','Contact ',readonly=True),
|
||||
}
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'project_issue_report')
|
||||
@@ -95,19 +97,20 @@ class project_issue_report(osv.osv):
|
||||
c.user_id,
|
||||
c.section_id,
|
||||
c.categ_id,
|
||||
c.stage_id,
|
||||
to_char(c.date_closed, 'YYYY/mm/dd') as date_closed,
|
||||
u.company_id as company_id,
|
||||
c.priority as priority,
|
||||
c.project_id as project_id,
|
||||
c.type_id as type_id,
|
||||
count(*) as nbr,
|
||||
c.assigned_to,
|
||||
c.partner_id,
|
||||
c.canal_id,
|
||||
c.task_id,
|
||||
c.partner_address_id as partner_address_id,
|
||||
c.date_open as date_open,
|
||||
date_trunc('day',c.create_date) as create_date,
|
||||
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
|
||||
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close,
|
||||
avg(extract('epoch' from (c.date_open-c.create_date)))/(3600*24) as delay_open
|
||||
from
|
||||
project_issue c
|
||||
left join
|
||||
@@ -120,17 +123,17 @@ class project_issue_report(osv.osv):
|
||||
c.user_id,
|
||||
c.section_id,
|
||||
c.categ_id,
|
||||
c.stage_id,
|
||||
c.date_closed,
|
||||
u.company_id,
|
||||
c.priority,
|
||||
c.project_id,
|
||||
c.type_id,
|
||||
date_trunc('day',c.create_date),
|
||||
c.assigned_to,
|
||||
c.partner_id,
|
||||
c.canal_id,
|
||||
c.task_id
|
||||
c.task_id,
|
||||
c.date_open,
|
||||
c.partner_address_id
|
||||
)""")
|
||||
|
||||
|
||||
@@ -138,4 +141,4 @@ project_issue_report()
|
||||
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -11,23 +11,22 @@
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="project_id" invisible="1"/>
|
||||
<field name="stage_id" invisible="1"/>
|
||||
<field name="type_id" string="Type" invisible="1"/>
|
||||
<field name="priority" invisible="1"/>
|
||||
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
|
||||
<field name="delay_close" avg='Avg Closing Delay'/>
|
||||
<field name="section_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="categ_id" invisible="1"/>
|
||||
<field name="canal_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="task_id" invisible="1"/>
|
||||
<field name="assigned_to" invisible="1"/>
|
||||
<field name="date_open" invisible="1"/>
|
||||
<field name="date_closed" invisible="1"/>
|
||||
<field name="create_date" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="partner_address_id" string="Contact" invisible="1"/>
|
||||
<field name="nbr" string="#Project Issue" sum='#Number of Project Issue'/>
|
||||
<field name="delay_open" avg='Avg Opening Delay'/>
|
||||
<field name="delay_close" avg='Avg Closing Delay'/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -36,7 +35,7 @@
|
||||
<field name="model">project.issue.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph orientation="horizontal" string="Project Issue" type="bar">
|
||||
<graph orientation="vertical" string="Project Issue" type="bar">
|
||||
<field name="state"/>
|
||||
<field name="nbr" operator="+"/>
|
||||
<field group="True" name="user_id"/>
|
||||
@@ -51,14 +50,10 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search">
|
||||
<group col="16" colspan="8">
|
||||
<!-- <filter string="This Year" name="This Year" icon="terp-hr"
|
||||
domain="[('name','=',time.localtime()[0])]"/>-->
|
||||
<filter string="This Year" icon="terp-hr"
|
||||
<filter icon="gtk-media-rewind" string="365 Days" icon="terp-hr"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<!-- <filter string="This Month" name="This Year" icon="terp-hr"
|
||||
domain="[('month','=',time.strftime('%%m'))]" />-->
|
||||
<filter string="This Month" icon="terp-hr" name="This Month"
|
||||
<filter icon="gtk-media-rewind" string="30 Days" icon="terp-hr" name="This Month"
|
||||
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"/>
|
||||
|
||||
<filter icon="gtk-media-rewind" string="7 Days" separator="1"
|
||||
@@ -109,68 +104,50 @@
|
||||
<field name="project_id" widget="selection" />
|
||||
<field name="priority" />
|
||||
<separator orientation="vertical"/>
|
||||
<<<<<<< TREE
|
||||
=======
|
||||
<field name="type_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
|
||||
<field name="task_id"/>
|
||||
>>>>>>> MERGE-SOURCE
|
||||
<separator orientation="vertical"/>
|
||||
<newline/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
|
||||
<<<<<<< TREE
|
||||
=======
|
||||
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]" />
|
||||
>>>>>>> MERGE-SOURCE
|
||||
<separator orientation="vertical"/>
|
||||
<field name="assigned_to" widget="selection">
|
||||
<filter icon="terp-crm" help = "Project Issue Assigned To Me" domain="[('assigned_to','=',uid)]" />
|
||||
<filter icon="terp-crm" help="Non Assigned Project Issue" domain="[('assigned_to','=',False)]"/>
|
||||
</field>
|
||||
<newline/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
|
||||
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_id" />
|
||||
<field name="canal_id" widget="selection"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_address_id" />
|
||||
<newline/>
|
||||
<field name="date_open" string="Date Open"/>
|
||||
<field name="date_closed" string="Date Closed"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<filter string="Stage" icon="terp-sale" domain="[]" context="{'group_by':'stage_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Project" icon="terp-sale" domain="[]" context="{'group_by':'project_id'}" />
|
||||
<filter string="Priority" icon="terp-sale" domain="[]" context="{'group_by':'priority'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Type" icon="terp-sale" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<filter string="Task" icon="terp-sale" domain="[]" context="{'group_by':'task_id'}"/>
|
||||
<newline/>
|
||||
<filter string="Assigned To" icon="terp-sale" domain="[]" context="{'group_by':'assigned_to'}"/>
|
||||
<filter string="Partner" icon="terp-sale" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Channel" icon="terp-sale" domain="[]" context="{'group_by':'canal_id'}"/>
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
</search>
|
||||
</xpath>
|
||||
<xpath expr='//search[@string="Search"]/group[@string="Group By..."]/filter[@string="Category"]' position='after'>
|
||||
<<<<<<< TREE
|
||||
=======
|
||||
<filter string="Stage" icon="terp-sale" domain="[]" context="{'group_by':'stage_id'}"/>
|
||||
>>>>>>> MERGE-SOURCE
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Project" icon="terp-sale" domain="[]" context="{'group_by':'project_id'}" />
|
||||
<filter string="Priority" icon="terp-sale" domain="[]" context="{'group_by':'priority'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<<<<<<< TREE
|
||||
=======
|
||||
<filter string="Type" icon="terp-sale" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
>>>>>>> MERGE-SOURCE
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Assigned To" icon="terp-sale" domain="[]" context="{'group_by':'assigned_to'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Partner" icon="terp-sale" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Contact" icon="terp-sale" domain="[]" context="{'group_by':'partner_address_id'}"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -112,7 +112,11 @@
|
||||
<button name="do_reopen" states="done,cancelled" string="Reactivate" type="object" icon="gtk-convert"/>
|
||||
<button name="do_pending" states="open" string="Pending" type="object" icon="gtk-media-pause"/>
|
||||
<button groups="base.group_extended" name="%(project.action_project_task_delegate)d" states="pending,open" string="Delegate" type="action" icon="gtk-sort-descending"/>
|
||||
<<<<<<< TREE
|
||||
<button name="do_close" states="pending,open" string="Done" type="object" icon="gtk-jump-to"/>
|
||||
=======
|
||||
<button name="%(project.action_project_close_task)d" states="pending,open" string="Done" type="action" icon="gtk-jump-to"/>
|
||||
>>>>>>> MERGE-SOURCE
|
||||
<button name="do_cancel" states="draft,open,pending" string="Cancel" type="object" icon="gtk-cancel"/>
|
||||
|
||||
</group>
|
||||
|
||||
@@ -74,10 +74,6 @@
|
||||
<group col="10" colspan="4">
|
||||
<filter icon="terp-project" string="This Year" domain="[('year','=',time.strftime('%%Y'))]" help="Tasks performed in this year"/>
|
||||
<filter icon="terp-project" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Tasks performed in this month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Start Date" icon="terp-project" domain="[('date_start','=',time.strftime('%%Y/%%m/%%d'))]"/>
|
||||
<filter string="End Date" icon="terp-project" domain="[('date_end','=',time.strftime('%%Y/%%m/%%d'))]"/>
|
||||
<filter string="Deadline Date" icon="terp-project" domain="[('date_deadline','=',time.strftime('%%Y/%%m/%%d'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="project_id" select="1"/>
|
||||
<field name="user_id" select="1" widget="selection"/>
|
||||
|
||||
@@ -54,6 +54,12 @@ class purchase_report(osv.osv):
|
||||
'location_id': fields.many2one('stock.location', 'Destination', readonly=True),
|
||||
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position',readonly=True),
|
||||
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
|
||||
'partner_address_id':fields.many2one('res.partner.address', 'Address Contact Name', readonly=True),
|
||||
'dest_address_id':fields.many2one('res.partner.address', 'Dest. Address Contact Name',readonly=True),
|
||||
'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', readonly=True),
|
||||
'date_approve':fields.date('Date Approved', readonly=True),
|
||||
'expected_date':fields.date('Expected Date', readonly=True),
|
||||
'validator' : fields.many2one('res.users', 'Validated by', readonly=True),
|
||||
'company_id':fields.many2one('res.company', 'Company', readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
|
||||
'quantity': fields.float('# of Products', readonly=True),
|
||||
@@ -76,6 +82,12 @@ class purchase_report(osv.osv):
|
||||
to_char(s.date_order, 'MM') as month,
|
||||
to_char(s.date_order, 'YYYY-MM-DD') as day,
|
||||
s.state,
|
||||
s.date_approve,
|
||||
date_trunc('day',s.minimum_planned_date) as expected_date,
|
||||
s.partner_address_id,
|
||||
s.dest_address_id,
|
||||
s.pricelist_id,
|
||||
s.validator,
|
||||
s.warehouse_id as warehouse_id,
|
||||
s.partner_id as partner_id,
|
||||
s.fiscal_position,
|
||||
@@ -97,6 +109,12 @@ class purchase_report(osv.osv):
|
||||
s.create_uid,
|
||||
s.partner_id,
|
||||
s.location_id,
|
||||
s.date_approve,
|
||||
date_trunc('day',s.minimum_planned_date),
|
||||
s.partner_address_id,
|
||||
s.pricelist_id,
|
||||
s.validator,
|
||||
s.dest_address_id,
|
||||
l.product_id,
|
||||
s.date_order,
|
||||
to_char(s.date_order, 'YYYY'),
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Purchase Orders Statistics">
|
||||
<field name="date" invisible="1"/>
|
||||
<field name="date_approve" invisible="1"/>
|
||||
<field name="expected_date" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
@@ -32,6 +34,10 @@
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="warehouse_id" invisible="1"/>
|
||||
<field name="partner_address_id" invisible="1"/>
|
||||
<field name="dest_address_id" invisible="1"/>
|
||||
<field name="pricelist_id" invisible="1"/>
|
||||
<field name="validator" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="location_id" invisible="1"/>
|
||||
@@ -46,7 +52,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Purchase Orders">
|
||||
<group>
|
||||
<group colspan="10" col="12">
|
||||
<filter icon="terp-purchase" string="This Year"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Tasks performed in this year"/>
|
||||
@@ -71,44 +77,60 @@
|
||||
domain="[('state','=','manual')]"/>
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_id" string="Supplier"/>
|
||||
<field name="product_id"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-purchase"
|
||||
string="Purchase Non User"
|
||||
help="Purchase Non User"
|
||||
domain="[('user_id','=',False)]"/>
|
||||
</field>
|
||||
<field name="partner_id"/>
|
||||
<field name="product_id"/>
|
||||
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-purchase" string="Shipping Exception" domain="[('state','=','shipping_except')]"/>
|
||||
<filter icon="terp-purchase" string="Done" domain="[('state','=','done')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_approve"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_address_id"/>
|
||||
<field name="invoice_method"/>
|
||||
<field name="warehouse_id" widget="selection"/>
|
||||
<field name="location_id" widget="selection"/>
|
||||
<field name="validator" widget="selection"/>
|
||||
|
||||
<newline/>
|
||||
<filter icon="terp-purchase" string="Invoice Exception " domain="[('state','=','invoice_except')]"/>
|
||||
<filter icon="terp-purchase" string="Cancel" domain="[('state','=','cancel')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="expected_date"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="dest_address_id"/>
|
||||
<field name="fiscal_position" widget="selection"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="date"/>
|
||||
<field name="location_id" widget="selection"/>
|
||||
<field name="pricelist_id" widget="selection"/>
|
||||
|
||||
<newline/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Company" icon="terp-purchase" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Warehouse" icon="terp-purchase" context="{'group_by':'warehouse_id'}"/>
|
||||
<filter string="Location" icon="terp-purchase" context="{'group_by':'location_id'}"/>
|
||||
<filter string="Responsible" name="Responsible" icon="terp-purchase" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Responsible" name="Responsible" icon="terp-purchase" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Pricelist" icon="terp-purchase" context="{'group_by':'pricelist_id'}"/>
|
||||
<filter string="Validated by" icon="terp-purchase" context="{'group_by':'validator'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Address Contact Name" icon="terp-purchase" context="{'group_by':'partner_address_id'}"/>
|
||||
<filter string="Dest. Contact Name" icon="terp-purchase" context="{'group_by':'dest_address_id'}"/>
|
||||
<filter string="Product" icon="terp-purchase" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Partner" name="partner_id" icon="terp-purchase" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Supplier" name="partner_id" icon="terp-purchase" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="State" icon="terp-purchase" context="{'group_by':'state'}"/>
|
||||
<filter string="Fiscal Position" icon="terp-purchase" context="{'group_by':'fiscal_position'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<newline/>
|
||||
<filter string="Day" icon="terp-purchase" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-purchase" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-purchase" context="{'group_by':'name'}"/>
|
||||
|
||||
@@ -57,6 +57,12 @@ class sale_report(osv.osv):
|
||||
('done', 'Done'),
|
||||
('cancel', 'Cancelled')
|
||||
], 'Order State', readonly=True),
|
||||
'partner_invoice_id': fields.many2one('res.partner.address', 'Invoice Address Name', readonly=True),
|
||||
'partner_order_id': fields.many2one('res.partner.address', 'Ordering Contact Name', readonly=True),
|
||||
'partner_shipping_id': fields.many2one('res.partner.address', 'Shipping Address Name', readonly=True),
|
||||
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True),
|
||||
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
|
||||
'date_confirm': fields.date('Confirmation Date', readonly=True)
|
||||
}
|
||||
_order = 'date desc'
|
||||
def init(self, cr):
|
||||
@@ -81,7 +87,13 @@ class sale_report(osv.osv):
|
||||
sum(l.product_uom_qty*l.price_unit) as price_total,
|
||||
(sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty * u.factor))::decimal(16,2) as price_average,
|
||||
count(*) as nbr,
|
||||
s.state
|
||||
s.state,
|
||||
s.partner_invoice_id as partner_invoice_id,
|
||||
s.partner_order_id as partner_order_id,
|
||||
s.partner_shipping_id as partner_shipping_id,
|
||||
s.pricelist_id as pricelist_id,
|
||||
s.project_id as analytic_account_id,
|
||||
s.date_confirm as date_confirm
|
||||
from
|
||||
sale_order_line l
|
||||
left join
|
||||
@@ -97,7 +109,13 @@ class sale_report(osv.osv):
|
||||
s.shop_id,
|
||||
s.company_id,
|
||||
s.fiscal_position,
|
||||
s.payment_term
|
||||
s.payment_term,
|
||||
s.partner_invoice_id,
|
||||
s.partner_order_id,
|
||||
s.partner_shipping_id,
|
||||
s.pricelist_id,
|
||||
s.project_id,
|
||||
s.date_confirm
|
||||
)
|
||||
""")
|
||||
sale_report()
|
||||
@@ -167,10 +185,14 @@ class product_bought_by_sale_order(osv.osv):
|
||||
_name = "product.bought.by.sale.order"
|
||||
_description = "Product bought by sale order"
|
||||
_auto = False
|
||||
_rec_name = 'partner'
|
||||
_rec_name = 'month'
|
||||
_columns = {
|
||||
'total_products': fields.integer('Total Products', readonly=True),
|
||||
'name': fields.char('Sale order', size=64, readonly=True)
|
||||
'product_id':fields.many2one('product.product', 'Product', readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
|
||||
'year': fields.char('Year', size=64, readonly=True)
|
||||
}
|
||||
_order = 'total_products desc'
|
||||
def init(self, cr):
|
||||
@@ -179,8 +201,10 @@ class product_bought_by_sale_order(osv.osv):
|
||||
create or replace view product_bought_by_sale_order as (
|
||||
select
|
||||
min(s.id) as id,
|
||||
count(*) as total_products,
|
||||
s.name as name
|
||||
l.product_id as product_id,
|
||||
to_char(l.create_date, 'MM') as month,
|
||||
to_char(l.create_date, 'YYYY') as year,
|
||||
count(*) as total_products
|
||||
from
|
||||
sale_order_line l
|
||||
left join
|
||||
@@ -188,7 +212,7 @@ class product_bought_by_sale_order(osv.osv):
|
||||
where
|
||||
s.state='manual' or s.state='progress'
|
||||
group by
|
||||
s.name
|
||||
l.product_id, to_char(l.create_date, 'MM'), to_char(l.create_date, 'YYYY')
|
||||
)
|
||||
""")
|
||||
product_bought_by_sale_order()
|
||||
|
||||
@@ -24,6 +24,12 @@
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="fiscal_position" invisible="1"/>
|
||||
<field name="payment_term" invisible="1"/>
|
||||
<field name="partner_invoice_id" invisible="1"/>
|
||||
<field name="partner_order_id" invisible="1"/>
|
||||
<field name="partner_shipping_id" invisible="1"/>
|
||||
<field name="pricelist_id" invisible="1"/>
|
||||
<field name="analytic_account_id" invisible="1"/>
|
||||
<field name="date_confirm" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -93,8 +99,16 @@
|
||||
<filter icon="terp-sale" string="Done" domain="[('state','=','done')]"/>
|
||||
<filter icon="terp-sale" string="Cancelled" domain="[('state','=','cancel')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_invoice_id"/>
|
||||
<field name="partner_order_id"/>
|
||||
<field name="partner_shipping_id"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="pricelist_id" widget="selection"/>
|
||||
<field name="analytic_account_id"/>
|
||||
<newline/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="date"/>
|
||||
<field name="date_confirm"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<newline/>
|
||||
@@ -108,9 +122,16 @@
|
||||
<filter string="Partner" icon="terp-sale" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Payment Term" icon="terp-sale" context="{'group_by':'payment_term'}"/>
|
||||
<filter string="State" icon="terp-sale" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Pricelist" icon="terp-sale" context="{'group_by':'pricelist_id'}"/>
|
||||
<filter string="Analytic Account" icon="terp-sale" context="{'group_by':'analytic_account_id'}"/>
|
||||
<newline/>
|
||||
<filter string="Invoice Address Name" icon="terp-sale" context="{'group_by':'partner_invoice_id'}"/>
|
||||
<filter string="Ordering Contact Name" icon="terp-sale" context="{'group_by':'partner_order_id'}"/>
|
||||
<filter string="Shipping Address Name" icon="terp-sale" context="{'group_by':'partner_shipping_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-sale" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-sale" context="{'group_by':'date'}"/>
|
||||
<filter string="Month" icon="terp-sale" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-sale" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
@@ -201,7 +222,9 @@
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Product bought by sale order">
|
||||
<field name="name"/>
|
||||
<field name="product_id"/>
|
||||
<field name="month"/>
|
||||
<field name="year"/>
|
||||
<field name="total_products"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -213,8 +236,9 @@
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Product bought by sale order" type="bar">
|
||||
<field name="name"/>
|
||||
<field name="total_products" operator="+"/>
|
||||
<field name="product_id" select="1"/>
|
||||
<field name="total_products" select="1"/>
|
||||
<field name="month" group = "True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
@@ -223,7 +247,8 @@
|
||||
<field name="name">Product bought by sale order</field>
|
||||
<field name="res_model">product.bought.by.sale.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="domain">[('year','=', time.strftime('%Y'))]</field>
|
||||
<field name="view_id" ref="view_product_bought_by_sale_order_tree"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -30,17 +30,30 @@ class report_stock_picking(osv.osv):
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'reference': fields.char('Reference', size=64, select=True),
|
||||
'nbr': fields.integer('# of Lines', readonly=True),
|
||||
'nbp': fields.integer('# of Picking', readonly=True),
|
||||
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
|
||||
'product_qty': fields.float('# of Products', readonly=True),
|
||||
'product_uos_qty': fields.float('# of Products', readonly=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', readonly=True),
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'avg_days_to_deliver': fields.float('Avg Days to Deliver', digits=(16,2), readonly=True, group_operator="avg",
|
||||
help="Number of Avg Days to deliver"),
|
||||
'origin': fields.char('Origin', size=64),
|
||||
'state': fields.selection([('draft', 'Draft'),('auto', 'Waiting'),('confirmed', 'Confirmed'),('assigned', 'Available'),('done', 'Done'),('cancel', 'Cancelled')], 'State'),
|
||||
'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('delivery', 'Delivery')], 'Shipping Type', required=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'invoice_state': fields.selection([
|
||||
("invoiced", "Invoiced"),
|
||||
("2binvoiced", "To Be Invoiced"),
|
||||
("none", "Not from Picking")], "Invoice Status",readonly=True),
|
||||
'min_date': fields.date('Expected Date',help="Expected date for Picking. Default it takes current date"),
|
||||
'order_date': fields.date('Order Date', help="Date of Order"),
|
||||
'date_done': fields.date('Date Done', help="Date of completion"),
|
||||
'location_id': fields.many2one('stock.location', 'Source Location', help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
|
||||
'location_dest_id': fields.many2one('stock.location', 'Dest. Location', help="Location where the system will stock the finished products."),
|
||||
'max_date': fields.date('Max.Expected Date'),
|
||||
'product_uos': fields.many2one('product.uom', 'Product UOS'),
|
||||
'product_uom': fields.many2one('product.uom', 'Product UOM'),
|
||||
}
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'report_stock_picking')
|
||||
@@ -48,6 +61,10 @@ class report_stock_picking(osv.osv):
|
||||
create or replace view report_stock_picking as (
|
||||
select
|
||||
min(sm.id) as id,
|
||||
date_trunc('day',sp.min_date) as min_date,
|
||||
date_trunc('day',sp.date) as order_date,
|
||||
date_trunc('day',sp.date_done) as date_done,
|
||||
date_trunc('day',sp.max_date) as max_date,
|
||||
to_char(sp.create_date, 'YYYY') as year,
|
||||
to_char(sp.create_date, 'MM') as month,
|
||||
to_char(sp.create_date, 'YYYY-MM-DD') as day,
|
||||
@@ -56,19 +73,37 @@ class report_stock_picking(osv.osv):
|
||||
count(sm.id) as nbr,
|
||||
count(distinct sp.id) as nbp,
|
||||
sum(sm.product_qty) as product_qty,
|
||||
sum(sm.product_uos_qty) as product_uos_qty,
|
||||
sm.product_id as product_id,
|
||||
sm.location_dest_id as location_dest_id,
|
||||
sm.location_id as location_id,
|
||||
sp.type,
|
||||
sp.name as reference,
|
||||
sp.origin,
|
||||
sm.product_uos,
|
||||
sm.product_uom,
|
||||
sp.invoice_state,
|
||||
sp.company_id as company_id,
|
||||
avg(extract('epoch' from (sp.date_done-sp.create_date)))/(3600*24) as avg_days_to_deliver,
|
||||
sp.state
|
||||
from stock_move as sm
|
||||
left join stock_picking as sp ON (sm.picking_id=sp.id)
|
||||
group by sp.type,
|
||||
sp.create_date,
|
||||
sp.address_id,
|
||||
sp.name,
|
||||
sp.origin,
|
||||
sp.state
|
||||
sp.create_date,
|
||||
sp.address_id,
|
||||
sm.product_id,
|
||||
to_char(sp.create_date, 'YYYY'),
|
||||
sm.location_dest_id,
|
||||
sm.location_id,
|
||||
to_char(sp.create_date, 'MM'),
|
||||
to_char(sp.create_date, 'YYYY-MM-DD'),
|
||||
sm.product_uos,
|
||||
sm.product_uom,
|
||||
date_trunc('day',sp.min_date),
|
||||
date_trunc('day',sp.date),
|
||||
date_trunc('day',sp.date_done),
|
||||
date_trunc('day',sp.max_date),
|
||||
sp.invoice_state,
|
||||
sp.company_id,
|
||||
sp.state
|
||||
|
||||
)""")
|
||||
report_stock_picking()
|
||||
|
||||
Reference in New Issue
Block a user