[IMP] removed unused objects/reports

bzr revid: fp@tinyerp.com-20101230072125-3md9f6t8t5c3h8iv
This commit is contained in:
Fabien Pinckaers 2010-12-30 08:21:25 +01:00
parent 3c4cdab9f2
commit f59a2f1d7c
3 changed files with 0 additions and 170 deletions

View File

@ -217,91 +217,3 @@ class report_timesheet_invoice(osv.osv):
""")
report_timesheet_invoice()
class report_random_timsheet(osv.osv):
_name = "report.random.timesheet"
_description = "Random Timesheet Report"
_auto = False
_columns = {
'analytic_account_id': fields.many2one('account.analytic.account','Analytic Account', readonly=True),
'name': fields.char('Description', size=64, readonly=True),
'quantity': fields.float('Quantity', readonly=True),
'date': fields.date('Date', readonly=True),
'user_id': fields.many2one('res.users', 'User', readonly=True)
}
_order = "date desc"
def __init__(self, pool, cr):
super(report_random_timsheet, self).__init__(pool, cr)
self.called = False
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
""" To call the init() method timely
"""
if not self.called:
self.init(cr, user)
self.called = True # To make sure that init doesn't get called multiple times
res = super(report_random_timsheet, self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
return res
def init(self, cr, uid=1):
drop_view_if_exists(cr, 'report_random_timesheet')
cr.execute("""create or replace view report_random_timesheet as (
select
line.id as id, line.account_id as analytic_account_id, line.name as name,
line.unit_amount as quantity, line.date as date, line.user_id as user_id
from
account_analytic_line line, hr_department dept,hr_employee dept_user
where
(dept.id = dept_user.department_id AND dept_user.id=line.user_id AND line.user_id is not null)
AND (dept.manager_id = """ + str(uid) + """ )
AND (line.date <= CURRENT_DATE AND line.date > (CURRENT_DATE-3))
LIMIT 10
)
""" )
report_random_timsheet()
class random_timesheet_lines(osv.osv):
_name = "random.timesheet.lines"
_description = "Random Timesheet Lines"
_auto = False
_columns = {
'date': fields.date('Date', readonly=True),
'name': fields.char('Description', size=64, readonly=True),
'user_id': fields.many2one('res.users', 'User', readonly=True),
'quantity': fields.float('Quantity', readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
'analytic_account_id': fields.many2one('account.analytic.account','Analytic Account', readonly=True),
'uom_id': fields.many2one('product.uom', 'UoM', readonly=True),
'amount': fields.float('Amount', readonly=True),
'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Invoicing', readonly=True),
'general_account_id': fields.many2one('account.account', 'General Account', readonly=True)
}
_order = "date desc"
def init(self, cr):
drop_view_if_exists(cr, 'random_timesheet_lines')
cr.execute("""create or replace view random_timesheet_lines as (
select
line.id as id, line.date as date, line.name as name, line.unit_amount as quantity,
line.product_id as product_id, line.account_id as analytic_account_id,
line.product_uom_id as uom_id, line.amount as amount, line.to_invoice as to_invoice,
line.general_account_id as general_account_id, line.user_id as user_id
from
account_analytic_line line
where
(line.date <= CURRENT_DATE AND line.date > (CURRENT_DATE-15))
)
""" )
random_timesheet_lines()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -425,85 +425,5 @@
src_model="res.users"/>
<!-- Random Timesheet -->
<record model="ir.ui.view" id="view_random_timesheet_tree">
<field name="name">report.random.timesheet.tree</field>
<field name="model">report.random.timesheet</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Random Timesheets">
<field name="analytic_account_id" select="1" groups="analytic.group_analytic_accounting"/>
<field name="name" select="1"/>
<field name="quantity" select="2" />
<field name="date" select="1"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_random_timesheet_board">
<field name="name">Random Timesheet</field>
<field name="res_model">report.random.timesheet</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_random_timesheet_tree"/>
</record>
<!-- Random Timesheet Lines of random activities -->
<record id="view_random_timesheet_lines_search" model="ir.ui.view">
<field name="name">random.timesheet.lines.search</field>
<field name="model">random.timesheet.lines</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Timesheet Lines">
<group col='15' colspan='4'>
<filter icon="terp-check" string="Current" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"/>
<separator orientation="vertical"/>
<field name="user_id" widget="selection"/>
<field name="product_id" widget="selection"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="Analytic Account" icon="terp-folder-violet" domain="[]" context="{'group_by':'analytic_account_id'}"/>
<filter string="General Account" icon="terp-folder-orange" domain="[]" context="{'group_by':'general_account_id'}"/>
</group>
</search>
</field>
</record>
<record model="ir.ui.view" id="view_random_timesheet_lines_tree">
<field name="name">random.timesheet.lines.tree</field>
<field name="model">random.timesheet.lines</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Random Timesheets Lines">
<field name="date" select="1"/>
<field name="user_id"/>
<field name="name" select="1"/>
<field name="quantity" />
<field name="product_id" select="1"/>
<field name="analytic_account_id" select="1" groups="analytic.group_analytic_accounting"/>
<field name="uom_id" />
<field name="amount" />
<field name="to_invoice" select="1"/>
<field name="general_account_id" />
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_random_timesheet_lines_board">
<field name="type">ir.actions.act_window</field>
<field name="name">Working Hours</field>
<field name="res_model">random.timesheet.lines</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_user_id':uid }</field>
<field name="view_id" ref="view_random_timesheet_lines_tree"/>
<field name="search_view_id" ref="view_random_timesheet_lines_search"/>
</record>
</data>
</openerp>

View File

@ -7,8 +7,6 @@
"access_report_timesheet_account","report_timesheet.account","model_report_timesheet_account","base.group_hr_manager",1,1,1,1
"access_report_timesheet_account_date","report_timesheet.account.date","model_report_timesheet_account_date","base.group_hr_manager",1,1,1,1
"access_report_timesheet_invoice","report_timesheet.invoice","model_report_timesheet_invoice","base.group_hr_manager",1,1,1,1
"access_report_random_timesheet","report_random_timesheet","model_report_random_timesheet","base.group_hr_manager",1,1,1,1
"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","base.group_hr_manager",1,1,1,1
"access_report_analytic_account_close_manager","report.analytic.account.close.manager","model_report_analytic_account_close","base.group_hr_manager",1,1,1,1
"access_report_account_analytic_line_to_invoice_manager","report.account.analytic.line.to.invoice.manager","model_report_account_analytic_line_to_invoice","base.group_hr_manager",1,1,1,1
"access_account_invoice_hr_user","account.invoice.hr.user","account.model_account_invoice","base.group_hr_user",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
7 access_report_timesheet_account report_timesheet.account model_report_timesheet_account base.group_hr_manager 1 1 1 1
8 access_report_timesheet_account_date report_timesheet.account.date model_report_timesheet_account_date base.group_hr_manager 1 1 1 1
9 access_report_timesheet_invoice report_timesheet.invoice model_report_timesheet_invoice base.group_hr_manager 1 1 1 1
access_report_random_timesheet report_random_timesheet model_report_random_timesheet base.group_hr_manager 1 1 1 1
access_report_random_timesheet_lines random_timesheet_lines model_random_timesheet_lines base.group_hr_manager 1 1 1 1
10 access_report_analytic_account_close_manager report.analytic.account.close.manager model_report_analytic_account_close base.group_hr_manager 1 1 1 1
11 access_report_account_analytic_line_to_invoice_manager report.account.analytic.line.to.invoice.manager model_report_account_analytic_line_to_invoice base.group_hr_manager 1 1 1 1
12 access_account_invoice_hr_user account.invoice.hr.user account.model_account_invoice base.group_hr_user 1 1 1 1