commit
ff7857ee24
|
@ -35,6 +35,11 @@ class account_invoice_report(osv.osv):
|
|||
('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),
|
||||
'payment_term': fields.many2one('account.payment.term', 'Payment Term',readonly=True),
|
||||
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')],readonly=True),
|
||||
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position',readonly=True),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal',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),
|
||||
|
@ -69,6 +74,11 @@ class account_invoice_report(osv.osv):
|
|||
l.product_id as product_id,
|
||||
sum(l.quantity * u.factor) as product_qty,
|
||||
s.partner_id as partner_id,
|
||||
s.payment_term as payment_term,
|
||||
s.period_id as period_id,
|
||||
s.currency_id as currency_id,
|
||||
s.journal_id as journal_id,
|
||||
s.fiscal_position as fiscal_position,
|
||||
s.user_id as user_id,
|
||||
s.company_id as company_id,
|
||||
sum(l.quantity*l.price_unit) as price_total,
|
||||
|
@ -82,9 +92,19 @@ class account_invoice_report(osv.osv):
|
|||
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
|
||||
s.type,
|
||||
s.date_invoice,
|
||||
s.partner_id,
|
||||
l.product_id,
|
||||
l.uos_id,
|
||||
s.user_id,
|
||||
s.state,
|
||||
s.company_id,
|
||||
s.payment_term,
|
||||
s.period_id,
|
||||
s.fiscal_position,
|
||||
s.currency_id,
|
||||
s.journal_id
|
||||
)
|
||||
""")
|
||||
account_invoice_report()
|
||||
|
|
|
@ -21,6 +21,11 @@
|
|||
<field name="price_average" avg="Average Price"/>
|
||||
<field name="price_total" sum="Total Price"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="payment_term" invisible="1"/>
|
||||
<field name="period_id" invisible="1"/>
|
||||
<field name="fiscal_position" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -93,12 +98,18 @@
|
|||
<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"/>
|
||||
<filter string="Type" icon="terp-account" context="{'group_by':'type'}"/>
|
||||
<filter string="Payment Term" icon="terp-account" context="{'group_by':'payment_term'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Currency" icon="terp-account" context="{'group_by':'currency_id'}"/>
|
||||
<filter string="Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Type" icon="terp-account" context="{'group_by':'type'}"/>
|
||||
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Force Period" icon="terp-account" context="{'group_by':'period_id'}"/>
|
||||
<filter string="Fiscal Position" icon="terp-account" context="{'group_by':'fiscal_position'}"/>
|
||||
<filter string="Month" icon="terp-account" context="{'group_by':'date'}"/>
|
||||
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
|
|
|
@ -43,13 +43,14 @@
|
|||
<field name="view_id" ref="hr_timesheet_sheet.view_timesheet_report_graph"/>
|
||||
</record>
|
||||
|
||||
<record id="action_hr_holidays_by_type_all" model="ir.actions.act_window">
|
||||
<field name="name">Leaves by Type</field>
|
||||
<record id="action_hr_holidays_remaining_leaves_user_all" model="ir.actions.act_window">
|
||||
<field name="name">Remaining Leaves by User</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays.by.type</field>
|
||||
<field name="res_model">hr.holidays.remaining.leaves.user</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="hr_holidays.view_hr_holidays_by_type_graph"/>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
<field name="view_id" ref="hr_holidays.view_hr_holidays_remaining_leaves_user_graph"/>
|
||||
</record>
|
||||
<record id="board_hr_form" model="ir.ui.view">
|
||||
<field name="name">board.hr.form</field>
|
||||
|
@ -60,12 +61,12 @@
|
|||
<hpaned>
|
||||
<child1>
|
||||
<action colspan="4" height="220" name="%(act_hr_current_timesheet_sheet_form)d" string="My current timesheet" width="510"/>
|
||||
<action colspan="4" height="220" name="%(action_timesheet_report_all)d" string="Timesheets by Month" />
|
||||
<action colspan="4" height="220" name="%(action_hr_holidays_by_type_all)d" string="Leaves by Type" />
|
||||
<action colspan="4" height="220" name="%(action_view_holiday_status_board)d" string="My Leaves"/>
|
||||
<action colspan="4" height="220" name="%(action_my_expense)d" string="My Expenses" />
|
||||
</child1>
|
||||
<child2>
|
||||
<action colspan="4" height="220" name="%(action_view_holiday_status_board)d" string="My Leaves"/>
|
||||
<action colspan="4" height="220" name="%(action_my_expense)d" string="My Expenses" />
|
||||
<action colspan="4" height="220" name="%(action_timesheet_report_all)d" string="Timesheets by Month" />
|
||||
<action colspan="4" height="220" name="%(action_hr_holidays_remaining_leaves_user_all)d" string="Leaves by Type" />
|
||||
</child2>
|
||||
</hpaned>
|
||||
</form>
|
||||
|
|
|
@ -38,9 +38,10 @@ This module implements a dashboard for project member that includes:
|
|||
'project_planning',
|
||||
'hr_timesheet_sheet',
|
||||
'project_issue',
|
||||
'resource'
|
||||
'resource',
|
||||
'scrum'
|
||||
],
|
||||
'update_xml': ['board_project_view.xml', 'board_project_manager_view.xml'],
|
||||
'update_xml': ['board_project_view.xml', 'board_project_manager_view.xml','board_project_issue_view.xml','board_scrum_view.xml'],
|
||||
'demo_xml': ['board_project_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="action_view_current_project_issue_tree" model="ir.actions.act_window">
|
||||
<field name="name">Project issues</field>
|
||||
<field name="res_model">project.issue</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('create_date', '>=', time.strftime('%Y-%m-%d 00:00:00')),('create_date', '<=', time.strftime('%Y-%m-%d 23:59:59'))]</field>
|
||||
<field name="view_id" ref="project_issue.project_issue_tree_view"/>
|
||||
</record>
|
||||
|
||||
<record id="board_project_issue_form" model="ir.ui.view">
|
||||
<field name="name">board.project.issue.form</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Project Issue Board">
|
||||
<vpaned>
|
||||
<child1>
|
||||
<action colspan="4" height="220" name="%(action_view_current_project_issue_tree)d" string="Current Project Issues" width="510"/>
|
||||
</child1>
|
||||
<child2>
|
||||
<action colspan="4" height="220" name="%(project.action_task_by_days_graph)d" string="Project Task By Days" width="510"/>
|
||||
</child2>
|
||||
</vpaned>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="open_board_project_issue" model="ir.actions.act_window">
|
||||
<field name="name">Project Issue Dashboard</field>
|
||||
<field name="res_model">board.board</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="usage">menu</field>
|
||||
<field name="view_id" ref="board_project_issue_form"/>
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_deshboard_project_issue"
|
||||
name="Project Issue Dashboard" parent="next_id_86"
|
||||
icon="terp-graph" action="open_board_project_issue"/>
|
||||
</data>
|
||||
</openerp>
|
|
@ -47,6 +47,14 @@
|
|||
<field name="domain">[('user_id','=',uid),('state','=','open')]</field>
|
||||
<field name="view_id" ref="view_task_tree"/>
|
||||
</record>
|
||||
<record id="action_view_pending_task_tree" model="ir.actions.act_window">
|
||||
<field name="name">My Pending Tasks</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid),('state','=','pending')]</field>
|
||||
<field name="view_id" ref="view_task_tree"/>
|
||||
</record>
|
||||
<record id="action_view_task_tree_deadline" model="ir.actions.act_window">
|
||||
<field name="name">My Task's Deadlines</field>
|
||||
<field name="res_model">project.task</field>
|
||||
|
@ -91,13 +99,12 @@
|
|||
<form string="My Board">
|
||||
<hpaned>
|
||||
<child1>
|
||||
<action colspan="4" height="220" name="%(action_view_task_tree)d" string="My Open Tasks" width="510"/>
|
||||
<action colspan="4" name="%(project_issue.project_issue_categ_act0)d" string="Issues"/>
|
||||
|
||||
</child1>
|
||||
<action colspan="4" name="%(action_view_task_tree)d" string="My Open Tasks" width="510"/>
|
||||
<action colspan="4" name="%(action_view_pending_task_tree)d" string="My Pending Tasks" width="510"/>
|
||||
</child1>
|
||||
<child2>
|
||||
<action colspan="4" height="150" name="%(action_view_project_member_tree)d" string="Project(s) Members"/>
|
||||
<action colspan="4" name="%(action_view_project_editable_messages_tree)d" string="Messages"/>
|
||||
<action colspan="4" name="%(project.action_project_vs_remaining_hours_graph)d" string="Remaining Hours Per Project" />
|
||||
<action colspan="4" name="%(project.action_task_by_days_vs_planned_hours_graph)d" string="Planned Hours Per Day" />
|
||||
</child2>
|
||||
</hpaned>
|
||||
</form>
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="action_sprint_all_dashboard_tree" model="ir.actions.act_window">
|
||||
<field name="name">Sprints List</field>
|
||||
<field name="res_model">scrum.sprint</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="scrum.view_scrum_sprint_tree"/>
|
||||
</record>
|
||||
<record id="board_project_scrum_form" model="ir.ui.view">
|
||||
<field name="name">board.project.form</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="My Board">
|
||||
<hpaned>
|
||||
<child1>
|
||||
<action colspan="4" height="220" name="%(action_sprint_all_dashboard_tree)d" string="Sprints List" width="510"/>
|
||||
</child1>
|
||||
</hpaned>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="open_board_project_scrum" model="ir.actions.act_window">
|
||||
<field name="name">Project Dashboard</field>
|
||||
<field name="res_model">board.board</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="usage">menu</field>
|
||||
<field name="view_id" ref="board_project_scrum_form"/>
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_deshboard_scurm"
|
||||
name="Scurm Dashboard" parent="next_id_86"
|
||||
icon="terp-graph" action="open_board_project_scrum"/>
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,24 @@
|
|||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
# -*- 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': 'Board for Purchase Management',
|
||||
'version': '1.0',
|
||||
'category': 'Board/Purchase',
|
||||
'description': """
|
||||
This module implements a dashboard for purcgase management that includes:
|
||||
* Current Purchase Orders
|
||||
* Draft Purchase Orders
|
||||
* Graph for quantity and amount per month
|
||||
""",
|
||||
'author': 'Tiny',
|
||||
'depends': [ 'purchase','board',
|
||||
],
|
||||
'update_xml': ['board_purchase_view.xml'],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
|
||||
<menuitem
|
||||
id="menu_purchase_deshboard"
|
||||
name="Purchase"
|
||||
parent="base.dashboard"/>
|
||||
|
||||
<record id="purchase_waiting" model="ir.actions.act_window">
|
||||
<field name="name">Quotation Request</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">purchase.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain">[('state','in',('wait','confirmed'))]</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="purchase.purchase_order_tree"/>
|
||||
</record>
|
||||
|
||||
<record id="board_purchase_form" model="ir.ui.view">
|
||||
<field name="name">board.purchase.form</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="My Board">
|
||||
<hpaned>
|
||||
<child1>
|
||||
<action colspan="4" height="220" name="%(purchase.purchase_rfq)d" string="Draft Purchase Order" width="510"/>
|
||||
<action colspan="4" height="220" name="%(purchase_waiting)d" string="Purchase Order in Waiting" width="510"/>
|
||||
</child1>
|
||||
<child2>
|
||||
<action colspan="4" height="220" name="%(purchase.action_purchase_order_qty_amount_all)d" string="Total Qty and Amount by month" />
|
||||
<action colspan="4" height="220" name="%(purchase.action_purchase_order_by_user_all)d" string="Total Orders by User per month" />
|
||||
</child2>
|
||||
</hpaned>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="open_board_purchase" model="ir.actions.act_window">
|
||||
<field name="name">Purchase Dashboard</field>
|
||||
<field name="res_model">board.board</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="usage">menu</field>
|
||||
<field name="view_id" ref="board_purchase_form"/>
|
||||
</record>
|
||||
<menuitem
|
||||
action="open_board_purchase"
|
||||
icon="terp-graph"
|
||||
id="menu_board_purchase"
|
||||
parent="menu_purchase_deshboard"
|
||||
sequence="4"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -71,29 +71,31 @@ class hr_holidays_report(osv.osv):
|
|||
""")
|
||||
hr_holidays_report()
|
||||
|
||||
class hr_holidays_by_type(osv.osv):
|
||||
_name = "hr.holidays.by.type"
|
||||
class hr_holidays_remaining_leaves_user(osv.osv):
|
||||
_name = "hr.holidays.remaining.leaves.user"
|
||||
_description = "Total holidays by type"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.char('Leave Type',size=64),
|
||||
'no_of_leaves' : fields.integer('Total leaves'),
|
||||
'name': fields.char('Employee',size=64),
|
||||
'no_of_leaves' : fields.integer('Remaining leaves'),
|
||||
'user_id':fields.many2one('res.users','User'),
|
||||
|
||||
}
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'hr_holidays_by_type')
|
||||
tools.drop_view_if_exists(cr, 'hr_holidays_remaining_leaves_user')
|
||||
cr.execute("""
|
||||
create or replace view hr_holidays_by_type as (
|
||||
create or replace view hr_holidays_remaining_leaves_user as (
|
||||
select
|
||||
min(hhl.id) as id,
|
||||
hhs.name as name,
|
||||
sum(hhl.number_of_days) * -1 as no_of_leaves
|
||||
min(hrs.id) as id,
|
||||
rr.name as name,
|
||||
sum(hrs.number_of_days) as no_of_leaves,
|
||||
hrs.user_id
|
||||
from
|
||||
hr_holidays as hhl,hr_holidays_status as hhs
|
||||
hr_holidays as hrs, hr_employee as hre, resource_resource as rr
|
||||
where
|
||||
hhs.id = hhl.holiday_status_id and number_of_days < 0
|
||||
hrs.employee_id = hre.id and hre.resource_id = rr.id
|
||||
group by
|
||||
hhs.name,hhl.holiday_status_id
|
||||
rr.name,hrs.user_id
|
||||
)
|
||||
""")
|
||||
hr_holidays_by_type()
|
||||
hr_holidays_remaining_leaves_user()
|
||||
|
|
|
@ -90,9 +90,9 @@
|
|||
|
||||
<menuitem action="action_hr_holidays_report_all" id="menu_hr_holidays_report_all" parent="menu_hr_reporting_holidays" sequence="0"/>
|
||||
|
||||
<record id="view_hr_holidays_by_type_tree" model="ir.ui.view">
|
||||
<field name="name">hr.holidays.by.type.tree</field>
|
||||
<field name="model">hr.holidays.by.type</field>
|
||||
<record id="view_hr_holidays_remaining_leaves_user_tree" model="ir.ui.view">
|
||||
<field name="name">hr.holidays.remaining.leaves.user.tree</field>
|
||||
<field name="model">hr.holidays.remaining.leaves.user</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Leaves by Type">
|
||||
|
@ -102,9 +102,9 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_holidays_by_type_graph" model="ir.ui.view">
|
||||
<field name="name">hr.holidays.by.type.graph</field>
|
||||
<field name="model">hr.holidays.by.type</field>
|
||||
<record id="view_hr_holidays_remaining_leaves_user_graph" model="ir.ui.view">
|
||||
<field name="name">hr.holidays.remaining.leaves.user.graph</field>
|
||||
<field name="model">hr.holidays.remaining.leaves.user</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Leaves by Type" orientation = "horizontal" type="bar">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!--<wizard id="wizard_close_task" menu="False" model="project.task" name="project.task.close" string="Close Task"/>-->
|
||||
<wizard id="wizard_close_task" menu="False" model="project.task" name="project.task.close" string="Close Task"/>
|
||||
<wizard id="wizard_delegate_task" menu="False" model="project.task" name="project.task.delegate" string="Delegate Task"/>
|
||||
<!--<wizard
|
||||
id="wizard_duplicate_template"
|
||||
|
|
|
@ -19,5 +19,6 @@
|
|||
#
|
||||
##############################################################################
|
||||
import project_report
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -80,5 +80,89 @@ class report_project_task_user(osv.osv):
|
|||
""")
|
||||
report_project_task_user()
|
||||
|
||||
#This class is generated for project deshboard purpose
|
||||
class project_vs_remaining_hours(osv.osv):
|
||||
_name = "project.vs.remaining.hours"
|
||||
_description = " Project vs Remaining hours"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'project': fields.char('Project', size=128, required=True),
|
||||
'remaining_hours': fields.float('Remaining Hours', readonly=True),
|
||||
'state': fields.selection([('draft','Draft'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Close'),('template', 'Template')], 'State', required=True,readonly=True)
|
||||
}
|
||||
_order = 'project desc'
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'project_vs_remaining_hours')
|
||||
cr.execute("""
|
||||
create or replace view project_vs_remaining_hours as (
|
||||
select
|
||||
min(pt.id) as id,
|
||||
a.name as project,
|
||||
sum(pt.remaining_hours) as remaining_hours,
|
||||
a.state
|
||||
from
|
||||
project_task as pt,
|
||||
project_project as p,
|
||||
account_analytic_account as a
|
||||
where
|
||||
pt.project_id=p.id and
|
||||
p.category_id = a.id
|
||||
group by
|
||||
a.name,a.state
|
||||
)
|
||||
""")
|
||||
project_vs_remaining_hours()
|
||||
|
||||
class task_by_days(osv.osv):
|
||||
_name = "task.by.days"
|
||||
_description = "Task By Days"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'day': fields.char('Day', size=128, required=True),
|
||||
'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True),
|
||||
'total_task': fields.float('Total tasks', readonly=True)
|
||||
}
|
||||
_order = 'day desc'
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'task_by_days')
|
||||
cr.execute("""
|
||||
create or replace view task_by_days as (
|
||||
select
|
||||
min(pt.id) as id,
|
||||
to_char(pt.create_date, 'YYYY-MM-DD') as day,
|
||||
count(*) as total_task,
|
||||
pt.state as state
|
||||
from
|
||||
project_task as pt
|
||||
group by
|
||||
to_char(pt.create_date, 'YYYY-MM-DD'),pt.state
|
||||
)
|
||||
""")
|
||||
task_by_days()
|
||||
|
||||
class task_by_days_vs_planned_hours(osv.osv):
|
||||
_name = "task.by.days.vs.planned.hours"
|
||||
_description = "Task By Days vs Planned Hours"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'day': fields.char('Day', size=128, required=True),
|
||||
'planned_hour': fields.float('Planned Hours', readonly=True)
|
||||
}
|
||||
_order = 'day desc'
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'task_by_days_vs_planned_hours')
|
||||
cr.execute("""
|
||||
create or replace view task_by_days_vs_planned_hours as (
|
||||
select
|
||||
min(pt.id) as id,
|
||||
to_char(pt.create_date, 'YYYY-MM-DD') as day,
|
||||
sum(planned_hours) as planned_hour
|
||||
from
|
||||
project_task as pt
|
||||
group by
|
||||
to_char(pt.create_date, 'YYYY-MM-DD')
|
||||
)
|
||||
""")
|
||||
task_by_days_vs_planned_hours()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -66,5 +66,106 @@
|
|||
</record>
|
||||
<menuitem action="action_project_task_user_tree" id="menu_project_task_user_tree" parent="base.menu_project_report"/>
|
||||
|
||||
<!-- Views and action for project dashboard -->
|
||||
<record id="view_project_vs_remaining_hours_tree" model="ir.ui.view">
|
||||
<field name="name">project.vs.remaining.hour.tree</field>
|
||||
<field name="model">project.vs.remaining.hours</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Project and remaining hours" colors="pink:state=='draft';blue:state=='pending';black:state=='open';red:state=='cancelled';grey:state=='close';yellow:state=='template'">
|
||||
<field name="project"/>
|
||||
<field name="remaining_hours"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_project_vs_remaining_hours_graph" model="ir.ui.view">
|
||||
<field name="name">project.vs.remaining.hour.graph</field>
|
||||
<field name="model">project.vs.remaining.hours</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Project vs remaining hours" type="bar">
|
||||
<field name="project"/>
|
||||
<field name="state" group="True"/>
|
||||
<field name="remaining_hours" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_project_vs_remaining_hours_graph" model="ir.actions.act_window">
|
||||
<field name="name">Project and remaining hours</field>
|
||||
<field name="res_model">project.vs.remaining.hours</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_project_vs_remaining_hours_graph"/>
|
||||
</record>
|
||||
<!-- Views and action for project issue dashboard -->
|
||||
<record id="view_task_by_days_tree" model="ir.ui.view">
|
||||
<field name="name">task.by.days.tree</field>
|
||||
<field name="model">task.by.days</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Task By Days" >
|
||||
<field name="day"/>
|
||||
<field name="total_task"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_task_by_days_graph" model="ir.ui.view">
|
||||
<field name="name">task.by.days.graph</field>
|
||||
<field name="model">task.by.days</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Task By Days" type="bar">
|
||||
<field name="day"/>
|
||||
<field name="state" group="True"/>
|
||||
<field name="total_task" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_task_by_days_graph" model="ir.actions.act_window">
|
||||
<field name="name">Task By Days</field>
|
||||
<field name="res_model">task.by.days</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_task_by_days_graph"/>
|
||||
</record>
|
||||
|
||||
<!-- Views and action for project dashboard -->
|
||||
<record id="view_task_by_days_vs_planned_hours_tree" model="ir.ui.view">
|
||||
<field name="name">task.by.days.vs.planned.hours.tree</field>
|
||||
<field name="model">task.by.days.vs.planned.hours</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Task By Days vs Planned Hours" >
|
||||
<field name="day"/>
|
||||
<field name="planned_hour"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_task_by_days_vs_planned_hours_graph" model="ir.ui.view">
|
||||
<field name="name">task.by.days.vs.planned.hours.graph</field>
|
||||
<field name="model">task.by.days.vs.planned.hours</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Task By Days vs Planned Hours" type="bar">
|
||||
<field name="day"/>
|
||||
<field name="planned_hour" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_task_by_days_vs_planned_hours_graph" model="ir.actions.act_window">
|
||||
<field name="name">Task By Days vs Planned Hours</field>
|
||||
<field name="res_model">task.by.days.vs.planned.hours</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_task_by_days_vs_planned_hours_graph"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -35,7 +35,7 @@ class project_issue_report(osv.osv):
|
|||
c.priority as priority,
|
||||
c.project_id as project_id,
|
||||
c.type_id as type_id,
|
||||
count(*) as nbr,
|
||||
count(*) as nbr,
|
||||
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
|
||||
from
|
||||
project_issue c
|
||||
|
@ -49,4 +49,5 @@ class project_issue_report(osv.osv):
|
|||
project_issue_report()
|
||||
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -117,5 +117,7 @@
|
|||
<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 action="action_project_issue_report" id="menu_project_issue_report_tree" parent="base.menu_project_report"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -157,13 +157,13 @@
|
|||
<field name="partner_id" select="1"/>
|
||||
<field name="product_id" select="1"/>
|
||||
<field name="create_uid" select="1" widget="selection">
|
||||
<filter icon="terp-partner" domain="[('create_uid','=',uid)]" help="My Purchase Orders"/>
|
||||
<filter icon="terp-partner" domain="[('create_uid','=',uid)]" help="My Purchase Orders"/>
|
||||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="10">
|
||||
<filter string="Supplier" icon="terp-purchase" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Supplier" icon="terp-purchase" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Order Date" icon="terp-purchase" domain="[]" context="{'group_by':'date_order'}"/>
|
||||
</group>
|
||||
</search>
|
||||
|
@ -176,10 +176,10 @@
|
|||
<field name="res_model">purchase.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain">[('state','=','draft')]</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_purchase_order_filter"/>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_purchase_order_filter"/>
|
||||
</record>
|
||||
<menuitem action="purchase_rfq" id="menu_purchase_rfq" parent="menu_procurement_management"
|
||||
<menuitem action="purchase_rfq" id="menu_purchase_rfq" parent="menu_procurement_management"
|
||||
name="Request for Quotations" sequence="6"/>
|
||||
|
||||
<record id="purchase_form_action" model="ir.actions.act_window">
|
||||
|
@ -216,7 +216,7 @@
|
|||
<field name="minimum_planned_date"/>
|
||||
<field name="invoiced_rate" widget="progressbar"/>
|
||||
<field name="shipped_rate" widget="progressbar"/>
|
||||
<field name="amount_untaxed" sum="Total Untaxed amount"/>
|
||||
<field name="amount_untaxed" sum="Total Untaxed amount"/>
|
||||
<field name="amount_total" sum="Total amount"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
|
@ -289,7 +289,7 @@
|
|||
name="Product purchases"
|
||||
res_model="purchase.order.line"
|
||||
src_model="product.product"/>
|
||||
<!--
|
||||
<!--
|
||||
<record model="ir.values" id="action_merge_purchase_order">
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">Purchase Order</field>
|
||||
|
|
|
@ -43,9 +43,15 @@ class purchase_report(osv.osv):
|
|||
('done','Done'),
|
||||
('cancel','Cancel')
|
||||
], 'Order State', readonly=True),
|
||||
'invoice_method': fields.selection([
|
||||
('manual','Manual'),
|
||||
('order','From Order'),
|
||||
('picking','From Picking')
|
||||
],'Invoicing Control', 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),
|
||||
'location_id': fields.many2one('stock.location', 'Destination', readonly=True),
|
||||
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position',readonly=True),
|
||||
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
|
||||
'company_id':fields.many2one('res.company', 'Company', readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
|
||||
|
@ -70,27 +76,98 @@ class purchase_report(osv.osv):
|
|||
s.state,
|
||||
s.warehouse_id as warehouse_id,
|
||||
s.partner_id as partner_id,
|
||||
s.fiscal_position,
|
||||
s.create_uid as user_id,
|
||||
s.company_id as company_id,
|
||||
s.invoice_method,
|
||||
l.product_id,
|
||||
t.categ_id as category_id,
|
||||
s.location_id as location_id,
|
||||
sum(l.product_qty*u.factor) as quantity,
|
||||
count(*) as nbr,
|
||||
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_product p on (p.id=l.product_id)
|
||||
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 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
|
||||
group by
|
||||
s.company_id,
|
||||
s.create_uid,
|
||||
s.partner_id,
|
||||
s.location_id,
|
||||
l.product_id,
|
||||
s.date_order,
|
||||
to_char(s.date_order, 'YYYY'),
|
||||
to_char(s.date_order, 'MM'),
|
||||
s.state,
|
||||
s.warehouse_id,
|
||||
s.fiscal_position,
|
||||
s.invoice_method
|
||||
)
|
||||
""")
|
||||
purchase_report()
|
||||
|
||||
class purchase_order_qty_amount(osv.osv):
|
||||
_name = "purchase.order.qty.amount"
|
||||
_description = "Quantity and amount per month"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'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),
|
||||
'total_qty' : fields.float('Total Qty'),
|
||||
'total_amount' : fields.float('Total Amount'),
|
||||
|
||||
}
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'purchase_order_qty_amount')
|
||||
cr.execute("""
|
||||
create or replace view purchase_order_qty_amount as (
|
||||
select
|
||||
min(id) as id,
|
||||
to_char(create_date, 'MM') as month,
|
||||
sum(product_qty) as total_qty,
|
||||
sum(price_unit) as total_amount
|
||||
from
|
||||
purchase_order_line
|
||||
where
|
||||
to_char(create_date,'YYYY') = to_char(current_date,'YYYY')
|
||||
group by
|
||||
to_char(create_date, 'MM')
|
||||
|
||||
)
|
||||
""")
|
||||
purchase_order_qty_amount()
|
||||
|
||||
class purchase_order_by_user(osv.osv):
|
||||
_name = "purchase.order.by.user"
|
||||
_description = "Purchase Order by user per month"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name' : fields.char('User',size=64,required=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),
|
||||
'nbr' : fields.integer('Total Orders'),
|
||||
|
||||
}
|
||||
_order = 'name desc'
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'purchase_order_by_user')
|
||||
cr.execute("""
|
||||
create or replace view purchase_order_by_user as (
|
||||
select
|
||||
min(po.id) as id,
|
||||
rs.name as name,
|
||||
count(po.id) as nbr,
|
||||
to_char(po.date_order, 'MM') as month
|
||||
from
|
||||
purchase_order as po,res_users as rs
|
||||
where
|
||||
po.create_uid = rs.id
|
||||
group by
|
||||
rs.name,po.date_order
|
||||
|
||||
)
|
||||
""")
|
||||
purchase_order_by_user()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
</record>
|
||||
|
||||
<record id="view_purchase_order_tree" model="ir.ui.view">
|
||||
<field name="name">report.purchase.order.tree</field>
|
||||
<field name="name">purchase.order.tree</field>
|
||||
<field name="model">purchase.report</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
|
@ -33,6 +33,8 @@
|
|||
<field name="warehouse_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="location_id" invisible="1"/>
|
||||
<field name="fiscal_position" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -72,17 +74,33 @@
|
|||
<field name="product_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-purchase" string="Manual" domain="[('invoice_method','=','manual')]"/>
|
||||
<filter icon="terp-purchase" string="From Order" domain="[('invoice_method','=','order')]"/>
|
||||
<filter icon="terp-purchase" string="From Picking" domain="[('invoice_method','=','picking')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-purchase" string="Waiting Schedule" domain="[('state','=','waiting_date')]"/>
|
||||
<filter icon="terp-purchase" string="Manual in progress" domain="[('state','=','manual')]"/>
|
||||
<filter icon="terp-purchase" string="In progress" domain="[('state','=','progress')]"/>
|
||||
<filter icon="terp-purchase" string="Shipping Exception" domain="[('state','=','shipping_except')]"/>
|
||||
<filter icon="terp-purchase" string="Invoice Exception" domain="[('state','=','invoice_except')]"/>
|
||||
<filter icon="terp-purchase" string="Done" domain="[('state','=','done')]"/>
|
||||
<filter icon="terp-purchase" string="Cancel" domain="[('state','=','cancel')]"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<separator string="Group by" />
|
||||
<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"/>
|
||||
<filter string="Location" icon="terp-purchase" context="{'group_by':'location_id'}"/>
|
||||
<filter string="Responsible" icon="terp-purchase" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-purchase" context="{'group_by':'product_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="Fiscal Position" icon="terp-purchase" context="{'group_by':'fiscal_position'}"/>
|
||||
<filter string="Month" icon="terp-purchase" context="{'group_by':'date'}"/>
|
||||
<filter string="Year" icon="terp-purchase" context="{'group_by':'name'}"/>
|
||||
</group>
|
||||
|
@ -96,10 +114,76 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="search_view_id" ref="view_purchase_order_search"/>
|
||||
<field name="context">{'search_default_user_id':True}</field>
|
||||
</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"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_purchase_order_qty_amount_graph">
|
||||
<field name="name">purchase.order.qty.amount.graph</field>
|
||||
<field name="model">purchase.order.qty.amount</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Total Qty and Amount by month" type="bar">
|
||||
<field name="month"/>
|
||||
<field name="total_qty" operator="+"/>
|
||||
<field name="total_amount" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_purchase_order_qty_amount_tree">
|
||||
<field name="name">purchase.order.qty.amount.tree</field>
|
||||
<field name="model">purchase.order.qty.amount</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Total Qty and Amount by month" >
|
||||
<field name="month"/>
|
||||
<field name="total_qty" />
|
||||
<field name="total_amount"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_purchase_order_qty_amount_all" model="ir.actions.act_window">
|
||||
<field name="name">Total Qty and Amount by month</field>
|
||||
<field name="res_model">purchase.order.qty.amount</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_purchase_order_by_user_graph">
|
||||
<field name="name">purchase.order.by.user.graph</field>
|
||||
<field name="model">purchase.order.by.user</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Total Orders by User per month" type="bar">
|
||||
<field name="name" />
|
||||
<field name="month" group="True" />
|
||||
<field name="nbr" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_purchase_order_by_user_tree">
|
||||
<field name="name">purchase.order.by.user.tree</field>
|
||||
<field name="model">purchase.order.by.user</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Total Orders by User per month" >
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
<field name="nbr" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_purchase_order_by_user_all" model="ir.actions.act_window">
|
||||
<field name="name">Total Orders by User per month</field>
|
||||
<field name="res_model">purchase.order.by.user</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -39,6 +39,8 @@ class sale_report(osv.osv):
|
|||
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
|
||||
'shop_id':fields.many2one('sale.shop', 'Shop', readonly=True),
|
||||
'company_id':fields.many2one('res.company', 'Company', readonly=True),
|
||||
'payment_term': fields.many2one('account.payment.term', 'Payment Term',readonly=True),
|
||||
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position',readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'Salesman', readonly=True),
|
||||
'price_total':fields.float('Total Price', readonly=True),
|
||||
'delay':fields.float('Avg Closing Days', digits=(16,2), readonly=True),
|
||||
|
@ -70,6 +72,8 @@ class sale_report(osv.osv):
|
|||
s.partner_id as partner_id,
|
||||
s.user_id as user_id,
|
||||
s.shop_id as shop_id,
|
||||
s.fiscal_position as fiscal_position,
|
||||
s.payment_term as payment_term,
|
||||
s.company_id as company_id,
|
||||
extract(epoch from avg(s.date_confirm-s.create_date))/(24*60*60)::decimal(16,2) as delay,
|
||||
sum(l.product_uom_qty*l.price_unit) as price_total,
|
||||
|
@ -82,9 +86,16 @@ class sale_report(osv.osv):
|
|||
sale_order s on (s.id=l.order_id)
|
||||
left join product_uom u on (u.id=l.product_uom)
|
||||
group by
|
||||
s.date_order, s.partner_id, l.product_id,
|
||||
l.product_uom, s.user_id, s.state, s.shop_id,
|
||||
s.company_id
|
||||
s.date_order,
|
||||
s.partner_id,
|
||||
l.product_id,
|
||||
l.product_uom,
|
||||
s.user_id,
|
||||
s.state,
|
||||
s.shop_id,
|
||||
s.company_id,
|
||||
s.fiscal_position,
|
||||
s.payment_term
|
||||
)
|
||||
""")
|
||||
sale_report()
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
<field name="price_average" avg="Average Price"/>
|
||||
<field name="price_total" sum="Total Price"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="fiscal_position" invisible="1"/>
|
||||
<field name="payment_term" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -72,6 +74,17 @@
|
|||
<field name="product_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-sale" string="Waiting Schedule" domain="[('state','=','waiting_date')]"/>
|
||||
<filter icon="terp-sale" string="Manual In Progress" domain="[('state','=','manual')]"/>
|
||||
<filter icon="terp-sale" string="In Progress" domain="[('state','=','progress')]"/>
|
||||
<filter icon="terp-sale" string="Shipping Exception" domain="[('state','=','shipping_except')]"/>
|
||||
<filter icon="terp-sale" string="Invoice Exception" domain="[('state','=','invoice_except')]"/>
|
||||
<filter icon="terp-sale" string="Done" domain="[('state','=','done')]"/>
|
||||
<filter icon="terp-sale" string="Cancelled" domain="[('state','=','cancel')]"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Company" icon="terp-sale" context="{'group_by':'company_id'}"/>
|
||||
|
@ -80,8 +93,10 @@
|
|||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-sale" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Partner" icon="terp-sale" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Payment Term" icon="terp-sale" context="{'group_by':'payment_term'}"/>
|
||||
<filter string="State" icon="terp-sale" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Fiscal Position" icon="terp-sale" context="{'group_by':'fiscal_position'}"/>
|
||||
<filter string="Month" icon="terp-sale" context="{'group_by':'date'}"/>
|
||||
<filter string="Year" icon="terp-sale" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
|
|
Loading…
Reference in New Issue