[MERGE]: merging report development team task to trunk

merge a branch from lp:~openerp-dev/openobject-addons/trunk-dev-reporting/

bzr revid: mga@mga-20100317101119-5giu2ptrdv4h0jkg
This commit is contained in:
Mantavya Gajjar
2010-03-17 15:41:19 +05:30
118 changed files with 2300 additions and 1458 deletions
+2
View File
@@ -61,6 +61,8 @@
'sequence_view.xml',
'company_view.xml',
'account_installer.xml',
'report/account_invoice_report_view.xml',
'report/account_report_view.xml',
],
'demo_xml': [
#'demo/price_accuracy00.yml',
+2 -1
View File
@@ -34,7 +34,8 @@ import general_ledger_landscape
import account_tax_code
import account_balance_landscape
import compare_account_balance
import account_invoice_report
import account_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,90 @@
# -*- 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_invoice_report(osv.osv):
_name = "account.invoice.report"
_description = "Invoices Statistics"
_auto = False
_rec_name = 'date'
_columns = {
'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, 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),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
'product_qty':fields.float('Qty', readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
'user_id':fields.many2one('res.users', 'Salesman', readonly=True),
'price_total':fields.float('Total Price', readonly=True),
'price_average':fields.float('Average Price', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
'type': fields.selection([
('out_invoice','Customer Invoice'),
('in_invoice','Supplier Invoice'),
('out_refund','Customer Refund'),
('in_refund','Supplier Refund'),
],'Type', readonly=True),
'state': fields.selection([
('draft','Draft'),
('proforma','Pro-forma'),
('proforma2','Pro-forma'),
('open','Open'),
('paid','Done'),
('cancel','Cancelled')
], 'Order State', readonly=True),
}
_order = 'date desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_invoice_report')
cr.execute("""
create or replace view account_invoice_report as (
select
min(l.id) as id,
s.date_invoice as date,
to_char(s.date_invoice, 'YYYY') as year,
to_char(s.date_invoice, 'MM') as month,
l.product_id as product_id,
sum(l.quantity * u.factor) as product_qty,
s.partner_id as partner_id,
s.user_id as user_id,
s.company_id as company_id,
sum(l.quantity*l.price_unit) as price_total,
(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
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)
group by
s.type,s.date_invoice, s.partner_id, l.product_id,
l.uos_id, s.user_id, s.state,
s.company_id
)
""")
account_invoice_report()
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_invoice_report_tree" model="ir.ui.view">
<field name="name">account.invoice.report.tree</field>
<field name="model">account.invoice.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Invoices Statistics">
<field name="date"/>
<field name="user_id"/>
<field name="year" invisible="1"/>
<field name="month" invisible="1"/>
<field name="type" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="partner_id"/>
<field name="product_id"/>
<field name="product_qty"/>
<!--field name="delay" avg="Days to Close"/-->
<field name="nbr" sum="# of Lines"/>
<field name="price_average" avg="Average Price"/>
<field name="price_total" sum="Total Price"/>
<field name="state" invisible="1"/>
</tree>
</field>
</record>
<record id="view_account_invoice_report_graph" model="ir.ui.view">
<field name="name">account.invoice.report.graph</field>
<field name="model">account.invoice.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Invoices Statistics" type="bar">
<field name="product_id"/>
<field name="price_total"/>
</graph>
</field>
</record>
<record id="view_account_invoice_report_search" model="ir.ui.view">
<field name="name">account.invoice.report.search</field>
<field name="model">account.invoice.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Invoices">
<filter icon="terp-account"
string="This Year"
domain="[('year','=',time.strftime('%%Y'))]"
help="Invoices of the year"/>
<filter icon="terp-account"
string="This Month"
domain="[('month','=',time.strftime('%%m'))]"
help="Invoices of this month"/>
<separator orientation="vertical"/>
<filter icon="terp-account"
string="Draft"
domain="[('state','=','draft')]"/>
<filter icon="terp-account"
string="Invoices"
domain="[('state','&lt;&gt;','draft'),('state','&lt;&gt;','cancel')]"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-account"
string="My Invoices"
domain="[('user_id','=',uid)]"/>
</field>
<field name="partner_id"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<newline/>
<group expand="1" string="Extended options..." colspan="10" col="12">
<filter icon="terp-account"
string="Customer Invoices"
domain="[('type','=','out_invoice')]"/>
<filter icon="terp-account"
string="Supplier Invoices"
domain="[('type','=','in_invoice')]"/>
<filter icon="terp-account"
string="Customer Refunds"
domain="[('type','=','out_refund')]"/>
<filter icon="terp-account"
string="Supplier Refunds"
domain="[('type','=','in_refund')]"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}"/>
<filter string="Salesman" icon="terp-account" context="{'group_by':'user_id'}" default="1"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-account" context="{'group_by':'date'}"/>
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
</group>
</search>
</field>
</record>
<record id="action_account_invoice_report_all" model="ir.actions.act_window">
<field name="name">Invoices</field>
<field name="res_model">account.invoice.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<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"/>
</data>
</openerp>
@@ -88,3 +88,10 @@
"access_account_sequence_fiscal_year","account.sequence.fiscalyear","model_account_sequence_fiscalyear","account.group_account_user",1,1,1,1
"access_account_sequence_fiscal_year_user","account.sequence.fiscalyear user","model_account_sequence_fiscalyear","base.group_user",1,0,0,0
"access_account_installer","account.installer","model_account_installer","base.group_user",1,0,0,0
"access_report_account_receivable","report.account.receivable","model_report_account_receivable","account.group_account_manager",1,0,0,0
"access_temp_range","temp.range","model_temp_range","account.group_account_manager",1,0,0,0
"access_report_aged_receivable","report.aged.receivable","model_report_aged_receivable","account.group_account_manager",1,0,0,0
"access_report_invoice_created","report.invoice.created","model_report_invoice_created","account.group_account_manager",1,0,0,0
"access_report_account_type_sales","report.account_type.sales","model_report_account_type_sales","account.group_account_manager",1,0,0,0
"access_report_account_sales","report.account.sales","model_report_account_sales","account.group_account_manager",1,0,0,0
"access_account_invoice_report","account.invoice.report","model_account_invoice_report","account.group_account_manager",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
88 access_account_sequence_fiscal_year account.sequence.fiscalyear model_account_sequence_fiscalyear account.group_account_user 1 1 1 1
89 access_account_sequence_fiscal_year_user account.sequence.fiscalyear user model_account_sequence_fiscalyear base.group_user 1 0 0 0
90 access_account_installer account.installer model_account_installer base.group_user 1 0 0 0
91 access_report_account_receivable report.account.receivable model_report_account_receivable account.group_account_manager 1 0 0 0
92 access_temp_range temp.range model_temp_range account.group_account_manager 1 0 0 0
93 access_report_aged_receivable report.aged.receivable model_report_aged_receivable account.group_account_manager 1 0 0 0
94 access_report_invoice_created report.invoice.created model_report_invoice_created account.group_account_manager 1 0 0 0
95 access_report_account_type_sales report.account_type.sales model_report_account_type_sales account.group_account_manager 1 0 0 0
96 access_report_account_sales report.account.sales model_report_account_sales account.group_account_manager 1 0 0 0
97 access_account_invoice_report account.invoice.report model_account_invoice_report account.group_account_manager 1 0 0 0
+1 -1
View File
@@ -32,7 +32,7 @@
* List of procurement in exception
""",
'author': 'Tiny',
'depends': ['board', 'mrp', 'stock', 'report_mrp'],
'depends': ['board', 'mrp', 'stock' ],
'update_xml': ['board_manufacturing_view.xml'],
'demo_xml': ['board_manufacturing_demo.xml'],
'installable': True,
@@ -20,9 +20,9 @@
<child2>
<action colspan="4" name="%(report_mrp.action_report_workcenter_load_tree)d" string="Work Center future load"/>
<action colspan="4" name="%(mrp.action_report_workcenter_load_tree)d" string="Work Center future load"/>
<action colspan="4" name="%(report_mrp.action_report_in_out_picking_tree)d" string="Stock value variation"/>
<action colspan="4" name="%(mrp.action_report_in_out_picking_tree)d" string="Stock value variation"/>
</child2>
</hpaned>
</form>
+55 -54
View File
@@ -41,73 +41,74 @@ appropriate staff, and making sure all future correspondence gets to the right
place.
The CRM module has a email gateway for the synchronisation interface
between mails and Open ERP.""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['base', 'base_action_rule',
'process',
'mail_gateway',
between mails and Open ERP.""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['base', 'base_action_rule',
'process',
'mail_gateway',
'base_calendar',
],
'init_xml': ['crm_data.xml',
'crm_meeting_data.xml',
'crm_claims_data.xml',
'crm_fund_data.xml',
'crm_helpdesk_data.xml',
'crm_lead_data.xml',
'crm_meeting_data.xml',
'crm_opportunity_data.xml',
'crm_phonecall_data.xml',
],
],
'init_xml': ['crm_data.xml',
'crm_meeting_data.xml',
'crm_claims_data.xml',
'crm_fund_data.xml',
'crm_helpdesk_data.xml',
'crm_lead_data.xml',
'crm_meeting_data.xml',
'crm_opportunity_data.xml',
'crm_phonecall_data.xml',
],
'update_xml': [
'crm_wizard.xml',
'crm_view.xml',
'crm_action_rule_view.xml',
'crm_lead_wizard.xml',
'crm_lead_view.xml',
'crm_lead_menu.xml',
'crm_meeting_wizard.xml',
'crm_meeting_view.xml',
'crm_meeting_menu.xml',
'crm_phonecall_wizard.xml',
'crm_phonecall_view.xml',
'crm_phonecall_menu.xml',
'crm_opportunity_wizard.xml',
'crm_opportunity_view.xml',
'crm_opportunity_menu.xml',
'crm_fund_view.xml',
'crm_fund_menu.xml',
'crm_claims_view.xml',
'crm_claims_menu.xml',
'crm_wizard.xml',
'crm_view.xml',
'crm_action_rule_view.xml',
'crm_lead_wizard.xml',
'crm_lead_view.xml',
'crm_lead_menu.xml',
'crm_meeting_wizard.xml',
'crm_meeting_view.xml',
'crm_meeting_menu.xml',
'crm_phonecall_wizard.xml',
'crm_phonecall_view.xml',
'crm_phonecall_menu.xml',
'crm_opportunity_wizard.xml',
'crm_opportunity_view.xml',
'crm_opportunity_menu.xml',
'crm_fund_view.xml',
'crm_fund_menu.xml',
'crm_claims_view.xml',
'crm_claims_menu.xml',
'crm_helpdesk_view.xml',
'crm_helpdesk_menu.xml',
'security/crm_security.xml',
'security/ir.model.access.csv',
'crm_helpdesk_menu.xml',
'security/crm_security.xml',
'security/ir.model.access.csv',
'report/crm_report_view.xml',
'report/crm_claim_report_view.xml',
'report/crm_lead_report_view.xml',
'report/crm_fundraising_report_view.xml',
'report/crm_opportunity_report_view.xml' ,
'report/crm_opportunity_report_view.xml' ,
'report/crm_phonecall_report_view.xml',
'report/crm_helpdesk_report_view.xml',
'process/crm_configuration_process.xml',
],
'demo_xml': [
'crm_demo.xml',
'crm_claims_demo.xml',
'crm_fund_demo.xml',
'crm_helpdesk_demo.xml',
'crm_lead_demo.xml',
'crm_meeting_demo.xml',
'crm_opportunity_demo.xml',
'crm_phonecall_demo.xml'],
'installable': True,
'active': False,
'certificate': '0079056041421',
'crm_demo.xml',
'crm_claims_demo.xml',
'crm_fund_demo.xml',
'crm_helpdesk_demo.xml',
'crm_lead_demo.xml',
'crm_meeting_demo.xml',
'crm_opportunity_demo.xml',
'crm_phonecall_demo.xml'],
'installable': True,
'active': False,
'certificate': '0079056041421',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+1
View File
@@ -26,6 +26,7 @@ import crm_lead_report
import crm_phonecall_report
import crm_fundraising_report
import crm_opportunity_report
import crm_helpdesk_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+63
View File
@@ -0,0 +1,63 @@
# -*- 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/>.
#
##############################################################################
from osv import fields,osv
import tools
class crm_helpdesk_report(osv.osv):
_name = "crm.helpdesk.report"
_description = "Helpdesk report after Sales Services"
_auto = False
_inherit = "crm.case.report"
_columns = {
'delay_close': fields.char('Delay to close', size=20, readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner' ,readonly=True),
'company_id': fields.many2one('res.company','Company',readonly=True),
'date_deadline': fields.date('Deadline'),
'priority': fields.selection([('5','Lowest'),('4','Low'),('3','Normal'),('2','High'),('1','Highest')], 'Priority'),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'crm_helpdesk_report')
cr.execute("""
create or replace view crm_helpdesk_report as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
c.state,
c.user_id,
c.section_id,
c.partner_id,
c.company_id,
c.priority,
c.date_deadline,
count(*) as nbr,
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_helpdesk c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.priority, c.partner_id,c.company_id,c.date_deadline
)""")
crm_helpdesk_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Helpdesk report after Sales Services
-->
<record id="view_report_crm_helpdesk_tree" model="ir.ui.view">
<field name="name">crm.helpdesk.report.tree</field>
<field name="model">crm.helpdesk.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Helpdesk">
<field name="name" />
<field name="month"/>
<field name="section_id" />
<field name="user_id" />
<field name="company_id"/>
<field name="partner_id" />
<field name="date_deadline" invisible="1"/>
<field name="priority" invisible="1"/>
<field name="nbr" string="#Helpdesk" />
<field name="delay_close"/>
<field name="state" invisible="1"/>
</tree>
</field>
</record>
<record id="view_report_crm_helpdesk_form" model="ir.ui.view">
<field name="name">crm.helpdesk.report.form</field>
<field name="model">crm.helpdesk.report</field>
<field name="inherit_id" ref="view_crm_case_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_report_crm_helpdesk_graph" model="ir.ui.view">
<field name="name">crm.helpdesk.report.graph</field>
<field name="model">crm.helpdesk.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Helpdesk" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="user_id"/>
</graph>
</field>
</record>
<record id="view_report_crm_helpdesk_filter" model="ir.ui.view">
<field name="name">crm.helpdesk.report.select</field>
<field name="model">crm.helpdesk.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search">
<group col="16" colspan="9">
<filter string="This Year" icon="terp-hr" domain="[('name','=',time.localtime()[0])]" default="1" />
<filter string="This Month" icon="terp-hr" domain="[('month','=',time.strftime('%%m'))]" default="1"/>
<separator orientation="vertical"/>
<filter string="Current" icon="terp-hr" domain="[('state','in',('open','draft'))]"/>
<filter string="Won" icon="terp-hr" domain="[('state','=','done')]"/>
<filter string="Lost" icon="terp-hr" domain="[('state','=','cancel')]"/>
<filter string="Deadline" icon="terp-hr" domain="[('date_deadline','=',time.strftime('%%m/%%d/%%Y'))]"/>
<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" widget="selection"/>
</group>
<newline/>
<group expand="1" string="Extended options..." colspan="4" col="5">
<filter icon="terp-sale"
string="Lowest"
domain="[('priority','=','5')]"/>
<filter icon="terp-sale"
string="Low"
domain="[('priority','=','4')]"/>
<filter icon="terp-sale"
string="Normal"
domain="[('priority','=','3')]"/>
<filter icon="terp-sale"
string="High"
domain="[('priority','=','2')]"/>
<filter icon="terp-sale"
string="Highest"
domain="[('priority','=','1')]"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="8">
<filter string="User" icon="terp-sale" domain="[]" context="{'group_by':'user_id'}" default="1" />
<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="Partner" icon="terp-sale" domain="[]" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<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>
<record id="action_report_crm_helpdesk" model="ir.actions.act_window">
<field name="name">Helpdesk</field>
<field name="res_model">crm.helpdesk.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="view_id" ref="view_report_crm_helpdesk_tree"/>
<field name="search_view_id" ref="view_report_crm_helpdesk_filter"/>
</record>
<record model="ir.actions.act_window.view" id="action_report_crm_helpdesk_tree">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_report_crm_helpdesk_tree"/>
<field name="act_window_id" ref="action_report_crm_helpdesk"/>
</record>
<record model="ir.actions.act_window.view" id="action_report_crm_helpdesk_graph">
<field name="sequence" eval="2"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_report_crm_helpdesk_graph"/>
<field name="act_window_id" ref="action_report_crm_helpdesk"/>
</record>
<menuitem name="Helpdesk" action="action_report_crm_helpdesk" id="menu_report_crm_helpdesks_tree" parent="base.next_id_64"/>
</data>
</openerp>
+10 -8
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<data>
<record id="view_crm_case_tree" model="ir.ui.view">
<field name="name">crm.case.report.tree</field>
@@ -56,11 +56,11 @@
<group col="16" colspan="8">
<filter string="This Year" icon="terp-hr" domain="[('name','=',time.localtime()[0])]" default="1" />
<filter string="This Month" icon="terp-hr" domain="[('month','=',time.strftime('%%m'))]" default="1"/>
<separator orientation="vertical"/>
<separator orientation="vertical"/>
<filter string="Current" icon="terp-hr" domain="[('state','in',('open','draft'))]"/>
<filter string="Won" icon="terp-hr" domain="[('state','=','done')]"/>
<filter string="Lost" icon="terp-hr" domain="[('state','=','cancel')]"/>
<separator orientation="vertical"/>
<separator orientation="vertical"/>
<field name="section_id" default="context.get('section_id', False)" widget="selection"
context="{'invisible_section': False}">
<filter icon="terp-crm"
@@ -74,7 +74,9 @@
domain="[('section_id.user_id.company_id','=',uid)]"
help="My company"/>
</field>
<field name="user_id" widget="selection"/>
<field name="user_id" select="1" widget="selection">
<filter icon="terp-crm" string="My Task" domain="[('user_id','=',uid)]" />
</field>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="8">
@@ -87,12 +89,12 @@
<separator orientation="vertical"/>
<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>
<menuitem id="base.next_id_64" name="Reporting" parent="base.menu_base_partner" sequence="8"/>
<menuitem id="base.next_id_64" name="Reporting" parent="base.menu_base_partner" sequence="8"/>
<record id="action_report_crm_case_tree" model="ir.actions.act_window">
@@ -112,7 +114,7 @@
<act_window domain="[('section_id', '=', active_id)]" id="act_crm_case_section_2_report_crm_case_categ" name="Monthly cases by section" res_model="crm.case.report" src_model="crm.case.section"/>
<!-- Closed & Open CRM Case view for Random Activities dashboard -->
@@ -162,6 +164,6 @@
<field name="view_id" ref="board_view_crm_case_open_dashboard_tree"/>
<field name="domain">[('state','=','open')]</field>
</record>
</data>
</openerp>
+1 -1
View File
@@ -32,4 +32,4 @@
"access_crm_phonecall_report_user","crm.phonecall.report","model_crm_phonecall_report","crm.group_crm_user",1,0,0,0
"access_crm_opportunity_report_user","crm.opportunity.report","model_crm_opportunity_report","crm.group_crm_user",1,0,0,0
"access_report_crm_case_service_dashboard","report.crm.case.service.dashboard","model_report_crm_case_service_dashboard","crm.group_crm_user",1,0,0,0
"access_report_crm_helpdesk","report.crm.helpdesk","model_crm_helpdesk_report","crm.group_crm_user",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
32 access_crm_phonecall_report_user crm.phonecall.report model_crm_phonecall_report crm.group_crm_user 1 0 0 0
33 access_crm_opportunity_report_user crm.opportunity.report model_crm_opportunity_report crm.group_crm_user 1 0 0 0
34 access_report_crm_case_service_dashboard report.crm.case.service.dashboard model_report_crm_case_service_dashboard crm.group_crm_user 1 0 0 0
35 access_report_crm_helpdesk report.crm.helpdesk model_crm_helpdesk_report crm.group_crm_user 1 0 0 0
+3 -2
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -26,5 +26,6 @@ import document_directory
import directory_content
import directory_report
import document
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+9 -8
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -24,14 +24,14 @@
'name': 'Integrated Document Management System',
'version': '1.99',
'category': 'Generic Modules/Others',
'description': """This is a complete document management system:
'description': """This is a complete document management system:
* User Authentication
* Document Indexation
ATTENTION:
- When you install this module in a running company that have already PDF files stored into the database,
you will lose them all.
- After installing this module PDF's are not longer stored into the database,
ATTENTION:
- When you install this module in a running company that have already PDF files stored into the database,
you will lose them all.
- After installing this module PDF's are not longer stored into the database,
but in the servers rootpad like /server/bin/filestore.
""",
'author': 'Tiny',
@@ -42,7 +42,8 @@
'document_view.xml',
'document_data.xml',
'security/document_security.xml',
'security/ir.model.access.csv'
'security/ir.model.access.csv',
'report/document_report_view.xml'
],
'demo_xml': [ 'document_demo.xml',],
'installable': True,
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,11 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import report_mrp
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
import document_report
@@ -11,3 +11,11 @@
"access_document_storage_group_system","document.storage group system","model_document_storage","base.group_user",1,0,0,0
"access_document_directory_dctx_group_document_manager","document.directory.dctx document manager","model_document_directory_dctx","group_document_manager",1,1,1,1
"access_document_directory_dctx_group_system","document.directory.dctx group system","model_document_directory_dctx","base.group_system",1,1,1,1
"access_report_document_user_group_document_manager","report.document.user document manager","model_report_document_user","document.group_document_manager",1,0,0,0
"access_report_document_user_group_system","report.document.user group system","model_report_document_user","base.group_system",1,0,0,0
"access_report_files_partner_group_document_manager","report.files.partner document manager","model_report_files_partner","document.group_document_manager",1,0,0,0
"access_report_files_partner_group_system","report.files.partner group system","model_report_files_partner","base.group_system",1,0,0,0
"access_report_document_file_group_document_manager","report.document.file document manager","model_report_document_file","document.group_document_manager",1,0,0,0
"access_report_document_file_group_system","report.document.file group system","model_report_document_file","base.group_system",1,0,0,0
"access_report_document_wall_group_document_manager","report.document.wall document manager","model_report_document_wall","document.group_document_manager",1,0,0,0
"access_report_document_wall_group_system","report.document.wall group system","model_report_document_wall","base.group_system",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
11 access_document_storage_group_system document.storage group system model_document_storage base.group_user 1 0 0 0
12 access_document_directory_dctx_group_document_manager document.directory.dctx document manager model_document_directory_dctx group_document_manager 1 1 1 1
13 access_document_directory_dctx_group_system document.directory.dctx group system model_document_directory_dctx base.group_system 1 1 1 1
14 access_report_document_user_group_document_manager report.document.user document manager model_report_document_user document.group_document_manager 1 0 0 0
15 access_report_document_user_group_system report.document.user group system model_report_document_user base.group_system 1 0 0 0
16 access_report_files_partner_group_document_manager report.files.partner document manager model_report_files_partner document.group_document_manager 1 0 0 0
17 access_report_files_partner_group_system report.files.partner group system model_report_files_partner base.group_system 1 0 0 0
18 access_report_document_file_group_document_manager report.document.file document manager model_report_document_file document.group_document_manager 1 0 0 0
19 access_report_document_file_group_system report.document.file group system model_report_document_file base.group_system 1 0 0 0
20 access_report_document_wall_group_document_manager report.document.wall document manager model_report_document_wall document.group_document_manager 1 0 0 0
21 access_report_document_wall_group_system report.document.wall group system model_report_document_wall base.group_system 1 0 0 0
+3 -2
View File
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
@@ -15,11 +15,12 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import hr_evaluation
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+3 -1
View File
@@ -31,7 +31,9 @@
"demo_xml" : ["hr_evaluation_demo.xml"],
"update_xml" : [
"security/ir.model.access.csv",
"hr_evaluation_view.xml"],
"hr_evaluation_view.xml",
"hr_evaluation_data.xml",
"report/hr_evaluation_report_view.xml"],
"active": False,
"installable": True
}
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2004-2009 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
@@ -15,11 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import report_task
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
import hr_evaluation_report
@@ -0,0 +1,74 @@
# -*- 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 hr_evaluation_report(osv.osv):
_name = "hr.evaluation.report"
_description = "Evaluations Statistics"
_auto = False
_rec_name = 'date'
_columns = {
'create_date': fields.datetime('Create Date', readonly=True),
'deadline': fields.date("Deadline", readonly=True),
'closed': fields.date("closed", readonly=True),
'year': fields.char('Year', size=4, 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),
'employee_id': fields.many2one('hr.employee', "Employee", readonly=True),
'nbr':fields.integer('# of Requests', readonly=True),
'state': fields.selection([
('draft','Draft'),
('wait','Plan In Progress'),
('progress','Final Validation'),
('done','Done'),
('cancel','Cancelled'),
], 'State',readonly=True),
}
_order = 'create_date desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'hr_evaluation_report')
cr.execute("""
create or replace view hr_evaluation_report as (
select
min(l.id) as id,
s.create_date as create_date,
s.employee_id,
s.date as deadline,
s.date_close as closed,
to_char(s.create_date, 'YYYY') as year,
to_char(s.create_date, 'MM') as month,
count(*) as nbr,
s.state
from
hr_evaluation_interview l
left join
hr_evaluation_evaluation s on (s.id=l.evaluation_id)
group by
s.create_date,s.state,s.employee_id,
s.date,s.date_close
)
""")
hr_evaluation_report()
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_evaluation_report_tree" model="ir.ui.view">
<field name="name">hr.evaluation.report.tree</field>
<field name="model">hr.evaluation.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Evaluations Statistics">
<field name="create_date"/>
<field name="employee_id"/>
<field name="deadline"/>
<field name="closed" invisible="1"/>
<field name="year" invisible="1"/>
<field name="month" invisible="1"/>
<field name="nbr" sum="# of Requests"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_evaluation_report_search" model="ir.ui.view">
<field name="name">hr.evaluation.report.search</field>
<field name="model">hr.evaluation.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Evaluations">
<filter icon="terp-hr"
string="This Year"
domain="[('year','=',time.strftime('%%Y'))]"
help="Evaluations of the year"/>
<filter icon="terp-hr"
string="This Month"
domain="[('month','=',time.strftime('%%m'))]"
help="Evaluations of this month"/>
<separator orientation="vertical"/>
<filter icon="terp-hr"
string="Deadline"
domain="[('deadline','=',time.strftime('%%Y/%%m/%%d'))]"/>
<filter icon="terp-hr"
string="Closed"
domain="[('closed','=',time.strftime('%%Y/%%m/%%d'))]"/>
<separator orientation="vertical"/>
<field name="employee_id"/>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-hr" context="{'group_by':'create_date'}"/>
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
</group>
</search>
</field>
</record>
<record id="action_evaluation_report_all" model="ir.actions.act_window">
<field name="name">Evaluations</field>
<field name="res_model">hr.evaluation.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="search_view_id" ref="view_evaluation_report_search"/>
</record>
<menuitem id="hr.menu_hr_reporting" name="Reporting" parent="hr.menu_hr_root" sequence="8"/>
<menuitem action="action_evaluation_report_all" id="menu_evaluation_report_all" parent="hr.menu_hr_reporting" sequence="0"/>
</data>
</openerp>
@@ -1,9 +1,10 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_evaluation_evaluation","hr_evaluation.evaluation","model_hr_evaluation_evaluation",hr.group_hr_user,1,0,0,0
"access_hr_evaluation_evaluation_manager","hr_evaluation.evaluation","model_hr_evaluation_evaluation",hr.group_hr_manager,1,1,1,1
"access_hr_evaluation_plan","hr_evaluation.plan","model_hr_evaluation_evaluation",hr.group_hr_user,1,0,0,0
"access_hr_evaluation_plan_manager","hr_evaluation.plan","model_hr_evaluation_plan",hr.group_hr_manager,1,1,1,1
"access_hr_evaluation_plan_phase","hr_evaluation.plan.phase","model_hr_evaluation_plan_phase",hr.group_hr_user,1,0,0,0
"access_hr_evaluation_plan_phase_manager","hr_evaluation.plan.phase","model_hr_evaluation_plan_phase",hr.group_hr_manager,1,1,1,1
"access_hr_evaluation_interview","hr.evaluation.interview","model_hr_evaluation_interview",hr.group_hr_user,1,0,0,0
"access_hr_evaluation_interview_manager","hr.evaluation.interview","model_hr_evaluation_interview",hr.group_hr_manager,1,1,1,1
"access_hr_evaluation_evaluation","hr_evaluation.evaluation","model_hr_evaluation_evaluation","hr.group_hr_user",1,0,0,0
"access_hr_evaluation_evaluation_manager","hr_evaluation.evaluation","model_hr_evaluation_evaluation","hr.group_hr_manager",1,1,1,1
"access_hr_evaluation_plan","hr_evaluation.plan","model_hr_evaluation_evaluation","hr.group_hr_user",1,0,0,0
"access_hr_evaluation_plan_manager","hr_evaluation.plan","model_hr_evaluation_plan","hr.group_hr_manager",1,1,1,1
"access_hr_evaluation_plan_phase","hr_evaluation.plan.phase","model_hr_evaluation_plan_phase","hr.group_hr_user",1,0,0,0
"access_hr_evaluation_plan_phase_manager","hr_evaluation.plan.phase","model_hr_evaluation_plan_phase","hr.group_hr_manager",1,1,1,1
"access_hr_evaluation_interview","hr.evaluation.interview","model_hr_evaluation_interview","hr.group_hr_user",1,0,0,0
"access_hr_evaluation_interview_manager","hr.evaluation.interview","model_hr_evaluation_interview","hr.group_hr_manager",1,1,1,1
"access_hr_evaluation_report","hr.evaluation.report","model_hr_evaluation_report",,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_evaluation_evaluation hr_evaluation.evaluation model_hr_evaluation_evaluation hr.group_hr_user 1 0 0 0
3 access_hr_evaluation_evaluation_manager hr_evaluation.evaluation model_hr_evaluation_evaluation hr.group_hr_manager 1 1 1 1
4 access_hr_evaluation_plan hr_evaluation.plan model_hr_evaluation_evaluation hr.group_hr_user 1 0 0 0
5 access_hr_evaluation_plan_manager hr_evaluation.plan model_hr_evaluation_plan hr.group_hr_manager 1 1 1 1
6 access_hr_evaluation_plan_phase hr_evaluation.plan.phase model_hr_evaluation_plan_phase hr.group_hr_user 1 0 0 0
7 access_hr_evaluation_plan_phase_manager hr_evaluation.plan.phase model_hr_evaluation_plan_phase hr.group_hr_manager 1 1 1 1
8 access_hr_evaluation_interview hr.evaluation.interview model_hr_evaluation_interview hr.group_hr_user 1 0 0 0
9 access_hr_evaluation_interview_manager hr.evaluation.interview model_hr_evaluation_interview hr.group_hr_manager 1 1 1 1
10 access_hr_evaluation_report hr.evaluation.report model_hr_evaluation_report 1 0 0 0
+4 -3
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -48,7 +48,8 @@
'hr_expense_workflow.xml',
'hr_expense_view.xml',
'hr_expense_report.xml',
'process/hr_expense_process.xml'
'process/hr_expense_process.xml',
'report/hr_expense_report_view.xml'
],
'demo_xml': ['hr.expense.expense.csv'],
'installable': True,
+3 -2
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,10 +15,11 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import expense
import hr_expense_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,90 @@
# -*- 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 hr_expense_report(osv.osv):
_name = "hr.expense.report"
_description = "Expenses Statistics"
_auto = False
_rec_name = 'date'
_columns = {
'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, 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),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
'product_qty':fields.float('Qty', readonly=True),
'employee_id': fields.many2one('hr.employee', "Employee's Name", readonly=True),
'invoice_id': fields.many2one('account.invoice', 'Invoice',readonly=True),
'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),
'price_total':fields.float('Total Price', readonly=True),
'price_average':fields.float('Average Price', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
'state': fields.selection([
('draft', 'Draft'),
('confirm', 'Waiting confirmation'),
('accepted', 'Accepted'),
('invoiced', 'Invoiced'),
('paid', 'Reimbursed'),
('cancelled', 'Cancelled')],
'State', readonly=True),
}
_order = 'date desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'hr_expense_report')
cr.execute("""
create or replace view hr_expense_report as (
select
min(l.id) as id,
s.date as date,
s.employee_id,
s.invoice_id,
s.department_id,
to_char(s.date, 'YYYY') as year,
to_char(s.date, 'MM') as month,
l.product_id as product_id,
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,
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)
group by
s.date, l.product_id,s.invoice_id,
s.department_id,
l.uom_id, s.user_id, s.state,
s.company_id,s.employee_id
)
""")
hr_expense_report()
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_expense_report_tree" model="ir.ui.view">
<field name="name">hr.expense.report.tree</field>
<field name="model">hr.expense.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Expenses Statistics">
<field name="date"/>
<field name="employee_id"/>
<field name="user_id"/>
<field name="year" invisible="1"/>
<field name="month" invisible="1"/>
<field name="invoice_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="product_id"/>
<field name="product_qty"/>
<field name="nbr" sum="# of Lines"/>
<field name="price_average" avg="Average Price"/>
<field name="price_total" sum="Total Price"/>
<field name="state" invisible="1"/>
</tree>
</field>
</record>
<record id="view_hr_expense_report_graph" model="ir.ui.view">
<field name="name">hr.expense.report.graph</field>
<field name="model">hr.expense.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Expenses Statistics" type="bar">
<field name="product_id"/>
<field name="price_total"/>
</graph>
</field>
</record>
<record id="view_hr_expense_report_search" model="ir.ui.view">
<field name="name">hr.expense.report.search</field>
<field name="model">hr.expense.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Expenses">
<filter icon="terp-hr"
string="This Year"
domain="[('year','=',time.strftime('%%Y'))]"
help="Expenses of the year"/>
<filter icon="terp-hr"
string="This Month"
domain="[('month','=',time.strftime('%%m'))]"
help="Expenses of this month"/>
<separator orientation="vertical"/>
<filter icon="terp-hr"
string="Draft"
domain="[('state','=','draft')]"/>
<filter icon="terp-hr"
string="Expenses"
default="1"
domain="[('state','&lt;&gt;','draft'),('state','&lt;&gt;','cancelled')]"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-hr"
string="My Expenses"
domain="[('user_id','=',uid)]"/>
</field>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}"/>
<filter string="User" icon="terp-hr" context="{'group_by':'user_id'}" default="1"/>
<filter string="Employee" icon="terp-hr" context="{'group_by':'employee_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'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-hr" context="{'group_by':'date'}"/>
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
</group>
</search>
</field>
</record>
<record id="action_hr_expense_report_all" model="ir.actions.act_window">
<field name="name">Expenses</field>
<field name="res_model">hr.expense.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="search_view_id" ref="view_hr_expense_report_search"/>
</record>
<menuitem id="hr.menu_hr_reporting" name="Reporting" parent="hr.menu_hr_root" sequence="8"/>
<menuitem action="action_hr_expense_report_all" id="menu_hr_expense_report_all" parent="hr.menu_hr_reporting" sequence="0"/>
</data>
</openerp>
+1
View File
@@ -55,6 +55,7 @@
'hr_view.xml',
'hr_holidays_report.xml',
'hr_holidays_wizard.xml',
'report/hr_holidays_report_view.xml',
#'process/hr_holidays_process.xml'
],
'demo_xml': [],
+3 -2
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,10 +15,11 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import holidays_summary_report
import hr_holidays_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,72 @@
# -*- 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 hr_holidays_report(osv.osv):
_name = "hr.holidays.report"
_description = "Leaves Statistics"
_auto = False
_rec_name = 'date'
_columns = {
'date': fields.datetime('Date', readonly=True),
'year': fields.char('Year', size=4, 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),
'employee_id' : fields.many2one('hr.employee', "Employee's Name",readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
'state': fields.selection([('draft', 'Draft'),
('confirm', 'Waiting Validation'),
('refuse', 'Refused'),
('validate', 'Validated'),
('cancel', 'Cancelled')]
,'State', readonly=True),
}
_order = 'date desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'hr_holidays_report')
cr.execute("""
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.date_from) as date_from,
date_trunc('day',s.date_to) as date_to,
s.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,
s.state
from
hr_holidays s
group by
s.create_date,s.state,s.date_from,s.date_to,
s.number_of_days_temp,s.employee_id,s.user_id
)
""")
hr_holidays_report()
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_holidays_report_tree" model="ir.ui.view">
<field name="name">hr.holidays.report.tree</field>
<field name="model">hr.holidays.report</field>
<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="year" invisible="1"/>
<field name="month" invisible="1"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_hr_holidays_report_graph" model="ir.ui.view">
<field name="name">hr.holidays.report.graph</field>
<field name="model">hr.holidays.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Leaves Statistics" type="bar">
<field name="employee_id"/>
<field name="number_of_days_temp" operator="+"/>
</graph>
</field>
</record>
<record id="view_hr_holidays_report_search" model="ir.ui.view">
<field name="name">hr.holidays.report.search</field>
<field name="model">hr.holidays.report</field>
<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="Today's Start Leave"
domain="[('date_from','=',time.strftime('%%Y/%%m/%%d'))]"/>
<filter icon="terp-hr"
string="Today's End Leave"
domain="[('date_to','=',time.strftime('%%Y/%%m/%%d'))]"/>
<separator orientation="vertical"/>
<field name="employee_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-sale"
string="My Leaves"
default="1"
domain="[('user_id','=',uid)]"/>
</field>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
<separator orientation="vertical"/>
<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'}"/>
</group>
</search>
</field>
</record>
<record id="action_hr_holidays_report_all" model="ir.actions.act_window">
<field name="name">Leaves</field>
<field name="res_model">hr.holidays.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="search_view_id" ref="view_hr_holidays_report_search"/>
</record>
<menuitem action="action_hr_holidays_report_all" id="menu_hr_holidays_report_all" parent="hr.menu_hr_reporting" sequence="0"/>
</data>
</openerp>
@@ -2,3 +2,4 @@
"access_hr_holydays_status_user","hr.holidays.status user","model_hr_holidays_status","hr.group_hr_user",1,1,1,1
"access_hr_holidays_user","hr holidays user","model_hr_holidays","hr.group_hr_user",1,1,1,1
"access_hr_holidays_per_user","hr.holidays.per.user","model_hr_holidays_per_user","hr.group_hr_user",1,1,1,1
"access_hr_holidays_report","hr.holidays.report","model_hr_holidays_report","hr.group_hr_user",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_holydays_status_user hr.holidays.status user model_hr_holidays_status hr.group_hr_user 1 1 1 1
3 access_hr_holidays_user hr holidays user model_hr_holidays hr.group_hr_user 1 1 1 1
4 access_hr_holidays_per_user hr.holidays.per.user model_hr_holidays_per_user hr.group_hr_user 1 1 1 1
5 access_hr_holidays_report hr.holidays.report model_hr_holidays_report hr.group_hr_user 1 1 1 1
+1 -1
View File
@@ -42,10 +42,10 @@ system to store and search in your CV base.
'hr_hr_wizard.xml',
'hr_hr_view.xml',
'hr_hr_menu.xml',
'report_hr_hr_view.xml',
'security/hr_hr_security.xml',
'security/ir.model.access.csv',
'board_hr_hr_statistical_view.xml',
'report/hr_recruitment_report_view.xml'
],
'demo_xml': [
'hr_hr_demo.xml'
+1 -1
View File
@@ -20,6 +20,6 @@
#
##############################################################################
import report_hr_hr
import hr_recruitment_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,67 @@
# -*- 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
from hr_recruitment import hr_hr
class hr_recruitment_report(osv.osv):
_name = "hr.recruitment.report"
_description = "Recruitments Statistics"
_inherit = "crm.case.report"
_auto = False
_rec_name = 'date'
_columns = {
'date': fields.datetime('Date', readonly=True),
'job_id': fields.many2one('hr.job', 'Applied Job',readonly=True),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]",readonly=True),
'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"),
'department_id':fields.many2one('hr.department','Department',readonly=True),
'priority': fields.selection(hr_hr.AVAILABLE_PRIORITIES, 'Appreciation'),
}
_order = 'date desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'hr_recruitment_report')
cr.execute("""
create or replace view hr_recruitment_report as (
select
min(s.id) as id,
s.date as date,
to_char(s.date, 'YYYY') as name,
to_char(s.date, 'MM') as month,
s.state,
s.company_id,
s.user_id,
s.job_id,
s.type_id,
s.department_id,
s.priority,
s.stage_id,
count(*) as nbr
from hr_applicant s
group by
s.date,s.state,s.company_id,s.user_id,s.stage_id,s.type_id,s.priority,
s.job_id,s.department_id
)
""")
hr_recruitment_report()
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_recruitment_report_tree" model="ir.ui.view">
<field name="name">hr.recruitment.report.tree</field>
<field name="model">hr.recruitment.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Recruitments Statistics">
<field name="date"/>
<field name="user_id"/>
<field name="job_id"/>
<field name="stage_id"/>
<field name="department_id"/>
<field name="type_id"/>
<field name="company_id"/>
<field name="state"/>
<field name="name" invisible="1"/>
<field name="month" invisible="1"/>
</tree>
</field>
</record>
<record id="view_hr_recruitment_report_graph" model="ir.ui.view">
<field name="name">hr.recruitment.report.graph</field>
<field name="model">hr.recruitment.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Recruitments Statistics" type="bar">
<field name="job_id"/>
<field name="nbr" operator="+"/>
</graph>
</field>
</record>
<record id="view_hr_recruitment_report_search" model="ir.ui.view">
<field name="name">hr.recruitment.report.search</field>
<field name="model">hr.recruitment.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Recruitments">
<filter icon="terp-hr"
string="This Year"
domain="[('year','=',time.strftime('%%Y'))]"
help="Recruitments of the year"/>
<filter icon="terp-hr"
string="This Month"
domain="[('month','=',time.strftime('%%m'))]"
help="Recruitments of this month"/>
<separator orientation="vertical"/>
<filter string="Current" icon="terp-hr" domain="[('state','in',('open','draft'))]"/>
<filter string="Won" icon="terp-hr" domain="[('state','=','done')]"/>
<filter string="Lost" icon="terp-hr" domain="[('state','=','cancel')]"/>
<separator orientation="vertical"/>
<field name="company_id" widget="selection"/>
<field name="user_id" widget="selection">
<filter icon="terp-sale"
string="My Recruitments"
default="1"
domain="[('user_id','=',uid)]"/>
</field>
<newline/>
<group expand="1" string="Extended options..." colspan="10" col="12">
<filter icon="terp-hr"
string="Not Good"
domain="[('priority','=','5')]"/>
<filter icon="terp-hr"
string="On Average"
domain="[('priority','=','4')]"/>
<filter icon="terp-hr"
string="Good"
domain="[('priority','=','3')]"/>
<filter icon="terp-hr"
string="Very Good"
domain="[('priority','=','2')]"/>
<filter icon="terp-hr"
string="Excellent"
domain="[('priority','=','1')]"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="User" icon="terp-hr" domain="[]" context="{'group_by':'user_id'}" default="1" />
<filter string="Company" icon="terp-hr" domain="[]" context="{'group_by':'company_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'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-hr" domain="[]" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-hr" domain="[]" context="{'group_by':'name'}"/>
</group>
</search>
</field>
</record>
<record id="action_hr_recruitment_report_all" model="ir.actions.act_window">
<field name="name">Recruitments</field>
<field name="res_model">hr.recruitment.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<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"/>
<menuitem action="action_hr_recruitment_report_all" id="menu_hr_recruitment_report_all" parent="hr.menu_hr_reporting" sequence="0"/>
</data>
</openerp>
@@ -1,3 +0,0 @@
from osv import fields,osv
import tools
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
</data>
</openerp>
+5 -3
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -36,7 +36,9 @@ reports, eso.""",
'security/ir.model.access.csv',
'hr_timesheet_invoice_view.xml',
'hr_timesheet_invoice_wizard.xml',
'hr_timesheet_invoice_report.xml'
'hr_timesheet_invoice_report.xml',
'report/report_analytic_view.xml',
'report/hr_timesheet_invoice_report_view.xml',
],
'demo_xml': ['hr_timesheet_invoice_demo.xml'],
'installable': True,
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,12 +15,14 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import cost_ledger
import account_analytic_profit
import report_analytic
import hr_timesheet_invoice_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,3 +1,11 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_timesheet_invoice_factor_hr_user","hr_timesheet_invoice.factor.hr.user","model_hr_timesheet_invoice_factor","hr.group_hr_user",1,0,0,0
"access_hr_timesheet_invoice_factor_acc_inv","hr_timesheet_invoice.factor.account.invoice","model_hr_timesheet_invoice_factor","account.group_account_invoice",1,1,1,1
"access_report_analytic_account_close","report.analytic.account.close","model_report_analytic_account_close","account.group_account_manager",1,0,0,0
"access_report_account_analytic_line_to_invoice","report.account.analytic.line.to.invoice","model_report_account_analytic_line_to_invoice","account.group_account_manager",1,0,0,0
"access_report_timesheet_user","report_timesheet.user","model_report_timesheet_user","base.group_user",1,0,0,0
"access_report_timesheet_account","report_timesheet.account","model_report_timesheet_account","base.group_user",1,0,0,0
"access_report_timesheet_account_date","report_timesheet.account.date","model_report_timesheet_account_date","base.group_user",1,0,0,0
"access_report_timesheet_invoice","report_timesheet.invoice","model_report_timesheet_invoice","base.group_user",1,0,0,0
"access_report_random_timesheet","report_random_timesheet","model_report_random_timesheet","base.group_user",1,0,0,0
"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","base.group_user",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_timesheet_invoice_factor_hr_user hr_timesheet_invoice.factor.hr.user model_hr_timesheet_invoice_factor hr.group_hr_user 1 0 0 0
3 access_hr_timesheet_invoice_factor_acc_inv hr_timesheet_invoice.factor.account.invoice model_hr_timesheet_invoice_factor account.group_account_invoice 1 1 1 1
4 access_report_analytic_account_close report.analytic.account.close model_report_analytic_account_close account.group_account_manager 1 0 0 0
5 access_report_account_analytic_line_to_invoice report.account.analytic.line.to.invoice model_report_account_analytic_line_to_invoice account.group_account_manager 1 0 0 0
6 access_report_timesheet_user report_timesheet.user model_report_timesheet_user base.group_user 1 0 0 0
7 access_report_timesheet_account report_timesheet.account model_report_timesheet_account base.group_user 1 0 0 0
8 access_report_timesheet_account_date report_timesheet.account.date model_report_timesheet_account_date base.group_user 1 0 0 0
9 access_report_timesheet_invoice report_timesheet.invoice model_report_timesheet_invoice base.group_user 1 0 0 0
10 access_report_random_timesheet report_random_timesheet model_report_random_timesheet base.group_user 1 0 0 0
11 access_report_random_timesheet_lines random_timesheet_lines model_random_timesheet_lines base.group_user 1 0 0 0
+2
View File
@@ -69,6 +69,8 @@
'process/service_product_process.xml',
'process/procurement_process.xml',
'mrp_installer.xml',
'report/mrp_report_view.xml',
'report/mrp_production_order_view.xml',
],
'demo_xml': ['mrp_demo.xml', 'mrp_order_point.xml'],
'installable': True,
+4 -2
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -23,6 +23,8 @@ import price
import workcenter_load
import order
import bom_structure
import mrp_report
import mrp_production_order
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+66
View File
@@ -0,0 +1,66 @@
# -*- 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/>.
#
##############################################################################
from osv import fields,osv
import tools
class mrp_production_order(osv.osv):
_name = "mrp.production.order"
_description = "Production Order Report"
_auto = False
_columns = {
'name': fields.char('Year',size=64,required=False, 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),
'reference': fields.char('Reference', size=64, required=True),
'origin': fields.char('Source Document', size=64),
'nbr': fields.integer('# of Orders', readonly=True),
'product_id': fields.many2one('product.product', 'Product', required=True, domain=[('type','<>','service')]),
'state': fields.selection([('draft','Draft'),('picking_except', 'Picking Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','In Production'),('cancel','Cancelled'),('done','Done')],'State', readonly=True),
'scheduled_date':fields.date('Scheduled Date'),
'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', required=True),
'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', required=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'mrp_production_order')
cr.execute("""
create or replace view mrp_production_order as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
c.state,
c.product_id,
count(*) as nbr,
to_date(to_char(c.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY') as scheduled_date,
c.name as reference,
c.origin,
c.location_src_id,
c.location_dest_id
from
mrp_production c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state,c.product_id,to_date(to_char(c.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY'),c.name,c.location_src_id,c.location_dest_id,c.origin
)""")
mrp_production_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Production Order Report
-->
<record id="view_report_mrp_production_order_tree" model="ir.ui.view">
<field name="name">mrp.production.order.tree</field>
<field name="model">mrp.production.order</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Production">
<field name="name" />
<field name="month"/>
<field name="product_id" />
<field name="scheduled_date"/>
<field name="reference" />
<field name="origin"/>
<field name="nbr" string="#Production Orders" />
<field name="location_src_id"/>
<field name="location_dest_id" />
<field name="state" invisible="1"/>
</tree>
</field>
</record>
<record id="view_report_mrp_production_order_form" model="ir.ui.view">
<field name="name">mrp.production.order.form</field>
<field name="model">mrp.production.order</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Production">
<field name="name" />
<field name="month"/>
<field name="product_id"/>
<field name="scheduled_date"/>
<field name="reference" />
<field name="origin"/>
</form>
</field>
</record>
<record id="view_report_mrp_production_order_graph" model="ir.ui.view">
<field name="name">mrp.production.order.graph</field>
<field name="model">mrp.production.order</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Production" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
</graph>
</field>
</record>
<record id="view_report_mrp_production_order_filter" model="ir.ui.view">
<field name="name">mrp.production.order.select</field>
<field name="model">mrp.production.order</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search">
<group col="16" colspan="6">
<filter string="This Year" icon="terp-hr" domain="[('name','=',time.localtime()[0])]" default="1" />
<filter string="This Month" icon="terp-hr" domain="[('month','=',time.strftime('%%m'))]" default="1"/>
<separator orientation="vertical"/>
<filter string="Current" icon="terp-hr" domain="[('state','in',('open','draft'))]"/>
<filter string="Scheduled Date" icon="terp-hr" domain="[('scheduled_date',=,time.strftime('%%m/%%d/%%Y'))]"/>
<separator orientation="vertical"/>
<field name="reference" />
<field name="origin"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="6">
<filter string="Source Location" icon="terp-sale" domain="[]" context="{'group_by':'location_src_id'}"/>
<filter string="Destination Location" icon="terp-sale" domain="[]" context="{'group_by':'location_dest_id'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
<filter string="Product" icon="terp-sale" domain="[]" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<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>
<record id="action_report_mrp_production_order" model="ir.actions.act_window">
<field name="name">Production Order</field>
<field name="res_model">mrp.production.order</field>
<field name="view_type">form</field>
<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"/>
</record>
<record model="ir.actions.act_window.view" id="action_report_mrp_production_order_tree">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_report_mrp_production_order_tree"/>
<field name="act_window_id" ref="action_report_mrp_production_order"/>
</record>
<record model="ir.actions.act_window.view" id="action_report_mrp_production_order_graph">
<field name="sequence" eval="2"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_report_mrp_production_order_graph"/>
<field name="act_window_id" ref="action_report_mrp_production_order"/>
</record>
<menuitem name="Production" action="action_report_mrp_production_order" id="menu_report_mrp_production_orders_tree" parent="next_id_77"/>
</data>
</openerp>
@@ -98,7 +98,7 @@
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
</record>
<menuitem action="action_report_in_out_picking_tree" id="menu_report_in_out_picking" parent="report_mrp.next_id_77"/>
<menuitem action="action_report_in_out_picking_tree" id="menu_report_in_out_picking" parent="next_id_77"/>
+3
View File
@@ -32,3 +32,6 @@
"access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0
"access_mrp_installer","mrp.installer","model_mrp_installer","mrp.group_mrp_user",1,0,0,0
"access_mrp_product_produce","mrp.product.produce","model_mrp_product_produce","mrp.group_mrp_user",1,0,0,0
"access_mrp_production_order","mrp.production.order","model_mrp_production_order","mrp.group_mrp_user",1,0,0,0
"access_report_workcenter_load","report.workcenter.load","model_report_workcenter_load","mrp.group_mrp_manager",1,0,0,0
"access_report_mrp_inout","report.mrp.inout","model_report_mrp_inout","mrp.group_mrp_manager",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
32 access_mrp_production_stock_worker mrp.production stock_worker model_mrp_production stock.group_stock_user 1 0 0 0
33 access_mrp_installer mrp.installer model_mrp_installer mrp.group_mrp_user 1 0 0 0
34 access_mrp_product_produce mrp.product.produce model_mrp_product_produce mrp.group_mrp_user 1 0 0 0
35 access_mrp_production_order mrp.production.order model_mrp_production_order mrp.group_mrp_user 1 0 0 0
36 access_report_workcenter_load report.workcenter.load model_report_workcenter_load mrp.group_mrp_manager 1 0 0 0
37 access_report_mrp_inout report.mrp.inout model_report_mrp_inout mrp.group_mrp_manager 1 0 0 0
+1 -1
View File
@@ -36,7 +36,7 @@ Main features :
""",
'author': 'Tiny',
'depends': ['sale', 'delivery','report_mrp'],
'depends': ['sale', 'delivery'],
# 'depends': ['sale', 'purchase', 'account', 'account_tax_include','board','mrp','board_manufacturing','delivery','profile_manufacturing','account','multi_company'],
'init_xml': [
'security/point_of_sale_security.xml',
+1 -1
View File
@@ -33,7 +33,7 @@
<field eval="1" name="global"/>
</record>
<record id="point_of_sale.res_groups_posuser0" model="res.groups">
<field eval="[(6,0,[ref('product.menu_config_product'),ref('product.menu_product_category_action_form'),ref('point_of_sale.menu_point_ofsale'),ref('point_of_sale.menu_point_config'),ref('point_of_sale.menu_statement_tree_all'),ref('stock.menu_stock_root'),ref('stock.menu_action_location_form'),ref('stock.menu_action_location_tree'),ref('stock.menu_picking_waiting'),ref('stock.menu_action_picking_tree3'),ref('stock.menu_action_picking_tree5'),ref('stock.menu_action_picking_form'),ref('stock.menu_action_picking_tree7'),ref('stock.menu_action_picking_tree8'),ref('stock.menu_action_picking_tree9'),ref('mrp.menu_mrp_procurement_action3'),ref('mrp.menu_mrp_procurement_new'),ref('report_mrp.next_id_77'),ref('report_mrp.menu_report_workcenter_load'),ref('report_mrp.menu_report_in_out_picking'),ref('base.menu_sales'),ref('sale.menu_action_shop_form'),ref('sale.menu_sale_order'),ref('sale.menu_action_order_tree'),ref('sale.menu_action_order_tree_all'),ref('sale.menu_action_order_tree2'),ref('sale.menu_action_order_tree3'),ref('sale.menu_action_order_tree7'),ref('sale.menu_action_order_tree8'),ref('sale.menu_action_order_line_tree1'),ref('delivery.menu_action_delivery_carrier_form'),ref('delivery.menu_action_delivery_grid_form'),ref('point_of_sale.menu_point_root')])]" name="menu_access"/>
<field eval="[(6,0,[ref('product.menu_config_product'),ref('product.menu_product_category_action_form'),ref('point_of_sale.menu_point_ofsale'),ref('point_of_sale.menu_point_config'),ref('point_of_sale.menu_statement_tree_all'),ref('stock.menu_stock_root'),ref('stock.menu_action_location_form'),ref('stock.menu_action_location_tree'),ref('stock.menu_picking_waiting'),ref('stock.menu_action_picking_tree3'),ref('stock.menu_action_picking_tree5'),ref('stock.menu_action_picking_form'),ref('stock.menu_action_picking_tree7'),ref('stock.menu_action_picking_tree8'),ref('stock.menu_action_picking_tree9'),ref('mrp.menu_mrp_procurement_action3'),ref('mrp.menu_mrp_procurement_new'),ref('mrp.next_id_77'),ref('mrp.menu_report_workcenter_load'),ref('mrp.menu_report_in_out_picking'),ref('base.menu_sales'),ref('sale.menu_action_shop_form'),ref('sale.menu_sale_order'),ref('sale.menu_action_order_tree'),ref('sale.menu_action_order_tree_all'),ref('sale.menu_action_order_tree2'),ref('sale.menu_action_order_tree3'),ref('sale.menu_action_order_tree7'),ref('sale.menu_action_order_tree8'),ref('sale.menu_action_order_line_tree1'),ref('delivery.menu_action_delivery_carrier_form'),ref('delivery.menu_action_delivery_grid_form'),ref('point_of_sale.menu_point_root')])]" name="menu_access"/>
<field eval="[(6,0,[ref('ir_rule_group_bankstatementcompany0'),ref('ir_rule_group_bankstatementlinecompany0'),ref('point_of_sale.ir_rule_group_point0'),ref('point_of_sale.ir_rule_group_poslinecompany0'),ref('point_of_sale.ir_rule_group_posreporting0')])]" name="rule_groups"/>
<field eval="&quot;&quot;&quot;POS_user&quot;&quot;&quot;" name="name"/>
</record>
+1
View File
@@ -40,6 +40,7 @@ works done on tasks, eso. It is able to render planning, order tasks, eso.
"project_report.xml",
"process/task_process.xml",
"project_installer.xml",
"report/project_report_view.xml"
],
'demo_xml': [
'project_demo.xml'
+3 -3
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,9 +15,9 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import project_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -29,14 +29,23 @@ class report_project_task_user(osv.osv):
_columns = {
'name': fields.char('Year',size=64,required=False, readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
'date_start': fields.datetime('Starting Date'),
'date_end': fields.datetime('Ending Date'),
'date_deadline': fields.date('Deadline'),
'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),
'task_closed': fields.integer('Task Closed', readonly=True),
'nbr': fields.integer('#Number of tasks', 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),
'state': fields.selection([('draft', 'Draft'),
('open', 'In Progress'),
('pending', 'Pending'),
('cancelled', 'Cancelled'),
('done', 'Done')],
'State', readonly=True),
}
_order = 'name desc, project_id'
@@ -46,70 +55,30 @@ class report_project_task_user(osv.osv):
create or replace view report_project_task_user as (
select
min(t.id) as id,
to_char(date_end, 'YYYY') as name,
to_char(date_end, 'MM') as month,
count(distinct t.id) as task_closed,
to_char(date_start, 'YYYY') as name,
to_char(date_start, 'MM') as month,
count(distinct t.id) as nbr,
date_trunc('day',t.date_start) as date_start,
date_trunc('day',t.date_end) as date_end,
date_trunc('day',t.date_deadline) as date_deadline,
t.user_id,
t.project_id,
t.state,
sum(planned_hours) as hours_planned,
to_char(avg(date_end::abstime-t.create_date::timestamp), 'DD"d" HH24:MI:SS') as closing_days,
sum(w.hours) as hours_effective,
((sum(planned_hours)-sum(w.hours))/count(distinct t.id))::decimal(16,2) as hours_delay
from project_task t
left join project_task_work w on (t.id=w.task_id)
where
t.state='done'
group by
to_char(date_end, 'YYYY'),to_char(date_end, 'MM'),t.user_id,project_id
to_char(date_start, 'YYYY'),
to_char(date_start, 'MM'),
t.user_id,t.state,t.date_end,
t.date_deadline,t.date_start,
t.project_id
)
""")
report_project_task_user()
class report_project_task(osv.osv):
_name = "report.project.task"
_description = "Tasks by project"
_auto = False
_columns = {
'name': fields.char('Year',size=64,required=False, 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),
'task_closed': fields.integer('Task Closed', 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),
}
_order = 'name desc, project_id'
def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'report_project_task')
cr.execute("""
create or replace view report_project_task as (
select
min(t.id) as id,
to_char(date_end, 'YYYY') as name,
to_char(date_end, 'MM') as month,
count(distinct t.id) as task_closed,
t.project_id,
sum(planned_hours) as hours_planned,
to_char(avg(date_end::abstime-t.create_date::timestamp), 'DD"d" HH12:MI:SS') as closing_days,
sum(w.hours) as hours_effective,
((sum(planned_hours)-sum(w.hours))/count(distinct t.id))::decimal(16,2) as hours_delay
from project_task t
left join project_task_work w on (t.id=w.task_id)
where
t.state='done'
group by
to_char(date_end, 'YYYY'),to_char(date_end, 'MM'),project_id
)
""")
report_project_task()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem id="base.menu_project_report" name="Reporting" parent="base.menu_main_pm" sequence="50"/>
<record id="view_task_project_user_tree" model="ir.ui.view">
<field name="name">report.project.task.user.tree</field>
<field name="model">report.project.task.user</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Tasks">
<field name="name" invisible="1"/>
<field name="month" invisible="1"/>
<field name="user_id"/>
<field name="project_id"/>
<field name="nbr"/>
<field name="date_start" invisible="1"/>
<field name="date_end" invisible="1"/>
<field name="date_deadline" invisible="1"/>
<field name="hours_planned"/>
<field name="hours_effective"/>
<field name="hours_delay"/>
<field name="closing_days"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_task_project_user_search" model="ir.ui.view">
<field name="name">report.project.task.user.search</field>
<field name="model">report.project.task.user</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Tasks">
<group col="10" colspan="4">
<filter icon="terp-project" string="This Year" domain="[('name','=',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" icon="terp-project" domain="[('date_start','=',time.strftime('%%Y/%%m/%%d'))]"/>
<filter string="End" icon="terp-project" domain="[('date_end','=',time.strftime('%%Y/%%m/%%d'))]"/>
<filter string="Deadline" icon="terp-project" domain="[('date_deadline','=',time.strftime('%%Y/%%m/%%d'))]"/>
<filter string="Closed" icon="terp-project" domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<field name="project_id" select="1"/>
<field name="user_id" select="1" widget="selection">
<filter icon="terp-project" string="My Task" domain="[('user_id','=',uid)]" default="1"/>
</field>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="11">
<filter string="User" icon="terp-project" context="{'group_by':'user_id'}" />
<filter string="Project" icon="terp-project" context="{'group_by':'project_id'}" />
<separator orientation="vertical"/>
<filter string="State" icon="terp-project" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-project" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-project" context="{'group_by':'name'}"/>
</group>
</group>
</search>
</field>
</record>
<record id="action_project_task_user_tree" model="ir.actions.act_window">
<field name="name">Tasks</field>
<field name="res_model">report.project.task.user</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="search_view_id" ref="view_task_project_user_search"/>
</record>
<menuitem action="action_project_task_user_tree" id="menu_project_task_user_tree" parent="base.menu_project_report"/>
</data>
</openerp>
+2 -1
View File
@@ -12,4 +12,5 @@
"access_config_compute_remaining","project.config.compute.remaining","model_config_compute_remaining","project.group_project_user",1,1,1,1
"access_config_compute_remaining_manager","project.config.compute.remaining.manager","model_config_compute_remaining","project.group_project_manager",1,1,1,1
"access_project_message","project.message","model_project_message","project.group_project_user",1,0,0,0
"access_project_installer","project.installer","model_project_installer","project.group_project_user",1,0,0,0
"access_project_installer","project.installer","model_project_installer","project.group_project_user",1,0,0,0
"access_report_project_task_user","report.project.task.user","model_report_project_task_user","project.group_project_manager",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
12 access_config_compute_remaining project.config.compute.remaining model_config_compute_remaining project.group_project_user 1 1 1 1
13 access_config_compute_remaining_manager project.config.compute.remaining.manager model_config_compute_remaining project.group_project_manager 1 1 1 1
14 access_project_message project.message model_project_message project.group_project_user 1 0 0 0
15 access_project_installer project.installer model_project_installer project.group_project_user 1 0 0 0
16 access_report_project_task_user report.project.task.user model_report_project_task_user project.group_project_manager 1 0 0 0
@@ -1,15 +1,21 @@
from osv import fields,osv
import tools
from crm import crm
class project_issue_report(osv.osv):
_name = "project.issue.report"
_name = "project.issue.report"
_auto = False
_inherit = "crm.case.report"
_columns = {
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue.report')]"),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue.report')]"),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue.report')]"),
'nbr': fields.integer('# of Issues', reaadonly=True),
'delay_close': fields.char('Delay to close', size=20, readonly=True),
'company_id' : fields.many2one('res.company', 'Company'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'project_id':fields.many2one('project.project', 'Project'),
'type_id': fields.many2one('crm.case.resource.type', 'Bug Type', domain="[('object_id.model', '=', 'project.issue')]"),
'date_closed': fields.datetime('Close Date', readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'project_issue_report')
@@ -24,11 +30,19 @@ class project_issue_report(osv.osv):
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,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
project_issue c
left join
res_users u on (c.id = u.id)
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.stage_id
,c.date_closed,u.company_id,c.priority,c.project_id,c.type_id
)""")
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Project Bug
-->
<!-- Report for project issue -->
<record id="view_project_issue_report_tree" model="ir.ui.view">
<field name="name">project.issue.report.tree</field>
<field name="model">project.issue.report</field>
@@ -12,19 +10,22 @@
<tree string="Project Issue">
<field name="name" />
<field name="month"/>
<field name="priority" />
<field name="stage_id" />
<field name="type_id" string="Type"/>
<field name="project_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="nbr" string="#Project Issue"/>
<field name="amount_revenue"/>
<field name="probability"/>
<field name="amount_revenue_prob" widget="progress"/>
<field name="delay_close"/>
<field name="state" invisible="1"/>
<field name="section_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="stage_id" invisible="1"/>
<field name="categ_id" invisible="1"/>
<field name="date_closed" invisible="1"/>
</tree>
</field>
</record>
</record>
<record id="view_project_issue_report_graph" model="ir.ui.view">
<field name="name">project.issue.report.graph</field>
<field name="model">project.issue.report</field>
@@ -43,22 +44,64 @@
<field name="inherit_id" ref="crm.view_crm_case_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<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'}"/>
<data>
<xpath expr='//search[@string="Search"]/group[1]/filter[@string="This Year"]' position='replace'>
<filter string="This Year" icon="terp-sale" domain="[('name','=',time.strftime('%%Y'))]"/>
</xpath>
<xpath expr='//search[@string="Search"]/group[1]/filter[@string="This Month"]' position='replace'>
<filter string="This Month" icon="terp-sale" domain="[('month','=',time.strftime('%%m'))]" />
</xpath>
<xpath expr='//search[@string="Search"]/group[1]/filter[@string="Lost"]' position='after'>
<separator orientation="vertical"/>
<filter string="Closed Today" icon="terp-sale" domain="[('date_closed','=',time.strftime('%%Y/%%m/%%d'))]" />
</xpath>
<xpath expr='//search[@string="Search"]/group[1]/field[3]' position='after'>
<field name="project_id" widget="selection"/>
</xpath>
<xpath expr='//search[@string="Search"]/group[@string="Group By..."]' position='before'>
<newline/>
<group expand="1" string="Extended options..." colspan="10" col="12">
<filter icon="terp-sale"
string="Highest"
domain="[('priority','=','1')]"/>
<filter icon="terp-sale"
string="High"
domain="[('priority','=','2')]"/>
<filter icon="terp-sale"
string="Normal"
domain="[('priority','=','3')]"/>
<filter icon="terp-sale"
string="Low"
domain="[('priority','=','4')]"/>
<filter icon="terp-sale"
string="Lowest"
domain="[('priority','=','5')]"/>
</group>
<newline/>
</xpath>
<xpath expr='//search[@string="Search"]/group[@string="Group By..."]/filter[@string="Company"]' position='replace'>
<filter string="Company" icon="terp-sale" domain="[]" context="{'group_by':'company_id'}"/>
</xpath>
<xpath expr='//search[@string="Search"]/group[@string="Group By..."]/filter[@string="Category"]' position='after'>
<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="Type" icon="terp-sale" domain="[]" context="{'group_by':'type_id'}"/>
</xpath>
</data>
</field>
</record>
<record id="action_project_issue_report" model="ir.actions.act_window">
<field name="name">Project Issue Report</field>
<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,tree</field>
<field name="view_id" ref="view_project_issue_report_tree"/>
<field name="search_view_id" ref="view_project_issue_report_filter"/>
</record>
<record model="ir.actions.act_window.view" id="action_project_issue_report_tree">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
@@ -70,9 +113,9 @@
<field name="view_mode">graph</field>
<field name="view_id" ref="view_project_issue_report_graph"/>
<field name="act_window_id" ref="action_project_issue_report"/>
</record>
</record>
<menuitem icon="terp-project" id="base.menu_main_pm" name="Project Management" sequence="1"/>
<menuitem id="base.menu_project_report" name="Reporting" parent="base.menu_main_pm" sequence="50"/>
<menuitem id="base.menu_project_report" name="Reporting" parent="base.menu_main_pm" sequence="50"/>
<menuitem action="action_project_issue_report" id="menu_project_issue_report_tree" parent="base.menu_project_report"/>
</data>
</openerp>
+3 -2
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,9 +15,10 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import project_timesheet
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+1 -1
View File
@@ -33,7 +33,7 @@
'website': 'http://www.openerp.com',
'depends': ['base', 'project', 'hr_timesheet_sheet'],
'init_xml': [],
'update_xml': ["process/project_timesheet_process.xml"],
'update_xml': ["process/project_timesheet_process.xml", "report/task_report_view.xml"],
'demo_xml': [],
'installable': True,
'active': False,
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,10 +15,9 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import task_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,159 @@
# -*- 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/>.
#
##############################################################################
from osv import fields,osv
import mx.DateTime
import tools
#class task_report(osv.osv):
# _name = "task.report"
# _description = "Project task report"
# _auto = False
# _columns = {
# 'name': fields.char('Task',size=64,required=False, 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),
# 'task_nbr': fields.float('Task Number', readonly=True),
# 'task_hrs': fields.float('Task Hours', readonly=True),
# 'task_progress': fields.float('Task Progress', readonly=True),
# 'company_id' : fields.many2one('res.company', 'Company'),
# 'task_state': fields.selection([('draft', 'Draft'),('open', 'Open'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done'),('no','No Task')], 'Status', readonly=True),
# 'project_id':fields.many2one('project.project', 'Project'),
# 'year': fields.char('Year',size=64,required=False, readonly=True),
# 'date_start': fields.datetime('Starting Date',readonly=True),
# 'date_end': fields.datetime('Ending Date',readonly=True),
# 'date_deadline': fields.date('Deadline',readonly=True),
# 'type': fields.many2one('project.task.type', 'Stage'),
# 'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Importance'),
# 'assign_to': fields.many2one('res.users', 'Assigned to', readonly=True),
# 'remaining_hrs': fields.float('Remaining Hours', readonly=True),
# }
#
# def init(self, cr):
# tools.sql.drop_view_if_exists(cr, 'task_report')
# cr.execute('''
# create or replace view task_report as (
# select
# min(t.id) as id,
# to_char(t.create_date, 'YYYY') as year,
# to_char(t.create_date,'MM') as month,
# u.id as user_id,
# u.company_id as company_id,
# t.name as name,
# t.project_id as project_id,
# to_char(t.date_start,'YYYY/mm/dd') as date_start,
# to_char(t.date_end,'YYYY/mm/dd') as date_end,
# to_char(t.date_deadline,'YYYY/mm/dd') as date_deadline,
# t.type as type,
# t.priority as priority,
# t.user_id as assign_to,
# t.remaining_hours as remaining_hrs,
# count(t.*) as task_nbr,
# sum(t.planned_hours) as task_hrs,
# sum(t.planned_hours * (100 - t.progress) / 100) as task_progress,
# case when t.state is null then 'no' else t.state end as task_state
# from
# res_users u
# left join
# project_task t on (u.id = t.user_id)
# where
# u.active
# group by
# to_char(t.create_date, 'YYYY'),to_char(t.create_date,'MM'),u.id, u.company_id, t.state
# ,t.name,t.project_id,t.type,t.priority,
# t.user_id,t.remaining_hours,to_char(t.date_start,'YYYY/mm/dd'),to_char(t.date_end,'YYYY/mm/dd'),to_char(t.date_deadline,'YYYY/mm/dd')
# )
# ''')
#task_report()
class report_timesheet_task_user(osv.osv):
_name = "report.timesheet.task.user"
_auto = False
_order = "name"
def _get_task_hours(self, cr, uid, ids, name,args,context):
result = {}
for record in self.browse(cr, uid, ids,context):
last_date = mx.DateTime.strptime(record.name, '%Y-%m-%d') + mx.DateTime.RelativeDateTime(months=1) - 1
task_obj=self.pool.get('project.task.work')
task_ids = task_obj.search(cr,uid,[('user_id','=',record.user_id.id),('date','>=',record.name),('date','<=',last_date.strftime('%Y-%m-%d'))])
tsk_hrs = task_obj.read(cr,uid,task_ids,['hours','date','user_id'])
total = 0.0
for hrs in tsk_hrs:
total += hrs['hours']
result[record.id] = total
return result
def get_hrs_timesheet(self, cr, uid, ids, name,args,context):
result = {}
sum = 0.0
for record in self.browse(cr, uid, ids, context):
last_date = mx.DateTime.strptime(record.name, '%Y-%m-%d') + mx.DateTime.RelativeDateTime(months=1) - 1
obj=self.pool.get('hr_timesheet_sheet.sheet.day')
sheet_ids = obj.search(cr,uid,[('sheet_id.user_id','=',record.user_id.id),('name','>=',record.name),('name','<=',last_date.strftime('%Y-%m-%d'))])
data_days = obj.read(cr,uid,sheet_ids,['name','sheet_id.user_id','total_attendance'])
total = 0.0
for day_attendance in data_days:
total += day_attendance['total_attendance']
result[record.id] = total
return result
_columns = {
'name': fields.char('Name',size=64),
'year': fields.char('Year',size=64,required=False, 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),
'timesheet_hrs': fields.function(get_hrs_timesheet, method=True, string="Timesheet Hours"),
'task_hrs': fields.function(_get_task_hours, method=True, string="Task Hours"),
}
def init(self, cr):
cr.execute(""" create or replace view report_timesheet_task_user as (
select
((r.id*12)+to_number(months.m_id,'99'))::integer as id,
months.name as name,
r.id as user_id,
to_char(to_date(months.name, 'YYYY/MM/DD'),'YYYY') as year,
to_char(to_date(months.name, 'YYYY/MM/DD'),'MM') as month
from res_users r,
(select to_char(p.date,'YYYY-MM-01') as name,
to_char(p.date,'MM') as m_id
from project_task_work p
union
select to_char(h.name,'YYYY-MM-01') as name,
to_char(h.name,'MM') as m_id
from hr_timesheet_sheet_sheet_day h) as months
group by
r.id,months.m_id,months.name,
to_char(to_date(months.name, 'YYYY/MM/DD'),'YYYY') ,
to_char(to_date(months.name, 'YYYY/MM/DD'),'MM')
) """)
report_timesheet_task_user()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,182 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem
id="hr.menu_hr_reporting"
name="Reporting"
parent="hr.menu_hr_root"
sequence="40" />
<!-- Tasks by projects and users
<record id="view_task_project_form" model="ir.ui.view">
<field name="name">task.report.form</field>
<field name="model">task.report</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Tasks by User">
<field name="user_id" select="1"/>
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="task_nbr" select="2"/>
<field name="task_hrs" select="2"/>
<field name="task_progress" select="2"/>
<field name="task_state" select="1"/>
</form>
</field>
</record>
<record id="view_task_project_graph" model="ir.ui.view">
<field name="name">task.report.graph</field>
<field name="model">task.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Tasks by User" type="bar">
<field name="user_id"/>
<field name="task_progress" operator="+"/>
</graph>
</field>
</record>
<record id="view_task_project_tree" model="ir.ui.view">
<field name="name">task.report.tree</field>
<field name="model">task.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Tasks by User">
<field name="date_start" select="1" invisible="1"/>
<field name="name" select="1"/>
<field name="project_id" select="1"/>
<field name="assign_to" select="1"/>
<field name="type" select="1" invisible="1"/>
<field name="priority" select="1" invisible="1"/>
<field name="date_end" select="1" invisible="1"/>
<field name="month" select="1" invisible="1"/>
<field name="year" select="1" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="remaining_hrs"/>
<field name="date_deadline" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="task_nbr"/>
<field name="task_hrs"/>
<field name="task_progress"/>
<field name="task_state"/>
</tree>
</field>
</record>
<record id="view_report_task_search" model="ir.ui.view">
<field name="name">task.report.search</field>
<field name="model">task.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Tasks by User">
<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">
<filter icon="terp-project" string="My Task" domain="[('user_id','=',uid)]" default="1"/>
</field>
<newline/>
<group expand="1" string="Extended options..." colspan="10" col="12">
<filter icon="terp-project"
string="Very urgent"
domain="[('priority','=','0')]"/>
<filter icon="terp-project"
string="Urgent"
domain="[('priority','=','1')]"/>
<filter icon="terp-project"
string="Medium"
domain="[('priority','=','2')]"/>
<filter icon="terp-project"
string="Low"
domain="[('priority','=','3')]"/>
<filter icon="terp-project"
string="Very Low"
domain="[('priority','=','4')]"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="11">
<filter string="User" icon="terp-project" context="{'group_by':'user_id'}" />
<filter string="Project" icon="terp-project" context="{'group_by':'project_id'}" />
<filter string="Company" icon="terp-project" context="{'group_by':'company_id'}" />
<separator orientation="vertical"/>
<filter string="State" icon="terp-project" context="{'group_by':'task_state'}"/>
<filter string="Stage" icon="terp-project" context="{'group_by':'type'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-project" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-project" context="{'group_by':'year'}"/>
</group>
</group>
</search>
</field>
</record>
<record id="action_project_task" model="ir.actions.act_window">
<field name="name">Tasks</field>
<field name="res_model">task.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="domain">[]</field>
<field name="search_view_id" ref="view_report_task_search"/>
</record>
<menuitem id="base.menu_project_report" name="Reporting" parent="base.menu_main_pm" sequence="50"/>
<menuitem action="action_project_task" id="menu_project_task_user_tree" parent="base.menu_project_report"/>
-->
<!-- Report for Users' Timesheet and Task Hours per Month -->
<record id="view_report_timesheet_task_user_tree" model="ir.ui.view">
<field name="name">report.timesheet.task.user.tree</field>
<field name="model">report.timesheet.task.user</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Timesheet/Task hours Report Per Month" >
<field name="name" select="1"/>
<field name="year" select="1" invisible="1"/>
<field name="month" select="1" invisible="1"/>
<field name="user_id" select="1"/>
<field name="timesheet_hrs" widget="float_time" />
<field name="task_hrs" widget="float_time"/>
</tree>
</field>
</record>
<record id="view_report_timesheet_task_user_search" model="ir.ui.view">
<field name="name">report.timesheet.task.user.search</field>
<field name="model">report.timesheet.task.user</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Tasks by User">
<group colspan="4" col="3">
<filter icon="terp-project" string="This Year" domain="[('year','=',time.strftime('%%Y'))]" />
<filter icon="terp-project" string="This Month" domain="[('month','=',time.strftime('%%m'))]" />
<separator orientation="vertical"/>
<field name="user_id" select="1" widget="selection">
<filter icon="terp-project" string="My Task" domain="[('user_id','=',uid)]" />
</field>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="3">
<filter string="User" icon="terp-project" context="{'group_by':'user_id'}" default="1" />
<filter string="Year" icon="terp-project" context="{'group_by':'year'}" />
<filter string="Month" icon="terp-project" context="{'group_by':'month'}" />
</group>
</search>
</field>
</record>
<record id="action_report_timesheet_task_user" model="ir.actions.act_window">
<field name="name">Timesheet / Task Hours Per Month</field>
<field name="res_model">report.timesheet.task.user</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="search_view_id" ref="view_report_timesheet_task_user_search"/>
</record>
<menuitem id="menu_timesheet_task_user" parent="hr.menu_hr_reporting" action="action_report_timesheet_task_user"/>
</data>
</openerp>
@@ -0,0 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_task_report","report.task.report","model_task_report","project.group_project_manager",1,0,0,0
"access_report_timesheet_task_user","report.timesheet.task.user","model_report_timesheet_task_user","project.group_project_manager",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_task_report report.task.report model_task_report project.group_project_manager 1 0 0 0
3 access_report_timesheet_task_user report.timesheet.task.user model_report_timesheet_task_user project.group_project_manager 1 0 0 0
+2 -1
View File
@@ -41,7 +41,8 @@
'purchase_wizard.xml',
'stock_view.xml',
'partner_view.xml',
'process/purchase_process.xml'
'process/purchase_process.xml',
'report/purchase_report_view.xml',
],
'demo_xml': ['purchase_demo.xml'],
'installable': True,
+3 -2
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,12 +15,13 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import order
import request_quotation
import purchase_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -26,11 +26,12 @@
from osv import fields,osv
import tools
class report_purchase_order_product(osv.osv):
_name = "report.purchase.order.product"
_description = "Purchases Orders by Products"
class report_purchase_order(osv.osv):
_name = "report.purchase.order"
_description = "Purchases Orders"
_auto = False
_columns = {
'date': fields.date('Date', readonly=True),
'name': fields.char('Year',size=64,required=False, readonly=True),
'state': fields.selection([
('draft','Quotation'),
@@ -43,6 +44,11 @@ class report_purchase_order_product(osv.osv):
('cancel','Cancel')
], 'Order State', readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', readonly=True),
'category_id': fields.many2one('product.category', 'Categories', readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', 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),
'price_total': fields.float('Total Price', readonly=True),
'price_average': fields.float('Average Price', readonly=True),
@@ -53,62 +59,20 @@ class report_purchase_order_product(osv.osv):
}
_order = 'name desc,price_total desc'
def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'report_purchase_order_product')
tools.sql.drop_view_if_exists(cr, 'report_purchase_order')
cr.execute("""
create or replace view report_purchase_order_product as (
create or replace view report_purchase_order as (
select
min(l.id) as id,
s.date_order as date,
to_char(s.date_order, 'YYYY') as name,
to_char(s.date_order, 'MM') as month,
s.state,
s.warehouse_id as warehouse_id,
s.partner_id as partner_id,
s.create_uid as user_id,
s.company_id as company_id,
l.product_id,
sum(l.product_qty*u.factor) as quantity,
count(*),
sum(l.product_qty*l.price_unit) as price_total,
(sum(l.product_qty*l.price_unit)/sum(l.product_qty*u.factor))::decimal(16,2) as price_average
from purchase_order s
left join purchase_order_line l on (s.id=l.order_id)
left join product_uom u on (u.id=l.product_uom)
where l.product_id is not null
group by l.product_id, to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state
)
""")
report_purchase_order_product()
class report_purchase_order_category(osv.osv):
_name = "report.purchase.order.category"
_description = "Purchases Orders by Categories"
_auto = False
_columns = {
'name': fields.char('Year',size=64,required=False, readonly=True),
'state': fields.selection([
('draft','Quotation'),
('waiting_date','Waiting Schedule'),
('manual','Manual in progress'),
('progress','In progress'),
('shipping_except','Shipping Exception'),
('invoice_except','Invoice Exception'),
('done','Done'),
('cancel','Cancel')
], 'Order State', readonly=True),
'category_id': fields.many2one('product.category', 'Categories', readonly=True),
'quantity': fields.float('# of Products', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
'price_average': fields.float('Average Price', readonly=True),
'count': fields.integer('# of Lines', 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),
}
_order = 'name desc,price_total desc'
def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'report_purchase_order_category')
cr.execute("""
create or replace view report_purchase_order_category as (
select
min(l.id) as id,
to_char(s.date_order, 'YYYY') as name,
to_char(s.date_order, 'MM') as month,
s.state,
t.categ_id as category_id,
sum(l.product_qty*u.factor) as quantity,
count(*),
@@ -120,10 +84,13 @@ class report_purchase_order_category(osv.osv):
left join product_template t on (t.id=p.product_tmpl_id)
left join product_uom u on (u.id=l.product_uom)
where l.product_id is not null
group by t.categ_id, to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state
)
group by s.company_id,s.create_uid,s.partner_id,
t.categ_id,l.product_id,s.date_order,
to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state,
s.warehouse_id
)
""")
report_purchase_order_category()
report_purchase_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_purchase_order_graph">
<field name="name">product.month.graph</field>
<field name="model">report.purchase.order</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Purchase Orders Statistics" type="bar">
<field name="product_id"/>
<field name="quantity" operator="+"/>
<field name="price_total" operator="+"/>
</graph>
</field>
</record>
<record id="view_purchase_order_tree" model="ir.ui.view">
<field name="name">report.purchase.order.tree</field>
<field name="model">report.purchase.order</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Purchase Orders Statistics">
<field name="name"/>
<field name="month"/>
<field name="partner_id"/>
<field name="product_id"/>
<field name="user_id" invisible="1"/>
<field name="warehouse_id" invisible="1"/>
<field name="category_id" invisible="1"/>
<field name="date" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="count"/>
<field name="quantity"/>
<field name="price_total"/>
<field name="price_average"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_purchase_order_search" model="ir.ui.view">
<field name="name">report.purchase.order.search</field>
<field name="model">report.purchase.order</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Purchase Orders">
<filter icon="terp-purchase"
string="This Year"
domain="[('name','=',time.strftime('%%Y'))]"
default="1"
help="Purchase orders of the year"/>
<filter icon="terp-purchase"
string="This Month"
default="1"
domain="[('month','=',time.strftime('%%m'))]"
help="Purchase orders of this month"/>
<separator orientation="vertical"/>
<filter icon="terp-purchase"
string="Quotations"
domain="[('state','=','draft')]"/>
<filter icon="terp-purchase"
string="Purchase"
default="1"
domain="[('state','&lt;&gt;','draft'),('state','&lt;&gt;','cancel')]"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-purchase"
string="My Purchases"
domain="[('user_id','=',uid)]"/>
</field>
<field name="partner_id"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Company" icon="terp-purchase" context="{'group_by':'company_id'}"/>
<filter string="Warehouse" icon="terp-purchase" context="{'group_by':'warehouse_id'}"/>
<filter string="Responsible" icon="terp-purchase" context="{'group_by':'user_id'}" default="1"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-purchase" context="{'group_by':'product_id'}"/>
<filter string="Product Category" icon="terp-purchase" context="{'group_by':'category_id'}"/>
<filter string="Partner" icon="terp-purchase" context="{'group_by':'partner_id'}"/>
<filter string="State" icon="terp-purchase" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-purchase" context="{'group_by':'date'}"/>
<filter string="Year" icon="terp-purchase" context="{'group_by':'name'}"/>
</group>
</search>
</field>
</record>
<record id="action_purchase_order_report_all" model="ir.actions.act_window">
<field name="name">Purchase Orders</field>
<field name="res_model">report.purchase.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="search_view_id" ref="view_purchase_order_search"/>
</record>
<menuitem id="base.next_id_73" name="Reporting" parent="base.menu_purchase_root" sequence="8"/>
<menuitem action="action_purchase_order_report_all" id="menu_action_purchase_order_report_all" parent="base.next_id_73" sequence="3"/>
</data>
</openerp>
+2 -1
View File
@@ -7,4 +7,5 @@
"access_stock_move_purchase_user","stock.move purchase_user","stock.model_stock_move","purchase.group_purchase_user",1,1,1,1
"access_purchase_order_stock_worker","purchase.order stock_worker","model_purchase_order","stock.group_stock_user",1,0,0,0
"access_purchase_order_line_stock_worker","purchase.order.line stock_worker","model_purchase_order_line","stock.group_stock_user",1,0,0,0
"access_account_tax_purchase_user","account.tax purchase_user","account.model_account_tax","purchase.group_purchase_user",1,0,0,0
"access_account_tax_purchase_user","account.tax purchase_user","account.model_account_tax","purchase.group_purchase_user",1,0,0,0
"access_report_purchase_order","report.purchase.order","model_report_purchase_order","purchase.group_purchase_manager",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
7 access_stock_move_purchase_user stock.move purchase_user stock.model_stock_move purchase.group_purchase_user 1 1 1 1
8 access_purchase_order_stock_worker purchase.order stock_worker model_purchase_order stock.group_stock_user 1 0 0 0
9 access_purchase_order_line_stock_worker purchase.order.line stock_worker model_purchase_order_line stock.group_stock_user 1 0 0 0
10 access_account_tax_purchase_user account.tax purchase_user account.model_account_tax purchase.group_purchase_user 1 0 0 0
11 access_report_purchase_order report.purchase.order model_report_purchase_order purchase.group_purchase_manager 1 0 0 0
-25
View File
@@ -1,25 +0,0 @@
# -*- 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 report_receivable
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-38
View File
@@ -1,38 +0,0 @@
# -*- 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/>.
#
##############################################################################
{
'name': 'Account Reporting - Reporting',
'version': '1.0',
'category': 'Generic Modules/Accounting',
'description': """A module that adds new reports based on the account module.""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['account'],
'init_xml': [],
'update_xml': ['security/ir.model.access.csv', 'report_receivable_view.xml'],
'demo_xml': [],
'installable': True,
'active': False,
'certificate': '0061754222813',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,7 +0,0 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_report_account_receivable","report.account.receivable","model_report_account_receivable","account.group_account_manager",1,0,0,0
"access_temp_range","temp.range","model_temp_range","account.group_account_manager",1,0,0,0
"access_report_aged_receivable","report.aged.receivable","model_report_aged_receivable","account.group_account_manager",1,0,0,0
"access_report_invoice_created","report.invoice.created","model_report_invoice_created","account.group_account_manager",1,0,0,0
"access_report_account_type_sales","report.account_type.sales","model_report_account_type_sales","account.group_account_manager",1,0,0,0
"access_report_account_sales","report.account.sales","model_report_account_sales","account.group_account_manager",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_report_account_receivable report.account.receivable model_report_account_receivable account.group_account_manager 1 0 0 0
3 access_temp_range temp.range model_temp_range account.group_account_manager 1 0 0 0
4 access_report_aged_receivable report.aged.receivable model_report_aged_receivable account.group_account_manager 1 0 0 0
5 access_report_invoice_created report.invoice.created model_report_invoice_created account.group_account_manager 1 0 0 0
6 access_report_account_type_sales report.account_type.sales model_report_account_type_sales account.group_account_manager 1 0 0 0
7 access_report_account_sales report.account.sales model_report_account_sales account.group_account_manager 1 0 0 0
-25
View File
@@ -1,25 +0,0 @@
# -*- 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 report_analytic
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-38
View File
@@ -1,38 +0,0 @@
# -*- 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/>.
#
##############################################################################
{
'name': 'Analytic Account Reporting',
'version': '1.0',
'category': 'Generic Modules/Accounting',
'description': """A module that adds new reports based on analytic accounts.""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['account', 'hr_timesheet_invoice'],
'init_xml': [],
'update_xml': ['security/ir.model.access.csv', 'report_analytic_view.xml'],
'demo_xml': [],
'installable': True,
'active': False,
'certificate': '0059950675429',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,3 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_report_analytic_account_close,report.analytic.account.close,model_report_analytic_account_close,account.group_account_manager,1,0,0,0
access_report_account_analytic_line_to_invoice,report.account.analytic.line.to.invoice,model_report_account_analytic_line_to_invoice,account.group_account_manager,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_report_analytic_account_close report.analytic.account.close model_report_analytic_account_close account.group_account_manager 1 0 0 0
3 access_report_account_analytic_line_to_invoice report.account.analytic.line.to.invoice model_report_account_analytic_line_to_invoice account.group_account_manager 1 0 0 0
-43
View File
@@ -1,43 +0,0 @@
# -*- 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/>.
#
##############################################################################
{
'name': 'Analytic lines - Reporting',
'version': '1.0',
'category': 'Generic Modules/Accounting',
'description': """A report on analytic lines, costs by products, months and accounts.
ATTENTION:
This Module is merged into report_analytic module. so It will be removed in future""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['account', 'hr_timesheet_invoice'],
'init_xml': [],
'update_xml': [],
'demo_xml': [],
'installable': True,
'active': False,
'certificate': '0075179053853',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,2 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_report_account_analytic_line_to_invoice,report.account.analytic.line.to.invoice,model_report_account_analytic_line_to_invoice,account.group_account_manager,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_report_account_analytic_line_to_invoice report.account.analytic.line.to.invoice model_report_account_analytic_line_to_invoice account.group_account_manager 1 0 0 0
-23
View File
@@ -1,23 +0,0 @@
# -*- 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 report_document
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-41
View File
@@ -1,41 +0,0 @@
# -*- 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/>.
#
##############################################################################
{
'name': 'Document Management - Reporting',
'version': '1.0',
'category': 'Generic Modules/Document Management',
'description': """
Reporting for the Document Management module:
* My Files
* All users Files
""",
'author': 'Tiny',
'depends': ['document'],
'init_xml': [],
'update_xml': ['report_document_view.xml', 'security/ir.model.access.csv'],
'demo_xml': [],
'installable': True,
'active': False,
'certificate': '0068012774557',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,9 +0,0 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_report_document_user_group_document_manager","report.document.user document manager","model_report_document_user","document.group_document_manager",1,0,0,0
"access_report_document_user_group_system","report.document.user group system","model_report_document_user","base.group_system",1,0,0,0
"access_report_files_partner_group_document_manager","report.files.partner document manager","model_report_files_partner","document.group_document_manager",1,0,0,0
"access_report_files_partner_group_system","report.files.partner group system","model_report_files_partner","base.group_system",1,0,0,0
"access_report_document_file_group_document_manager","report.document.file document manager","model_report_document_file","document.group_document_manager",1,0,0,0
"access_report_document_file_group_system","report.document.file group system","model_report_document_file","base.group_system",1,0,0,0
"access_report_document_wall_group_document_manager","report.document.wall document manager","model_report_document_wall","document.group_document_manager",1,0,0,0
"access_report_document_wall_group_system","report.document.wall group system","model_report_document_wall","base.group_system",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_report_document_user_group_document_manager report.document.user document manager model_report_document_user document.group_document_manager 1 0 0 0
3 access_report_document_user_group_system report.document.user group system model_report_document_user base.group_system 1 0 0 0
4 access_report_files_partner_group_document_manager report.files.partner document manager model_report_files_partner document.group_document_manager 1 0 0 0
5 access_report_files_partner_group_system report.files.partner group system model_report_files_partner base.group_system 1 0 0 0
6 access_report_document_file_group_document_manager report.document.file document manager model_report_document_file document.group_document_manager 1 0 0 0
7 access_report_document_file_group_system report.document.file group system model_report_document_file base.group_system 1 0 0 0
8 access_report_document_wall_group_document_manager report.document.wall document manager model_report_document_wall document.group_document_manager 1 0 0 0
9 access_report_document_wall_group_system report.document.wall group system model_report_document_wall base.group_system 1 0 0 0
-38
View File
@@ -1,38 +0,0 @@
# -*- 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/>.
#
##############################################################################
{
'name': 'MRP Management - Reporting',
'version': '1.0',
'category': 'Generic Modules/Production',
'description': """A module that adds new reports based on MRP cases.
Work Center loads, Weekly Stock value variation""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['mrp'],
'init_xml': [],
'update_xml': ['security/ir.model.access.csv', 'report_mrp_view.xml'],
'demo_xml': [],
'installable': True,
'certificate': '0071582896029',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,3 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_report_workcenter_load,report.workcenter.load,model_report_workcenter_load,mrp.group_mrp_manager,1,0,0,0
access_report_mrp_inout,report.mrp.inout,model_report_mrp_inout,mrp.group_mrp_manager,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_report_workcenter_load report.workcenter.load model_report_workcenter_load mrp.group_mrp_manager 1 0 0 0
3 access_report_mrp_inout report.mrp.inout model_report_mrp_inout mrp.group_mrp_manager 1 0 0 0
-25
View File
@@ -1,25 +0,0 @@
# -*- 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 report_project
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-39
View File
@@ -1,39 +0,0 @@
# -*- 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/>.
#
##############################################################################
{
'name': 'Project Management - Reporting',
'version': '1.0',
'category': 'Generic Modules/Sales & Purchases',
'description': """A module that adds some reports on projects.
Closed Tasks (By User and By Project), Finished Task (By User and By Project)""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['project', 'report_task'],
'init_xml': [],
'update_xml': ['security/ir.model.access.csv', 'report_project_view.xml'],
'demo_xml': [],
'installable': True,
'active': False,
'certificate': '0086804423149',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,139 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Tasks by projects and users -->
<record id="view_task_project_user_form" model="ir.ui.view">
<field name="name">report.project.task.user.form</field>
<field name="model">report.project.task.user</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Tasks by Project and User">
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="user_id" select="1"/>
<field name="project_id" select="1" default="context.get('project_id', False)"/>
<field name="task_closed" select="1"/>
<field name="hours_planned" select="1"/>
<field name="hours_effective" select="1"/>
<field name="hours_delay" select="1"/>
<field name="closing_days"/>
</form>
</field>
</record>
<record id="view_task_project_user_tree" model="ir.ui.view">
<field name="name">report.project.task.user.tree</field>
<field name="model">report.project.task.user</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Tasks by projects and users">
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="user_id" select="1"/>
<field name="project_id" select="1"/>
<field name="task_closed" select="1"/>
<field name="hours_planned" select="1"/>
<field name="hours_effective" select="1"/>
<field name="hours_delay" select="1"/>
<field name="closing_days"/>
</tree>
</field>
</record>
<record id="view_task_project_user_search" model="ir.ui.view">
<field name="name">report.project.task.user.search</field>
<field name="model">report.project.task.user</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Tasks by projects and users">
<group col="8" colspan="4">
<filter icon="terp-project" string="This Year" domain="[('name','=',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"/>
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="user_id" select="1"/>
<field name="project_id" select="1" default="context.get('project_id', False)"/>
</group>
</search>
</field>
</record>
<record id="action_project_task_user_tree" model="ir.actions.act_window">
<field name="name">Tasks Closed by Project and User</field>
<field name="res_model">report.project.task.user</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="search_view_id" ref="view_task_project_user_search"/>
</record>
<menuitem action="action_project_task_user_tree" id="menu_project_task_user_tree" parent="base.menu_project_report"/>
<!-- Tasks by projects -->
<record id="view_task_project_form" model="ir.ui.view">
<field name="name">report.project.task.form</field>
<field name="model">report.project.task</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Tasks by Project">
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="project_id" select="1"/>
<field name="task_closed" select="1"/>
<field name="hours_planned" select="1"/>
<field name="hours_effective" select="1"/>
<field name="hours_delay" select="1"/>
<field name="closing_days"/>
</form>
</field>
</record>
<record id="view_task_project_tree" model="ir.ui.view">
<field name="name">report.project.task.tree</field>
<field name="model">report.project.task</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Tasks by project">
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="project_id" select="1"/>
<field name="task_closed" select="1"/>
<field name="hours_planned" select="1"/>
<field name="hours_effective" select="1"/>
<field name="hours_delay" select="1"/>
<field name="closing_days"/>
</tree>
</field>
</record>
<record id="view_task_project_search" model="ir.ui.view">
<field name="name">report.project.task.search</field>
<field name="model">report.project.task</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Tasks by projects">
<group col="8" colspan="4">
<filter icon="terp-project" string="This Year" domain="[('name','=',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"/>
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="project_id" select="1" default="context.get('project_id', False)"/>
<field name="task_closed" select="1"/>
</group>
</search>
</field>
</record>
<record id="action_project_task_tree" model="ir.actions.act_window">
<field name="name">Tasks Closed by Project</field>
<field name="res_model">report.project.task</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="search_view_id" ref="view_task_project_search"/>
</record>
<menuitem action="action_project_task_tree" id="menu_project_task_tree" parent="base.menu_project_report"/>
</data>
</openerp>
@@ -1,3 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_report_project_task_user,report.project.task.user,model_report_project_task_user,project.group_project_manager,1,0,0,0
access_report_project_task,report.project.task,model_report_project_task,project.group_project_manager,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_report_project_task_user report.project.task.user model_report_project_task_user project.group_project_manager 1 0 0 0
3 access_report_project_task report.project.task model_report_project_task project.group_project_manager 1 0 0 0
-25
View File
@@ -1,25 +0,0 @@
# -*- 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 report_purchase
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-39
View File
@@ -1,39 +0,0 @@
# -*- 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/>.
#
##############################################################################
{
'name': 'Purchase Management - Reporting',
'version': '1.0',
'category': 'Generic Modules/Sales & Purchases',
'description': """Module to add views like
Purchase By Product, Purchase By Category of Product, All Months, Current Month.""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['purchase'],
'init_xml': [],
'update_xml': ['security/ir.model.access.csv', 'report_purchase_view.xml'],
'demo_xml': [],
'installable': True,
'active': False,
'certificate': '0073370750365',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,171 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Purchases by products by month -->
<record id="view_order_product_form" model="ir.ui.view">
<field name="name">report.purchase.order.product.form</field>
<field name="model">report.purchase.order.product</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Purchases by products">
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="product_id" select="1"/>
<field name="count"/>
<field name="quantity" select="1"/>
<field name="price_total" select="1"/>
<field name="price_average" select="1"/>
<field name="state" select="1"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_product_month_graph">
<field name="name">product.month.graph</field>
<field name="model">report.purchase.order.product</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Purchases by products" type="bar">
<field name="product_id"/>
<field name="quantity" operator="+"/>
<field name="price_total" operator="+"/>
</graph>
</field>
</record>
<record id="view_order_product_tree" model="ir.ui.view">
<field name="name">report.purchase.order.product.tree</field>
<field name="model">report.purchase.order.product</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Purchases by products">
<field name="name"/>
<field name="month"/>
<field name="product_id"/>
<field name="count"/>
<field name="quantity"/>
<field name="price_total"/>
<field name="price_average"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_order_product_search" model="ir.ui.view">
<field name="name">report.purchase.order.product.search</field>
<field name="model">report.purchase.order.product</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Purchases by products">
<group col="8" colspan="4">
<filter icon="terp-purchase" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Purchases by products during this year"/>
<filter icon="terp-purchase" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Purchases by products during this month"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="product_id" select="1"/>
<field name="state" select="1"/>
</group>
</search>
</field>
</record>
<record id="action_order_product_tree_all" model="ir.actions.act_window">
<field name="name">Purchases by Products</field>
<field name="res_model">report.purchase.order.product</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="search_view_id" ref="view_order_product_search"/>
</record>
<menuitem id="next_id_73" name="Reporting" parent="base.menu_purchase_root"/>
<menuitem action="action_order_product_tree_all" id="menu_report_order_product_all"
name="PO by Products" parent="next_id_73"/>
<!-- Purchases by category by month -->
<record id="view_order_category_form" model="ir.ui.view">
<field name="name">report.purchase.order.category.form</field>
<field name="model">report.purchase.order.category</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Purchases by Category of Products">
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="category_id" select="1"/>
<field name="count"/>
<field name="quantity" select="1"/>
<field name="price_total" select="1"/>
<field name="price_average" select="1"/>
<field name="state" select="1"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_product_category_graph">
<field name="name">product.category.graph</field>
<field name="model">report.purchase.order.category</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Purchases by Category of Products" type="bar">
<field name="category_id"/>
<field name="quantity" operator="+"/>
<field name="price_total" operator="+"/>
</graph>
</field>
</record>
<record id="view_order_category_tree" model="ir.ui.view">
<field name="name">report.purchase.order.category.tree</field>
<field name="model">report.purchase.order.category</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Purchases by Category of Products">
<field name="name"/>
<field name="month"/>
<field name="category_id"/>
<field name="count"/>
<field name="quantity"/>
<field name="price_total"/>
<field name="price_average"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_order_category_search" model="ir.ui.view">
<field name="name">report.purchase.order.category.search</field>
<field name="model">report.purchase.order.category</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Purchases by category of products">
<group col="8" colspan="4">
<filter icon="terp-purchase" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Purchases by categories of products during this year"/>
<filter icon="terp-purchase" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Purchases by categories of products during this month"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="category_id" select="1"/>
<field name="state" select="1"/>
</group>
</search>
</field>
</record>
<record id="action_order_category_tree_all" model="ir.actions.act_window">
<field name="name">Purchases by Category of Products</field>
<field name="res_model">report.purchase.order.category</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="search_view_id" ref="view_order_category_search"/>
</record>
<menuitem action="action_order_category_tree_all" id="menu_report_order_category_all"
name="PO by Products Category" parent="report_purchase.next_id_73"/>
<act_window domain="[('product_id', '=', active_id)]" id="act_product_product_2_report_purchases_order_product" name="Monthly purchases" res_model="report.purchase.order.product" src_model="product.product"/>
<act_window domain="[('category_id', '=', active_id)]" id="act_product_category_2_report_purchase_order_category" name="Monthly purchases" res_model="report.purchase.order.category" src_model="product.category"/>
</data>
</openerp>
@@ -1,3 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_report_purchase_order_product,report.purchase.order.product,model_report_purchase_order_product,purchase.group_purchase_manager,1,0,0,0
access_report_purchase_order_category,report.purchase.order.category,model_report_purchase_order_category,purchase.group_purchase_manager,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_report_purchase_order_product report.purchase.order.product model_report_purchase_order_product purchase.group_purchase_manager 1 0 0 0
3 access_report_purchase_order_category report.purchase.order.category model_report_purchase_order_category purchase.group_purchase_manager 1 0 0 0
-36
View File
@@ -1,36 +0,0 @@
# -*- 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/>.
#
##############################################################################
{
'name': 'Report on tasks by user for projects',
'version': '1.0',
'category': 'Generic Modules/Projects & Services',
'description': """Gives statistics on tasks by user on projects to check the pipeline of users.""",
'author': 'Tiny',
'depends': ['base', 'project','hr_timesheet_sheet'],
'init_xml': [],
'update_xml': ['security/ir.model.access.csv', 'report_task_view.xml'],
'installable': True,
'active': False,
'certificate': '0027671328157',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-162
View File
@@ -1,162 +0,0 @@
# -*- 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/>.
#
##############################################################################
from osv import fields,osv
import mx.DateTime
class report_task_user_pipeline_open (osv.osv):
_name = "report.task.user.pipeline.open"
_description = "Tasks by user and project"
_auto = False
_columns = {
'name': fields.char('Year',size=64,required=False, 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),
'task_nbr': fields.float('Task Number', readonly=True),
'task_hrs': fields.float('Task Hours', readonly=True),
'task_progress': fields.float('Task Progress', readonly=True),
'company_id' : fields.many2one('res.company', 'Company'),
'task_state': fields.selection([('draft', 'Draft'),('open', 'Open'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done'),('no','No Task')], 'Status', readonly=True),
}
def init(self, cr):
cr.execute('''
create or replace view report_task_user_pipeline_open as (
select
min(t.id) as id,
to_char(t.create_date, 'YYYY') as name,
to_char(t.create_date,'MM') as month,
u.id as user_id,
u.company_id as company_id,
count(t.*) as task_nbr,
sum(t.planned_hours) as task_hrs,
sum(t.planned_hours * (100 - t.progress) / 100) as task_progress,
case when t.state is null then 'no' else t.state end as task_state
from
res_users u
left join
project_task t on (u.id = t.user_id)
where
u.active
group by
to_char(t.create_date, 'YYYY'),to_char(t.create_date,'MM'),u.id, u.company_id, t.state
)
''')
report_task_user_pipeline_open()
class report_closed_task(osv.osv):
_name = "report.closed.task"
_description = "Closed Task Report"
_auto = False
_columns = {
'sequence': fields.integer('Sequence', readonly=True, help="Gives the sequence order when displaying a list of closed task reports."),
'name': fields.char('Task summary', size=128, readonly=True),
'project_id': fields.many2one('project.project', 'Project', readonly=True),
'user_id': fields.many2one('res.users', 'Assigned to', readonly=True),
'date_deadline': fields.datetime('Deadline', readonly=True),
'planned_hours': fields.float('Planned Hours', readonly=True),
'delay_hours': fields.float('Delay Hours', readonly=True),
'progress': fields.float('Progress (%)', readonly=True),
'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Importance', readonly=True),
'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'Status', readonly=True),
'remaining_hours': fields.float('Remaining Hours', readonly=True),
'date_end' : fields.datetime('Date Closed', readonly=True)
}
def init(self, cr):
cr.execute('''
create or replace view report_closed_task as (
select
tsk.id as id, tsk.sequence as sequence, tsk.name as name,
tsk.project_id as project_id, tsk.user_id as user_id,
tsk.date_deadline as date_deadline, tsk.planned_hours as planned_hours,
tsk.delay_hours as delay_hours, tsk.progress as progress,
tsk.priority as priority, tsk.state as state,
tsk.remaining_hours as remaining_hours, tsk.date_end as date_end
from
project_task tsk
where
(tsk.date_end <= CURRENT_DATE AND tsk.date_end > (CURRENT_DATE-15))
)
''')
report_closed_task()
class report_timesheet_task_user(osv.osv):
_name = "report.timesheet.task.user"
_auto = False
_order = "name"
def _get_task_hours(self, cr, uid, ids, name,args,context):
result = {}
for record in self.browse(cr, uid, ids,context):
last_date = mx.DateTime.strptime(record.name, '%Y-%m-%d') + mx.DateTime.RelativeDateTime(months=1) - 1
task_obj=self.pool.get('project.task.work')
task_ids = task_obj.search(cr,uid,[('user_id','=',record.user_id.id),('date','>=',record.name),('date','<=',last_date.strftime('%Y-%m-%d'))])
tsk_hrs = task_obj.read(cr,uid,task_ids,['hours','date','user_id'])
total = 0.0
for hrs in tsk_hrs:
total += hrs['hours']
result[record.id] = total
return result
def get_hrs_timesheet(self, cr, uid, ids, name,args,context):
result = {}
sum = 0.0
for record in self.browse(cr, uid, ids, context):
last_date = mx.DateTime.strptime(record.name, '%Y-%m-%d') + mx.DateTime.RelativeDateTime(months=1) - 1
obj=self.pool.get('hr_timesheet_sheet.sheet.day')
sheet_ids = obj.search(cr,uid,[('sheet_id.user_id','=',record.user_id.id),('name','>=',record.name),('name','<=',last_date.strftime('%Y-%m-%d'))])
data_days = obj.read(cr,uid,sheet_ids,['name','sheet_id.user_id','total_attendance'])
total = 0.0
for day_attendance in data_days:
total += day_attendance['total_attendance']
result[record.id] = total
return result
_columns = {
'name': fields.date('Month',readonly=True),
'user_id': fields.many2one('res.users', 'User',readonly=True),
'timesheet_hrs': fields.function(get_hrs_timesheet, method=True, string="Timesheet Hours"),
'task_hrs': fields.function(_get_task_hours, method=True, string="Task Hours"),
}
def init(self, cr):
cr.execute(""" create or replace view report_timesheet_task_user as (
select
((r.id*12)+to_number(months.m_id,'99'))::integer as id,
months.name as name,
r.id as user_id
from res_users r,
(select to_char(p.date,'YYYY-MM-01') as name,
to_char(p.date,'MM') as m_id
from project_task_work p
union
select to_char(h.name,'YYYY-MM-01') as name,
to_char(h.name,'MM') as m_id
from hr_timesheet_sheet_sheet_day h) as months) """)
report_timesheet_task_user()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-145
View File
@@ -1,145 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem
id="hr.menu_hr_reporting"
name="Reporting"
parent="hr.menu_hr_root"
sequence="40" />
<!-- Tasks by projects and users -->
<record id="view_task_project_form" model="ir.ui.view">
<field name="name">report.project.task.form</field>
<field name="model">report.task.user.pipeline.open</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Tasks by User">
<field name="user_id" select="1"/>
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="task_nbr" select="2"/>
<field name="task_hrs" select="2"/>
<field name="task_progress" select="2"/>
<field name="task_state" select="1"/>
</form>
</field>
</record>
<record id="view_task_project_graph" model="ir.ui.view">
<field name="name">report.project.task.graph</field>
<field name="model">report.task.user.pipeline.open</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Tasks by User" type="bar">
<field name="user_id"/>
<field name="task_progress" operator="+"/>
</graph>
</field>
</record>
<record id="view_task_project_tree" model="ir.ui.view">
<field name="name">report.project.task.tree</field>
<field name="model">report.task.user.pipeline.open</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Tasks by User">
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="user_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="task_nbr"/>
<field name="task_hrs"/>
<field name="task_progress"/>
<field name="task_state"/>
</tree>
</field>
</record>
<record id="view_report_task_user_pipeline_open_search" model="ir.ui.view">
<field name="name">report.task.user.pipeline.open.search</field>
<field name="model">report.task.user.pipeline.open</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Tasks by User">
<group col="10" colspan="4">
<filter icon="terp-project" string="This Year" domain="[('name','=',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"/>
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="user_id" select="1"/>
</group>
</search>
</field>
</record>
<record id="action_project_task" model="ir.actions.act_window">
<field name="name">Tasks by User</field>
<field name="res_model">report.task.user.pipeline.open</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="domain">[]</field>
<field name="search_view_id" ref="view_report_task_user_pipeline_open_search"/>
</record>
<menuitem id="base.menu_project_report" name="Reporting" parent="base.menu_main_pm" sequence="50"/>
<menuitem action="action_project_task" id="menu_project_task_user_tree" parent="base.menu_project_report"/>
<!-- Closed Task in Random Acitivities dashboard -->
<record id="view_task_closed_board_tree" model="ir.ui.view">
<field name="name">report.closed.task.tree</field>
<field name="model">report.closed.task</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Closed Tasks">
<field name="date_close" />
<field name="sequence"/>
<field name="name" select="1"/>
<field name="project_id" select="1"/>
<field name="user_id" select="1"/>
<field name="date_deadline"/>
<field name="planned_hours" sum="Planned" widget="float_time"/>
<field name="delay_hours" sum="Delay" widget="float_time"/>
<field name="progress" widget="progressbar"/>
<field name="priority"/>
<field name="state"/>
<field name="remaining_hours" />
</tree>
</field>
</record>
<record id="action_closed_task_board" model="ir.actions.act_window">
<field name="name">Task Closed Within Past 15 Days</field>
<field name="res_model">report.closed.task</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_task_closed_board_tree"/>
</record>
<!-- Report for Users' Timesheet and Task Hours per Month -->
<record id="view_report_timesheet_task_user_tree" model="ir.ui.view">
<field name="name">report.timesheet.task.user.tree</field>
<field name="model">report.timesheet.task.user</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Timesheet/Task hours Report Per Month" >
<field name="name" select="1"/>
<field name="user_id" select="1"/>
<field name="timesheet_hrs" widget="float_time" />
<field name="task_hrs" widget="float_time"/>
</tree>
</field>
</record>
<record id="action_report_timesheet_task_user" model="ir.actions.act_window">
<field name="name">Timesheet / Task Hours Per Month</field>
<field name="res_model">report.timesheet.task.user</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
</record>
<menuitem id="menu_timesheet_task_user" parent="hr.menu_hr_reporting" action="action_report_timesheet_task_user"/>
</data>
</openerp>

Some files were not shown because too many files have changed in this diff Show More