bzr revid: fp@tinyerp.com-0c1a8f186f890dc08fe1279abe068f601a1dc765
This commit is contained in:
Fabien Pinckaers 2007-05-30 12:41:53 +00:00
parent ee2e1d2b3a
commit b16ca35ae4
5 changed files with 117 additions and 8 deletions

View File

@ -86,16 +86,15 @@
type="action"
colspan="4"/>
<action
string="My timesheet"
name="%(report_timesheet.action_timesheet_user_stat)d"
colspan="4"/>
<action
string="My work"
name="%(report_analytic_line.action_account_analytic_planning_stat_my_form)d"
colspan="4"/>
<action
string="My timesheet"
name="%(report_timesheet.action_timesheet_user_stat_my)d"
colspan="4"/>
</child2>
</hpaned>

View File

@ -786,7 +786,7 @@ class mrp_procurement(osv.osv):
ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id])
cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%d', (procurement.product_id.id,))
if not cr.fetchone()[0]:
cr.execute('update mrp_procurement set message=%s where id=%d', ('MTS and no orderpoint defined', procurement.id))
cr.execute('update mrp_procurement set message=%s where id=%d', ('MTS and no minimum orderpoint rule defined', procurement.id))
return ok
def action_produce_assign_service(self, cr, uid, ids, context={}):
@ -899,7 +899,7 @@ mrp_procurement()
#CHECKME: why the **** is this object defined here and not in stock???
class stock_warehouse_orderpoint(osv.osv):
_name = "stock.warehouse.orderpoint"
_description = "Warehouse Orderpoint"
_description = "Orderpoint minimum rule"
_columns = {
'name': fields.char('Name', size=32, required=True),
'active': fields.boolean('Active'),

View File

@ -174,7 +174,7 @@ class product_template(osv.osv):
'description_sale': fields.text('Sale Description'),
'type': fields.selection([('product','Stockable Product'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True),
'supply_method': fields.selection([('produce','Produce'),('buy','Buy')], 'Supply method', required=True),
'sale_delay': fields.float('Procurement lead time', help="This is the average time between the confirmation of the customer order and the delivery of the finnished products. It's the time you promise to your customers."),
'sale_delay': fields.float('Customer lead time', help="This is the average time between the confirmation of the customer order and the delivery of the finnished products. It's the time you promise to your customers."),
'produce_delay': fields.float('Manufacturing lead time', help="Average time to produce this product. This is only for the production order and, if it is a multi-level bill of material, it's only for the level of this product. Different delays will be summed for all levels and purchase orders."),
'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procure Method', required=True),
'rental': fields.boolean('Rentable product'),

View File

@ -87,6 +87,36 @@ class report_timesheet_account(osv.osv):
report_timesheet_account()
class report_timesheet_account_date(osv.osv):
_name = "report_timesheet.account.date"
_description = "Daily timesheet per account"
_auto = False
_columns = {
'name': fields.date('Date', readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
'account_id':fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
'quantity': fields.float('Quantity', readonly=True),
}
_order = 'name desc,account_id desc,user_id desc'
def init(self, cr):
cr.execute("""
create or replace view report_timesheet_account_date as (
select
min(id) as id,
create_date as name,
user_id,
account_id,
sum(unit_amount) as quantity
from
account_analytic_line
group by
create_date, user_id, account_id
)
""")
report_timesheet_account_date()
class report_timesheet_invoice(osv.osv):
_name = "report_timesheet.invoice"
_description = "Costs to invoice"

View File

@ -58,6 +58,19 @@
action="action_timesheet_user_stat"
id="menu_report_timesheet_user"/>
<record model="ir.actions.act_window" id="action_timesheet_user_stat_my">
<field name="name">My timesheet of the month</field>
<field name="res_model">report_timesheet.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="domain">[('name','&gt;=',time.strftime('%Y-%m-01')), ('user_id','=',uid)]</field>
</record>
<menuitem
name="Human Resources/Reporting/This Month/"
action="action_timesheet_user_stat_my"
id="menu_report_timesheet_user_my"/>
<record model="ir.actions.act_window" id="action_timesheet_user_stat_all">
<field name="res_model">report_timesheet.user</field>
<field name="view_type">form</field>
@ -136,6 +149,73 @@
action="action_timesheet_invoice_stat_my"
id="menu_report_timesheet_invoice_my"/>
#
# Statistics report on daily timesheets per account
#
<record model="ir.ui.view" id="view_timesheet_account_date_tree">
<field name="name">report_timesheet.account.date.tree</field>
<field name="model">report_timesheet.account.date</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Daily timesheet per account">
<field name="name"/>
<field name="account_id"/>
<field name="user_id"/>
<field name="quantity"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_timesheet_account_date_graph">
<field name="name">report_timesheet.account.date.graph</field>
<field name="model">report_timesheet.account.date</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Daily timesheet per account">
<field name="account_id" group="True"/>
<field name="quantity" operator="+"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_timesheet_account_date_form">
<field name="name">report_timesheet.timesheet.account.date.form</field>
<field name="model">report_timesheet.account.date</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Daily timesheet by account">
<field name="name" select="1"/>
<field name="account_id" select="1"/>
<field name="user_id" select="1"/>
<field name="quantity"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_timesheet_account_date_stat_all">
<field name="res_model">report_timesheet.account.date</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
</record>
<menuitem
name="Human Resources/Reporting/All Months/Daily timesheet by account"
action="action_timesheet_account_date_stat_all"
id="menu_report_timesheet_account_date_all"/>
<record model="ir.actions.act_window" id="action_timesheet_account_date_stat_my">
<field name="name">My daily timesheets by account</field>
<field name="res_model">report_timesheet.account.date</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="domain">[('user_id','=',uid)]</field>
</record>
<menuitem
name="Human Resources/Reporting/This Month/My daily timesheets by account"
action="action_timesheet_account_date_stat_my"
id="menu_report_timesheet_account_date_my"/>
#
# Statistics report on timesheets per account
#