[MERGE] Merge Team3 work from addons3 branch

bzr revid: mra@mra-laptop-20100702144503-0yynbrlkxn0v76lt
This commit is contained in:
Mustufa Rangwala
2010-07-02 20:15:03 +05:30
100 changed files with 877 additions and 864 deletions
+1 -1
View File
@@ -21,7 +21,6 @@
{
"name" : "Accounting and Financial Management",
"version" : "1.1",
"depends" : ["product", "analytic", "process","board"],
"author" : "Tiny",
"category": 'Generic Modules/Accounting',
"description": """Financial and accounting module that covers:
@@ -42,6 +41,7 @@ The processes like maintaining of general ledger is done through the defined fin
grouping is maintained through journal) for a particular financial year and for preparation of vouchers there is a
module named account_vouchers
""",
"depends" : ["product", "analytic", "process","board"],
'website': 'http://www.openerp.com',
'init_xml': [],
'update_xml': [
-2
View File
@@ -207,7 +207,6 @@
<field name="date" select="1"/>
<field name="user_id" widget="selection"/>
</group>
<separator orientation="vertical"/>
<newline/>
<group string="Group By..." expand="0">
<filter string="General Account" context="{'group_by':'general_account_id'}"/>
@@ -342,7 +341,6 @@
<field name="res_model">account.analytic.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('journal_id','=',active_id)]</field>
</record>
<menuitem action="action_account_analytic_journal_open_form" id="account_analytic_journal_entries" parent="menu_finance_entries"/>
<!-- <record id="action_account_analytic_journal_open_form" model="ir.actions.act_window">
+20 -22
View File
@@ -21,32 +21,30 @@
{
'name': 'report_account_analytic',
'version': '1.0',
'category': 'Generic Modules/Accounting',
'name' : 'report_account_analytic',
'version' : '1.1',
'category' : 'Generic Modules/Accounting',
'description': """
This module is for modifying account analytic view to show
important data to project manager of services companies.
Adds menu to show relevant information to each manager..
This module is for modifying account analytic view to show
important data to project manager of services companies.
Adds menu to show relevant information to each manager..
You can also view the report of account analytic summary
user-wise as well as month wise.
You can also view the report of account analytic summary
user-wise as well as month wise.
""",
"version" : "1.1",
"author" : "Camptocamp",
"category" : "Generic Modules/Accounting",
"module": "",
"website": "http://www.camptocamp.com/",
"depends" : ["account","hr_timesheet","hr_timesheet_invoice","project"],
"init_xml" : [],
"update_xml" : [
"security/ir.model.access.csv",
"account_analytic_analysis_view.xml",
"account_analytic_analysis_menu.xml",
],
'demo_xml': [],
"author" : "Camptocamp",
"website" : "http://www.camptocamp.com/",
"depends" : ["hr_timesheet_invoice"],
"init_xml" : [],
"update_xml": [
"security/ir.model.access.csv",
"account_analytic_analysis_view.xml",
"account_analytic_analysis_menu.xml",
],
'demo_xml' : [],
'installable': True,
'active': False,
'active' : False,
'certificate': '0042927202589',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -19,18 +19,16 @@
#
##############################################################################
import operator
from osv import osv, fields
from osv.orm import intersect
import tools.sql
from tools.translate import _
class account_analytic_account(osv.osv):
_name = "account.analytic.account"
_inherit = "account.analytic.account"
def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context={}):
def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -46,7 +44,7 @@ class account_analytic_account(osv.osv):
return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context)
def _ca_to_invoice_calc(self, cr, uid, ids, name, arg, context={}):
def _ca_to_invoice_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
res2 = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
@@ -92,7 +90,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2)
return res
def _hours_qtt_non_invoiced_calc (self, cr, uid, ids, name, arg, context={}):
def _hours_qtt_non_invoiced_calc (self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -117,7 +115,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _hours_quantity_calc(self, cr, uid, ids, name, arg, context={}):
def _hours_quantity_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -141,7 +139,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _total_cost_calc(self, cr, uid, ids, name, arg, context={}):
def _total_cost_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -158,7 +156,7 @@ class account_analytic_account(osv.osv):
return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context)
# TODO Take care of pricelist and purchase !
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context={}):
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
res2 = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
@@ -202,7 +200,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2)
return res
def _last_worked_date_calc (self, cr, uid, ids, name, arg, context={}):
def _last_worked_date_calc (self, cr, uid, ids, name, arg, context = None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -223,7 +221,7 @@ class account_analytic_account(osv.osv):
res[id] = res.get(id, '')
return res
def _last_invoice_date_calc (self, cr, uid, ids, name, arg, context={}):
def _last_invoice_date_calc (self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -247,7 +245,7 @@ class account_analytic_account(osv.osv):
res[id] = res.get(id, '')
return res
def _last_worked_invoiced_date_calc (self, cr, uid, ids, name, arg, context={}):
def _last_worked_invoiced_date_calc (self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -268,7 +266,7 @@ class account_analytic_account(osv.osv):
res[id] = res.get(id, '')
return res
def _remaining_hours_calc(self, cr, uid, ids, name, arg, context={}):
def _remaining_hours_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
if account.quantity_max != 0:
@@ -279,7 +277,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _hours_qtt_invoiced_calc(self, cr, uid, ids, name, arg, context={}):
def _hours_qtt_invoiced_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
res[account.id] = account.hours_quantity - account.hours_qtt_non_invoiced
@@ -289,7 +287,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _revenue_per_hour_calc(self, cr, uid, ids, name, arg, context={}):
def _revenue_per_hour_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
if account.hours_qtt_invoiced == 0:
@@ -300,7 +298,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _real_margin_rate_calc(self, cr, uid, ids, name, arg, context={}):
def _real_margin_rate_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
if account.ca_invoiced == 0:
@@ -313,7 +311,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _remaining_ca_calc(self, cr, uid, ids, name, arg, context={}):
def _remaining_ca_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
if account.amount_max != 0:
@@ -324,7 +322,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _real_margin_calc(self, cr, uid, ids, name, arg, context={}):
def _real_margin_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
res[account.id] = account.ca_invoiced + account.total_cost
@@ -332,7 +330,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _theorical_margin_calc(self, cr, uid, ids, name, arg, context={}):
def _theorical_margin_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
res[account.id] = account.ca_theorical + account.total_cost
@@ -426,6 +424,7 @@ class account_analytic_account_summary_user(osv.osv):
string='Total Time'),
'user' : fields.many2one('res.users', 'User'),
}
def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'account_analytic_analysis_summary_user')
cr.execute('CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS (' \
@@ -731,6 +730,5 @@ class account_analytic_account_summary_month(osv.osv):
account_analytic_account_summary_month()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,7 +1,6 @@
<openerp>
<data>
<menuitem icon="terp-project" id="base.menu_main_pm" name="Project" sequence="10"/>
<!-- <menuitem id="next_id_71" name="Financial Project Management" parent="base.menu_main_pm" groups="account.group_account_invoice" sequence="20"/>-->
<menuitem id="menu_invoicing" name="Billing" parent="base.menu_main_pm" sequence="4"/>
<record id="action_hr_tree_invoiced_all" model="ir.actions.act_window">
@@ -14,17 +13,6 @@
</record>
<menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="menu_invoicing"/>
<record id="action_account_analytic_all" model="ir.actions.act_window">
<field name="name">All Analytic Accounts</field>
<field name="res_model">account.analytic.account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_id" ref="account.view_account_analytic_account_list"/>
<field name="search_view_id" ref="account.view_account_analytic_account_search"/>
<field name="domain">[]</field>
</record>
<!-- <menuitem name="Analytic Accounts" action="action_account_analytic_all" id="menu_action_account_analytic_all" parent="next_id_71"/>-->
<record id="action_account_analytic_managed_overpassed" model="ir.actions.act_window">
<field name="name">Overpassed Accounts</field>
<field name="res_model">account.analytic.account</field>
@@ -24,7 +24,6 @@
<field name="ca_invoiced"/>
<field name="ca_theorical"/>
<newline/>
<!-- <field name="old"/> -->
<field name="hours_quantity"/>
<field name="hours_qtt_invoiced"/>
<field name="remaining_hours"/>
@@ -38,13 +37,12 @@
<separator colspan="4" string="Key dates"/>
<field name="last_invoice_date"/>
<field name="last_worked_invoiced_date"/>
<field name="last_worked_date"/>
<separator colspan="4" string="To be invoiced"/>
<field name="hours_qtt_non_invoiced"/>
<field name="ca_to_invoice"/>
</page>
<page string="Stats by month">
<field colspan="4" name="month_ids" nolabel="1">
@@ -81,20 +79,18 @@
</field>
</field>
</record>
<record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
<field name="name">account.analytic.account.tree</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="account.view_account_analytic_account_list"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="date" position="before">
<field name="last_invoice_date"/>
<field name="ca_to_invoice"/>
</field>
</field>
</record>
<record id="view_account_analytic_simplified" model="ir.ui.view">
@@ -110,7 +106,6 @@
<field name="remaining_hours"/>
<field name="ca_to_invoice"/>
<field name="last_invoice_date"/>
</tree>
</field>
</record>
@@ -20,4 +20,5 @@
##############################################################################
import account_analytic_default
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -19,11 +19,10 @@
#
##############################################################################
{
'name': 'Account Analytic Default',
'version': '1.0',
'category': 'Generic Modules/Accounting',
'name' : 'Account Analytic Default',
'version' : '1.0',
'category' : 'Generic Modules/Accounting',
'description': """
Allows to automatically select analytic accounts based on criterions:
* Product
@@ -32,14 +31,15 @@ Allows to automatically select analytic accounts based on criterions:
* Company
* Date
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['account', 'sale'],
'init_xml': [],
'author' : 'Tiny',
'website' : 'http://www.openerp.com',
'depends' : ['account', 'sale'],
'init_xml' : [],
'update_xml': ['security/ir.model.access.csv', 'account_analytic_default_view.xml'],
'demo_xml': [],
'demo_xml' : [],
'installable': True,
'active': False,
'certificate': '0074229833581',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -19,10 +19,10 @@
#
##############################################################################
from osv import fields,osv
from osv import orm
import time
from osv import fields,osv
class account_analytic_default(osv.osv):
_name = 'account.analytic.default'
_description = 'Analytic Distribution'
@@ -38,7 +38,7 @@ class account_analytic_default(osv.osv):
'date_start': fields.date('Start Date'),
'date_stop': fields.date('End Date'),
}
def account_get(self, cr, uid, product_id=None, partner_id=None, user_id=None, date=None, context={}):
def account_get(self, cr, uid, product_id=None, partner_id=None, user_id=None, date=None, context=None):
domain = []
if product_id:
domain += ['|',('product_id','=',product_id)]
@@ -71,7 +71,7 @@ class account_invoice_line(osv.osv):
_inherit = 'account.invoice.line'
_description = 'Invoice Line'
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}):
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, currency_id=currency_id, context=context)
rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context)
if rec:
@@ -101,7 +101,7 @@ class sale_order_line(osv.osv):
_inherit = 'sale.order.line'
# Method overridden to set the analytic account by default on criterion match
def invoice_line_create(self, cr, uid, ids, context={}):
def invoice_line_create(self, cr, uid, ids, context=None):
create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context)
if not ids:
return create_ids
@@ -117,6 +117,4 @@ class sale_order_line(osv.osv):
sale_order_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -52,6 +52,7 @@
</search>
</field>
</record>
<record id="action_analytic_default_form" model="ir.actions.act_window">
<field name="name">Analytic Defaults</field>
<field name="res_model">account.analytic.default</field>
@@ -59,10 +60,6 @@
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_account_analytic_default_form_search"/>
</record>
<!-- <menuitem-->
<!-- action="action_analytic_default_form"-->
<!-- id="menu_analytic_defaul_form"-->
<!-- parent="account.menu_analytic_accounting"/>-->
<act_window
name="Entries"
@@ -22,5 +22,6 @@
import account_analytic_plans
import wizard
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+10 -9
View File
@@ -21,9 +21,9 @@
{
'name': 'Multiple-plans management in Analytic Accounting',
'version': '1.0',
'category': 'Generic Modules/Accounting',
'name' : 'Multiple-plans management in Analytic Accounting',
'version' : '1.0',
'category' : 'Generic Modules/Accounting',
'description': """This module allows to use several analytic plans, according to the general journal,
so that multiple analytic lines are created when the invoice or the entries
are confirmed.
@@ -54,10 +54,10 @@ for one account entry.
The analytic plan validates the minimum and maximum percentage at the time of creation
of distribution models.
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['account', 'account_analytic_default'],
'init_xml': [],
'author' : 'Tiny',
'website' : 'http://www.openerp.com',
'depends' : ['account', 'account_analytic_default'],
'init_xml' : [],
'update_xml': [
'security/ir.model.access.csv',
'account_analytic_plans_view.xml',
@@ -65,9 +65,10 @@ of distribution models.
'wizard/analytic_plan_create_model_view.xml',
'wizard/account_crossovered_analytic_view.xml'
],
'demo_xml': [],
'demo_xml' : [],
'installable': True,
'active': False,
'active' : False,
'certificate': '0036417675373',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -19,15 +19,9 @@
#
##############################################################################
from lxml import etree
from mx import DateTime
from mx.DateTime import now
import time
import netsvc
from osv import fields, osv,orm
import ir
from osv import fields, osv
import tools
from tools.translate import _
@@ -64,6 +58,7 @@ account_analytic_plan()
class account_analytic_plan_line(osv.osv):
_name = "account.analytic.plan.line"
_description = "Analytic Plan Line"
_order = "sequence, id"
_columns = {
'plan_id':fields.many2one('account.analytic.plan','Analytic Plan'),
'name': fields.char('Plan Name', size=64, required=True, select=True),
@@ -73,16 +68,15 @@ class account_analytic_plan_line(osv.osv):
'max_required': fields.float('Maximum Allowed (%)'),
}
_defaults = {
'min_required': lambda *args: 100.0,
'max_required': lambda *args: 100.0,
'min_required': 100.0,
'max_required': 100.0,
}
_order = "sequence,id"
account_analytic_plan_line()
class account_analytic_plan_instance(osv.osv):
_name='account.analytic.plan.instance'
_name = 'account.analytic.plan.instance'
_description = 'Analytic Plan Instance'
_columns={
_columns = {
'name':fields.char('Analytic Distribution', size=64),
'code':fields.char('Distribution Code', size=16),
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal' ),
@@ -116,7 +110,9 @@ class account_analytic_plan_instance(osv.osv):
'account4_ids':False, 'account5_ids':False, 'account6_ids':False})
return super(account_analytic_plan_instance, self).copy(cr, uid, id, default, context)
def _default_journal(self, cr, uid, context={}):
def _default_journal(self, cr, uid, context=None):
if not context:
context = {}
if context.has_key('journal_id') and context['journal_id']:
journal = self.pool.get('account.journal').browse(cr, uid, context['journal_id'])
if journal.analytic_journal_id:
@@ -124,10 +120,10 @@ class account_analytic_plan_instance(osv.osv):
return False
_defaults = {
'plan_id': lambda *args: False,
'plan_id': False,
'journal_id': _default_journal,
}
def name_get(self, cr, uid, ids, context={}):
def name_get(self, cr, uid, ids, context=None):
res = []
for inst in self.browse(cr, uid, ids, context):
name = inst.name or '/'
@@ -207,7 +203,7 @@ class account_analytic_plan_instance(osv.osv):
return super(account_analytic_plan_instance, self).create(cr, uid, vals, context)
def write(self, cr, uid, ids, vals, context={}, check=True, update_check=True):
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
this = self.browse(cr, uid, ids[0])
if this.plan_id and not vals.has_key('plan_id'):
#this instance is a model, so we have to create a new plan instance instead of modifying it
@@ -237,9 +233,9 @@ class account_analytic_plan_instance_line(osv.osv):
'rate':fields.float('Rate (%)', required=True),
}
_defaults = {
'rate': lambda *args: 100.0
'rate': 100.0
}
def name_get(self, cr, uid, ids, context={}):
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
reads = self.read(cr, uid, ids, ['analytic_account_id'], context)
@@ -297,7 +293,7 @@ class account_move_line(osv.osv):
del(data['analytics_id'])
return data
def create_analytic_lines(self, cr, uid, ids, context={}):
def create_analytic_lines(self, cr, uid, ids, context=None):
super(account_move_line, self).create_analytic_lines(cr, uid, ids, context)
analytic_line_obj = self.pool.get('account.analytic.line')
for line in self.browse(cr, uid, ids, context):
@@ -333,7 +329,7 @@ class account_invoice(osv.osv):
_name = "account.invoice"
_inherit="account.invoice"
def line_get_convert(self, cr, uid, x, part, date, context={}):
def line_get_convert(self, cr, uid, x, part, date, context=None):
res=super(account_invoice,self).line_get_convert(cr, uid, x, part, date, context)
res['analytics_id']=x.get('analytics_id',False)
return res
@@ -399,7 +395,7 @@ class sale_order_line(osv.osv):
_inherit = 'sale.order.line'
# Method overridden to set the analytic account by default on criterion match
def invoice_line_create(self, cr, uid, ids, context={}):
def invoice_line_create(self, cr, uid, ids, context=None):
create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context)
if ids:
sale_line_obj = self.browse(cr, uid, ids[0], context)
@@ -11,13 +11,6 @@
auto="False"
menu="False"/>
<!--<wizard
id="account_analytic_account_inverted_balance_report"
string="Crossovered Analytic"
model="account.analytic.account"
name="wizard.crossovered.analytic"
keyword="client_print_multi"/>-->
</data>
</openerp>
@@ -89,7 +89,11 @@
<field name="code" select="1"/>
<field name="plan_id" required="True"/>
<field name="journal_id"/>
<field name="account_ids" string="Analytic Distribution" colspan="4">
<field name="account_ids" nolabel="1" colspan="4">
<form string="Analytic Distribution">
<field name="rate"/>
<field name="analytic_account_id"/>
</form>
<tree string="Analytic Distribution" editable="bottom">
<field name="rate"/>
<field name="analytic_account_id"/>
@@ -124,16 +128,11 @@
<act_window name="Distribution Models"
domain="[('plan_id', '=', active_id),('plan_id','&lt;&gt;',False)]"
context="{'plan_id': active_id}"
context="{'plan_id':active_id}"
res_model="account.analytic.plan.instance"
src_model="account.analytic.plan"
id="account_analytic_instance_model_open"/>
<!-- <menuitem-->
<!-- name="Analytic Distribution's models" parent="account.account_def_analytic_journal"-->
<!-- id="menu_account_analytic_plan_instance_action"-->
<!-- action="account_analytic_plan_instance_action"/>-->
<record model="ir.ui.view" id="account_analytic_plan_instance_line_form">
<field name="name">account.analytic.plan.instance.line.form</field>
<field name="model">account.analytic.plan.instance.line</field>
@@ -234,7 +233,7 @@
</field>
</record>
<!-- add property field on product -->
<!-- add property field on default analytic account-->
<record model="ir.ui.view" id="view_default_inherit_form">
<field name="name">account.analytic.default.form.plans</field>
@@ -20,5 +20,6 @@
##############################################################################
import crossovered_analytic
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -19,20 +19,20 @@
#
##############################################################################
import pooler
import time
from report import report_sxw
class crossovered_analytic(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(crossovered_analytic, self).__init__(cr, uid, name, context=context)
super(crossovered_analytic, self).__init__(cr, uid, name, context = context)
self.localcontext.update( {
'time': time,
'lines': self._lines,
'ref_lines' : self._ref_lines,
'find_children':self.find_children,
})
self.base_amount=0.00
self.base_amount = 0.00
def find_children(self,ref_ids):
to_return_ids = []
@@ -153,23 +153,23 @@ class crossovered_analytic(report_sxw.rml_parse):
if not form['empty_line']:
res.append(result)
else:
result={}
res=[]
result['id']=acc_id
result = {}
res = []
result['id'] = acc_id
data_account = acc_pool.browse(self.cr,self.uid,acc_id)
result['acc_name']=data_account.name
result['acc_name'] = data_account.name
result['code'] = data_account.code
result['amt']=result['qty']=result['perc']=0.00
result['amt'] = result['qty'] = result['perc'] = 0.00
if not form['empty_line']:
res.append(result)
for item in res:
obj_acc=acc_pool.name_get(self.cr,self.uid,[item['id']])
item['acc_name']=obj_acc[0][1]
obj_acc = acc_pool.name_get(self.cr,self.uid,[item['id']])
item['acc_name'] = obj_acc[0][1]
final.append(item)
return final
report_sxw.report_sxw('report.account.analytic.account.crossovered.analytic', 'account.analytic.account', 'addons/account_analytic_plans/report/crossovered_analytic.rml',parser=crossovered_analytic, header=False)
report_sxw.report_sxw('report.account.analytic.account.crossovered.analytic', 'account.analytic.account', 'addons/account_analytic_plans/report/crossovered_analytic.rml',parser = crossovered_analytic, header = False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -21,5 +21,6 @@
import analytic_plan_create_model
import account_crossovered_analytic
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -8,17 +8,19 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Crossovered Analytic">
<group col="4" colspan="6">
<field name="date1"/>
<field name="date2"/>
<field name="ref" colspan="4"/>
<field name="journal_ids" colspan="4"/>
<field name="empty_line"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
<button name="print_report" string="Print" colspan="1" type="object" icon="gtk-print"/>
<group height="280" width="300">
<group col="4" colspan="6">
<field name="date1"/>
<field name="date2"/>
<field name="ref" colspan="4"/>
<field name="journal_ids" colspan="4"/>
<field name="empty_line"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
<button name="print_report" string="Print" colspan="1" type="object" icon="gtk-print"/>
</group>
</group>
</form>
</field>
+6 -6
View File
@@ -21,12 +21,12 @@
{
"name" : "Project Management",
"name": "Project Management",
"version": "1.1",
"author" : "Tiny",
"website" : "http://www.openerp.com",
"category" : "Generic Modules/Projects & Services",
"depends" : ["product", "analytic", "process", "mail_gateway","board"],
"author": "Tiny",
"website": "http://www.openerp.com",
"category": "Generic Modules/Projects & Services",
"depends": ["product", "analytic", "process", "mail_gateway","board"],
"description": """Project management module that track multi-level projects, tasks,
work done on tasks, eso. It is able to render planning, order tasks, eso.
Dashboard for project members that includes:
@@ -35,7 +35,7 @@ work done on tasks, eso. It is able to render planning, order tasks, eso.
* Members list of project
* Issues
""",
"init_xml" : [],
"init_xml": [],
"update_xml": [
"security/project_security.xml",
"wizard/project_task_delegate_view.xml",
@@ -21,8 +21,6 @@
<!-- <field name="domain">[('user_id','in',department_users_get())]</field>-->
<!-- </record>-->
<record id="board_project_manager_form" model="ir.ui.view">
<field name="name">board.project.manager.form</field>
<field name="model">board.board</field>
+1 -1
View File
@@ -28,9 +28,9 @@ class res_company(osv.osv):
help='This will set the unit of measure used in projects and tasks.\n' \
"If you use the timesheet linked to projects (project_timesheet module), don't " \
"forget to setup the right unit of measure in your employees.",
),
}
res_company()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+11 -9
View File
@@ -26,29 +26,29 @@ class project_installer(osv.osv_memory):
_columns = {
# Project Management
'project_long_term':fields.boolean('Long Term Planning',
'project_long_term': fields.boolean('Long Term Planning',
help="Enables long-term projects tracking, including "
"multiple-phase projects and resource allocation handling."),
'project_wiki':fields.boolean('Specifications in a Wiki',
'project_wiki': fields.boolean('Specifications in a Wiki',
help=""),
'hr_timesheet_sheet':fields.boolean('Timesheets',
'hr_timesheet_sheet': fields.boolean('Timesheets',
help="Tracks and helps employees encode and validate timesheets "
"and attendance."),
'hr_timesheet_invoice':fields.boolean('Invoice Based on Hours',
'hr_timesheet_invoice': fields.boolean('Invoice Based on Hours',
help="Helps generate invoice based on based on human resources "
"costs and general expenses."),
'account_budget':fields.boolean('Budgets',
'account_budget': fields.boolean('Budgets',
help="Helps accountants manage analytic and crossover budgets."),
'project_messages':fields.boolean('Project Messages',
'project_messages': fields.boolean('Project Messages',
help="Lets employees send messages to other members of the "
"projects they're working on."),
'project_crm':fields.boolean('Issues Tracker',
'project_crm': fields.boolean('Issues Tracker',
help="Automatically synchronizes project tasks and crm cases."),
# Methodologies
'scrum':fields.boolean('SCRUM',
'scrum': fields.boolean('SCRUM',
help="Implements and tracks the concepts and task types defined "
"in the SCRUM methodology."),
'project_gtd':fields.boolean('Getting Things Done',
'project_gtd': fields.boolean('Getting Things Done',
help="Embeds the Getting Things Done concepts into OpenERP's "
"project management."),
}
@@ -56,3 +56,5 @@ class project_installer(osv.osv_memory):
'project_crm': True,
}
project_installer()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+84 -53
View File
@@ -19,7 +19,6 @@
#
##############################################################################
from lxml import etree
import mx.DateTime
import datetime
import time
@@ -37,7 +36,7 @@ class project_task_type(osv.osv):
_order = 'sequence'
_defaults = {
'sequence': lambda *args: 1
'sequence': 1
}
project_task_type()
@@ -61,7 +60,9 @@ class project(osv.osv):
return super(project, self).search(cr, user, args, offset=offset, limit=limit, order=order,
context=context, count=count)
def _complete_name(self, cr, uid, ids, name, args, context={}):
def _complete_name(self, cr, uid, ids, name, args, context=None):
if context is None:
context = {}
res = {}
for m in self.browse(cr, uid, ids, context=context):
res[m.id] = (m.parent_id and (m.parent_id.name + '/') or '') + m.name
@@ -71,7 +72,9 @@ class project(osv.osv):
return super(project, self).check_recursion(cursor, user, ids,
parent=parent)
def onchange_partner_id(self, cr, uid, ids, part, context={}):
def onchange_partner_id(self, cr, uid, ids, part=False, context=None):
if context is None:
context = {}
partner_obj = self.pool.get('res.partner')
if not part:
return {'value':{'contact_id': False, 'pricelist_id': False}}
@@ -80,7 +83,9 @@ class project(osv.osv):
pricelist_id = pricelist.get('property_product_pricelist', False) and pricelist.get('property_product_pricelist')[0] or False
return {'value':{'contact_id': addr['contact'], 'pricelist_id': pricelist_id}}
def _progress_rate(self, cr, uid, ids, names, arg, context={}):
def _progress_rate(self, cr, uid, ids, names, arg, context=None):
if context is None:
context = {}
res = {}.fromkeys(ids, 0.0)
progress = {}
if not ids:
@@ -118,11 +123,12 @@ class project(osv.osv):
if proj.tasks:
raise osv.except_osv(_('Operation Not Permitted !'), _('You can not delete a project with tasks. I suggest you to deactivate it.'))
return super(project, self).unlink(cr, uid, ids, *args, **kwargs)
_columns = {
'complete_name': fields.function(_complete_name, method=True, string="Project Name", type='char', size=250),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the project without removing it."),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of Projects."),
'category_id': fields.many2one('account.analytic.account','Analytic Account', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc."),
'category_id': fields.many2one('account.analytic.account', 'Analytic Account', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc."),
'priority': fields.integer('Sequence', help="Gives the sequence order when displaying a list of task"),
'warn_manager': fields.boolean('Warn Manager', help="If you check this field, the project manager will receive a request each time a task is completed by his team."),
'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members', help="Project's member. Not used in any computation, just for information purpose."),
@@ -135,17 +141,17 @@ class project(osv.osv):
'warn_header': fields.text('Mail Header', help="Header added at the beginning of the email for the warning message sent to the customer when a task is closed."),
'warn_footer': fields.text('Mail Footer', help="Footer added at the beginning of the email for the warning message sent to the customer when a task is closed."),
'type_ids': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Tasks Stages'),
'project_escalation_id' : fields.many2one('project.project','Project Escalation', help='If any issue is escalated from the current Project, it will be listed under the project selected here.'),
'project_escalation_id': fields.many2one('project.project','Project Escalation', help='If any issue is escalated from the current Project, it will be listed under the project selected here.'),
}
_order = "sequence"
_defaults = {
'active': lambda *a: True,
'priority': lambda *a: 1,
'sequence': lambda *a: 10,
'warn_manager': lambda *a: True,
'active': True,
'priority': 1,
'sequence': 10,
'warn_manager': True,
}
def _check_dates(self, cr, uid, ids):
leave = self.read(cr, uid, ids[0],['date_start','date'])
leave = self.read(cr, uid, ids[0], ['date_start', 'date'])
if leave['date_start'] and leave['date']:
if leave['date_start'] > leave['date']:
return False
@@ -162,31 +168,33 @@ class project(osv.osv):
(_check_dates, 'Error! project start-date must be lower then project end-date.', ['date_start', 'date']),
(_check_escalation, 'Error! You cannot assign escalation to the same project!', ['project_escalation_id'])
]
def set_template(self, cr, uid, ids, context={}):
def set_template(self, cr, uid, ids, context=None):
res = self.setActive(cr, uid, ids, value=False, context=context)
return res
def set_done(self, cr, uid, ids, context={}):
def set_done(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'close'}, context=context)
return True
def set_cancel(self, cr, uid, ids, context={}):
def set_cancel(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'cancelled'}, context=context)
return True
def set_pending(self, cr, uid, ids, context={}):
def set_pending(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'pending'}, context=context)
return True
def set_open(self, cr, uid, ids, context={}):
def set_open(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'open'}, context=context)
return True
def reset_project(self, cr, uid, ids, context={}):
res = self.setActive(cr, uid, ids,value=True, context=context)
def reset_project(self, cr, uid, ids, context=None):
res = self.setActive(cr, uid, ids, value=True, context=context)
return res
def copy(self, cr, uid, id, default={}, context={}):
def copy(self, cr, uid, id, default={}, context=None):
if context is None:
context = {}
proj = self.browse(cr, uid, id, context=context)
default = default or {}
context['active_test'] = False
@@ -199,13 +207,15 @@ class project(osv.osv):
cr.execute('update project_task set active=True where project_id IN %s',(tuple(ids),))
return res
def duplicate_template(self, cr, uid, ids, context={}):
def duplicate_template(self, cr, uid, ids, context=None):
if context is None:
context = {}
project_obj = self.pool.get('project.project')
data_obj = self.pool.get('ir.model.data')
task_obj = self.pool.get('project.task')
result = []
for proj in self.browse(cr, uid, ids, context=context):
parent_id = context.get('parent_id',False) # check me where to pass context for parent id ??
parent_id = context.get('parent_id', False) # check me where to pass context for parent id ??
context.update({'analytic_project_copy': True})
new_id = project_obj.copy(cr, uid, proj.id, default = {
'name': proj.name +_(' (copy)'),
@@ -233,7 +243,7 @@ class project(osv.osv):
'view_mode': 'form,tree',
'res_model': 'project.project',
'view_id': False,
'res_id' : res_id,
'res_id': res_id,
'views': [(form_view['res_id'],'form'),(tree_view['res_id'],'tree')],
'type': 'ir.actions.act_window',
'search_view_id': search_view['res_id'],
@@ -242,9 +252,13 @@ class project(osv.osv):
# return result
# set active value for a project, its sub projects and its tasks
def setActive(self, cr, uid, ids, value=True, context={}):
def setActive(self, cr, uid, ids, value=True, context=None):
if context is None:
context = {}
task_obj = self.pool.get('project.task')
for proj in self.browse(cr, uid, ids, context):
for proj in self.browse(cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, [proj.id], {'state': value and 'open' or 'template'}, context)
cr.execute('select id from project_task where project_id=%s', (proj.id,))
tasks_id = [x[0] for x in cr.fetchall()]
@@ -252,7 +266,9 @@ class project(osv.osv):
task_obj.write(cr, uid, tasks_id, {'active': value}, context=context)
child_ids = self.search(cr, uid, [('parent_id','=', proj.id)])
if child_ids:
self.setActive(cr, uid, child_ids, value, context)
self.setActive(cr, uid, child_ids, value, context=None)
if context is None:
context = {}
return True
project()
@@ -262,13 +278,17 @@ class task(osv.osv):
_log_create = True
_date_name = "date_start"
def _str_get(self, task, level=0, border='***', context={}):
def _str_get(self, task, level=0, border='***', context=None):
if context is None:
context = {}
return border+' '+(task.user_id and task.user_id.name.upper() or '')+(level and (': L'+str(level)) or '')+(' - %.1fh / %.1fh'%(task.effective_hours or 0.0,task.planned_hours))+' '+border+'\n'+ \
border[0]+' '+(task.name or '')+'\n'+ \
(task.description or '')+'\n\n'
# Compute: effective_hours, total_hours, progress
def _hours_get(self, cr, uid, ids, field_names, args, context=None):
if context is None:
context = {}
res = {}
cr.execute("SELECT task_id, COALESCE(SUM(hours),0) FROM project_task_work WHERE task_id IN %s GROUP BY task_id",(tuple(ids),))
hours = dict(cr.fetchall())
@@ -277,17 +297,17 @@ class task(osv.osv):
res[task.id]['progress'] = 0.0
if (task.remaining_hours + hours.get(task.id, 0.0)):
if task.state != 'done':
res[task.id]['progress'] = round(min(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 99.99),2)
res[task.id]['progress'] = round(min(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 99.99), 2)
if task.state in ('done','cancel'):
if task.state in ('done', 'cancel'):
res[task.id]['progress'] = 100.0
res[task.id]['delay_hours'] = res[task.id]['total_hours'] - task.planned_hours
return res
def onchange_planned(self, cr, uid, ids, planned = 0.0, effective = 0.0):
return {'value':{'remaining_hours' : planned - effective}}
return {'value':{'remaining_hours': planned - effective}}
def _default_project(self, cr, uid, context={}):
def _default_project(self, cr, uid, context=None):
if 'project_id' in context and context['project_id']:
return int(context['project_id'])
return False
@@ -296,17 +316,21 @@ class task(osv.osv):
# ('remaining_hours', 'CHECK (remaining_hours>=0)', 'Please increase and review remaining hours ! It can not be smaller than 0.'),
#]
def copy_data(self, cr, uid, id, default={},context={}):
def copy_data(self, cr, uid, id, default={}, context=None):
if context is None:
context = {}
default = default or {}
default['work_ids'] = []
return super(task, self).copy_data(cr, uid, id, default, context)
def _check_dates(self, cr, uid, ids, context={}):
task = self.read(cr, uid, ids[0],['date_start', 'date_end'])
if task['date_start'] and task['date_end']:
def _check_dates(self, cr, uid, ids, context=None):
if context is None:
context = {}
task = self.read(cr, uid, ids[0], ['date_start', 'date_end'])
if task['date_start'] and task['date_end']:
if task['date_start'] > task['date_end']:
return False
return True
return True
_columns = {
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the task without removing it."),
@@ -334,19 +358,19 @@ class task(osv.osv):
'delay_hours': fields.function(_hours_get, method=True, string='Delay Hours', multi='hours', store=True, help="Computed as difference of the time estimated by the project manager and the real time to close the task."),
'user_id': fields.many2one('res.users', 'Assigned to'),
'delegated_user_id': fields.related('child_ids','user_id',type='many2one', relation='res.users', string='Delegated To'),
'delegated_user_id': fields.related('child_ids', 'user_id', type='many2one', relation='res.users', string='Delegated To'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'work_ids': fields.one2many('project.task.work', 'task_id', 'Work done'),
'manager_id': fields.related('project_id','category_id','user_id', type='many2one', relation='res.users', string='Project Manager'),
'manager_id': fields.related('project_id', 'category_id', 'user_id', type='many2one', relation='res.users', string='Project Manager'),
'company_id': fields.many2one('res.company', 'Company'),
}
_defaults = {
'state': lambda *a: 'draft',
'priority': lambda *a: '2',
'progress': lambda *a: 0,
'sequence': lambda *a: 10,
'active': lambda *a: True,
'date_start': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'state': 'draft',
'priority': '2',
'progress': 0,
'sequence': 10,
'active': True,
'date_start': time.strftime('%Y-%m-%d %H:%M:%S'),
'project_id': _default_project,
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'project.task', context=c)
}
@@ -360,6 +384,8 @@ class task(osv.osv):
#
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
users_obj = self.pool.get('res.users')
if context is None:
context = {}
obj_tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
tm = obj_tm and obj_tm.name or 'Hours'
@@ -519,11 +545,11 @@ class project_work(osv.osv):
'task_id': fields.many2one('project.task', 'Task', ondelete='cascade', required=True),
'hours': fields.float('Time Spent'),
'user_id': fields.many2one('res.users', 'Done by', required=True),
'company_id': fields.related('task_id','company_id',type='many2one',relation='res.company',string='Company',store=True)
'company_id': fields.related('task_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True)
}
_defaults = {
'user_id': lambda obj, cr, uid, context: uid,
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S')
'date': time.strftime('%Y-%m-%d %H:%M:%S')
}
_order = "date desc"
def create(self, cr, uid, vals, *args, **kwargs):
@@ -533,7 +559,9 @@ class project_work(osv.osv):
cr.execute('update project_task set remaining_hours=remaining_hours - %s where id=%s', (vals.get('hours',0.0), vals['task_id']))
return super(project_work,self).create(cr, uid, vals, *args, **kwargs)
def write(self, cr, uid, ids,vals,context={}):
def write(self, cr, uid, ids, vals, context=None):
if context is None:
context = {}
if 'hours' in vals and (not vals['hours']):
vals['hours'] = 0.00
if 'hours' in vals:
@@ -544,7 +572,7 @@ class project_work(osv.osv):
def unlink(self, cr, uid, ids, *args, **kwargs):
for work in self.browse(cr, uid, ids):
cr.execute('update project_task set remaining_hours=remaining_hours + %s where id=%s', (work.hours, work.task_id.id))
return super(project_work,self).unlink(cr, uid, ids,*args, **kwargs)
return super(project_work,self).unlink(cr, uid, ids, *args, **kwargs)
project_work()
class config_compute_remaining(osv.osv_memory):
@@ -552,7 +580,7 @@ class config_compute_remaining(osv.osv_memory):
def _get_remaining(self,cr, uid, ctx):
task_obj = self.pool.get('project.task')
if 'active_id' in ctx:
return task_obj.browse(cr,uid,ctx['active_id'],context=ctx).remaining_hours
return task_obj.browse(cr, uid, ctx['active_id'], context=ctx).remaining_hours
return False
_columns = {
@@ -603,15 +631,17 @@ class message(osv.osv):
'description': fields.text('Description'),
}
def _default_project(self, cr, uid, context={}):
def _default_project(self, cr, uid, context=None):
if context is None:
context = {}
if 'project_id' in context and context['project_id']:
return int(context['project_id'])
return False
_defaults = {
'user_id' : lambda self,cr,uid,ctx : uid,
'date' : lambda self,cr,uid,ctx : time.strftime('%Y-%m-%d'),
'project_id':_default_project
'user_id': lambda self,cr,uid,ctx: uid,
'date': lambda self,cr,uid,ctx: time.strftime('%Y-%m-%d'),
'project_id': _default_project
}
message()
@@ -637,4 +667,5 @@ class account_analytic_account(osv.osv):
return super(account_analytic_account, self).create(cr, uid, vals, context=context)
account_analytic_account()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+2
View File
@@ -8,9 +8,11 @@
<field name="name">Project</field>
<field name="object">project.project</field>
</record>
<record id="req_link_task" model="res.request.link">
<field name="name">Project task</field>
<field name="object">project.task</field>
</record>
</data>
</openerp>
+2 -3
View File
@@ -10,10 +10,8 @@
<form position="attributes">
<attribute name="string">Project Modules Installation</attribute>
</form>
<separator string="title" position="attributes">
<attribute name="string"
>Project Management</attribute>
<attribute name="string">Project Management</attribute>
</separator>
<xpath expr='//separator[@string="vsep"]' position='attributes'>
<attribute name='string'></attribute>
@@ -55,6 +53,7 @@
<field name="action_id" ref="action_project_installer"/>
<field name="sequence">3</field>
</record>
<record id="project_ir_actions_todo_tree" model="ir.ui.view">
<field name="model">ir.actions.todo</field>
<field name="name">project_installer_action_replace</field>
+3 -1
View File
@@ -77,7 +77,9 @@ class project_tasks(osv.osv):
getattr(self,act)(cr, uid, [id])
return True
def message_followers(self, cr, uid, ids, context={}):
def message_followers(self, cr, uid, ids, context=None):
if context is None:
context = {}
res = []
if isinstance(ids, (str, int, long)):
select = [ids]
+4 -3
View File
@@ -1,9 +1,10 @@
import pooler
import datetime
def timeformat_convert(cr, uid, time_string, context={}):
def timeformat_convert(cr, uid, time_string, context=None):
# Function to convert input time string:: 8.5 to output time string 8:30
if context is None:
context = {}
split_list = str(time_string).split('.')
hour_part = split_list[0]
mins_part = split_list[1]
@@ -78,4 +79,4 @@ def compute_working_calendar(cr,uid,calendar_id):
if non_working:
wktime_cal.append((non_working[:-1],time_range))
return wktime_cal
return wktime_cal
+1 -2
View File
@@ -42,7 +42,6 @@
<field name="project_escalation_id"/>
<field name="warn_manager"/>
</group>
<newline/>
<group col="9" colspan="8">
<field name="state" select="1"/>
@@ -517,6 +516,7 @@
<field name="view_type">form</field>
<field name="view_id" ref="task_type_tree"/>
</record>
<menuitem id="menu_tasks_config" name="Tasks" parent="project.menu_definitions" sequence="1"/>
<menuitem action="open_task_type_form" id="menu_task_types_view" parent="menu_tasks_config" sequence="1"/>
@@ -545,7 +545,6 @@
</field>
</record>
<!-- User Form-->
<record id="view_project_users_form_simple" model="ir.ui.view">
<field name="name">res.users.project.form1</field>
+34 -43
View File
@@ -29,14 +29,14 @@ class report_project_task_user(osv.osv):
_columns = {
'name': fields.char('Task Summary', size=128, readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'year': fields.char('Year',size=64,required=False, readonly=True),
'user_id':fields.many2one('res.users', 'Assigned To', readonly=True),
'year': fields.char('Year', size=64, required=False, readonly=True),
'user_id': fields.many2one('res.users', 'Assigned To', readonly=True),
'date_start': fields.date('Starting Date',readonly=True),
'no_of_days': fields.integer('# of Days', size=128, readonly=True),
'description': fields.text('Description',readonly=True),
'date_end': fields.date('Ending Date',readonly=True),
'date_deadline': fields.date('Deadline',readonly=True),
'project_id':fields.many2one('project.project', 'Project', readonly=True),
'description': fields.text('Description', readonly=True),
'date_end': fields.date('Ending Date', readonly=True),
'date_deadline': fields.date('Deadline', readonly=True),
'project_id': fields.many2one('project.project', 'Project', readonly=True),
'hours_planned': fields.float('Planned Hours', readonly=True),
'hours_effective': fields.float('Effective Hours', readonly=True),
'hours_delay': fields.float('Avg. Plan.-Eff.', readonly=True),
@@ -49,32 +49,21 @@ class report_project_task_user(osv.osv):
help="Number of Days to Open the task"),
'delay_endings_days': fields.float('Overpassed Deadline', digits=(16,2), readonly=True),
'nbr': fields.integer('# of tasks', readonly=True),
'priority' : fields.selection([('4','Very Low'),
('3','Low'),
('2','Medium'),
('1','Urgent'),
('0','Very urgent')],
'Importance',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),
'company_id': fields.many2one('res.company', 'Company',readonly=True, groups="base.group_multi_company"),
'partner_id': fields.many2one('res.partner', 'Partner',readonly=True),
'type': fields.many2one('project.task.type', 'Stage',readonly=True),
'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'),
('0','Very urgent')], 'Importance', 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),
'company_id': fields.many2one('res.company', 'Company', readonly=True, groups="base.group_multi_company"),
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
'type': fields.many2one('project.task.type', 'Stage', readonly=True),
}
_order = 'name desc, project_id'
def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'report_project_task_user')
cr.execute("""
create view report_project_task_user as
select
CREATE view report_project_task_user as
SELECT
(select 1 ) AS nbr,
t.id as id,
to_char(date_start, 'YYYY') as year,
@@ -102,9 +91,9 @@ class report_project_task_user(osv.osv):
(extract('epoch' from (t.date_end-t.create_date)))/(3600*24) as closing_days,
(extract('epoch' from (t.date_start-t.create_date)))/(3600*24) as opening_days,
(extract('epoch' from (t.date_deadline-t.date_end)))/(3600*24) as delay_endings_days
from project_task t
FROM project_task t
group by
GROUP BY
t.id,
remaining_hours,
t.effective_hours,
@@ -139,37 +128,38 @@ class project_vs_remaining_hours(osv.osv):
_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)
'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 (
CREATE or REPLACE view project_vs_remaining_hours as (
select
min(pt.id) as id,
aaa.user_id as uid,
aaa.name as project,
aaa.state,
sum(pt.remaining_hours) as remaining_hours
from project_project as pp,
FROM project_project as pp,
account_analytic_account as aaa,
project_task as pt
where aaa.id=pp.category_id and pt.project_id=pp.id and pp.category_id=aaa.id
group by aaa.user_id,aaa.state,aaa.name
WHERE aaa.id=pp.category_id and pt.project_id=pp.id and pp.category_id=aaa.id
GROUP BY aaa.user_id,aaa.state,aaa.name
UNION All
select
SELECT
min(pt.id) as id,
pur.uid as uid,
aaa.name as project,
aaa.state,
sum(pt.remaining_hours) as remaining_hours
from project_project as pp,
FROM project_project as pp,
project_user_rel as pur,
account_analytic_account as aaa,
project_task as pt
where pur.project_id=pp.id and pt.project_id=pp.id and pp.category_id=aaa.id
group by pur.uid,aaa.state,aaa.name
WHERE pur.project_id=pp.id and pt.project_id=pp.id and pp.category_id=aaa.id
GROUP BY pur.uid,aaa.state,aaa.name
)
""")
project_vs_remaining_hours()
@@ -182,22 +172,23 @@ class task_by_days(osv.osv):
'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),
'project_id':fields.many2one('project.project','Project')
'project_id':fields.many2one('project.project', 'Project')
}
_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
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,
pt.project_id
from
FROM
project_task as pt
group by
GROUP BY
to_char(pt.create_date, 'YYYY-MM-DD'),pt.state,pt.project_id
)
""")
@@ -86,13 +86,13 @@
icon="terp-dialog-close"
name="done"
domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<separator orientation="vertical"/>
<field name="project_id">
<filter icon="terp-folder-blue"
string="My Projects"
help="My Projects" domain="[('project_id','=',uid)]"/>
help="My Projects" domain="[('project_id','=',uid)]"/>
</field>
<field name="user_id" widget="selection">
<filter icon="terp-personal"
string="My Task"
@@ -110,7 +110,7 @@
<filter string="Project" name="project" icon="terp-folder-blue" context="{'group_by':'project_id'}"/>
<filter string="Assigned to" name="User" icon="terp-personal" context="{'group_by':'user_id'}" />
<separator orientation="vertical"/>
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}" />
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}" />
<filter string="Task" icon="terp-stock_align_left_24" context="{'group_by':'name'}" />
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
@@ -144,6 +144,7 @@
<field name="search_view_id" ref="view_task_project_user_search"/>
<field name="context">{'search_default_month':1,'search_default_project':1,'group_by_no_leaf':1,'group_by':[]}</field>
</record>
<menuitem action="action_project_task_user_tree" id="menu_project_task_user_tree" parent="base.menu_project_report"/>
<!-- Views and action for project dashboard -->
@@ -181,6 +182,7 @@
<field name="domain">[('uid','=',uid)]</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>
+2
View File
@@ -22,11 +22,13 @@
from osv import fields,osv
class res_partner(osv.osv):
""" Inherits partner and adds CRM information in the partner form """
_inherit = 'res.partner'
_columns = {
'task_ids': fields.one2many('project.task', 'partner_id', 'Tasks'),
}
res_partner()
@@ -5,9 +5,11 @@
<record id="group_project_finance" model="res.groups">
<field name="name">Project / Financial Manager</field>
</record>
<record id="group_project_manager" model="res.groups">
<field name="name">Project / Manager</field>
</record>
<record id="group_project_user" model="res.groups">
<field name="name">Project / User</field>
</record>
+11 -5
View File
@@ -33,9 +33,11 @@ class project_close_task(osv.osv_memory):
_columns = {
'email': fields.char('E-Mail', size=64, help="Email Address"),
'description': fields.text('Description'),
}
}
def _get_email(self, cr, uid, context={}):
def _get_email(self, cr, uid, context=None):
if context is None:
context = {}
email = ''
if 'task_id' in context:
task = self.pool.get('project.task').browse(cr, uid, context['task_id'])
@@ -44,7 +46,9 @@ class project_close_task(osv.osv_memory):
email = partner_id.address[0].email
return email
def _get_desc(self, cr, uid, context={}):
def _get_desc(self, cr, uid, context=None):
if context is None:
context = {}
if 'task_id' in context:
task = self.pool.get('project.task').browse(cr, uid, context['task_id'])
return task.description or task.name
@@ -55,7 +59,9 @@ class project_close_task(osv.osv_memory):
'description': _get_desc,
}
def confirm(self, cr, uid, ids, context={}):
def confirm(self, cr, uid, ids, context=None):
if context is None:
context = {}
if not 'task_id' in context:
return {}
close_task = self.read(cr, uid, ids[0], [])
@@ -88,4 +94,4 @@ class project_close_task(osv.osv_memory):
return {}
project_close_task()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -11,10 +11,10 @@
<label string="Send mail to the specified email address"/>
<separator string="" colspan="4"/>
<group colspan="4" col="6">
<newline/>
<field name="email"/>
<newline/>
<field name="description" />
<newline/>
<field name="email"/>
<newline/>
<field name="description" />
</group>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="_Close"/>
@@ -36,4 +36,4 @@
</record>
</data>
</openerp>
</openerp>
+16 -9
View File
@@ -33,12 +33,11 @@ class project_task_delegate(osv.osv_memory):
'new_task_description': fields.text('New Task Description', help="Reinclude the description of the task in the task of the user"),
'planned_hours': fields.float('Planned Hours', help="Estimated time to close this task by the delegated user"),
'planned_hours_me': fields.float('Hours to Validate', required=True, help="Estimated time for you to validate the work done by the user to whom you delegate this task"),
'state': fields.selection([('pending','Pending'),
('done','Done'),
],'Validation State', required=True, help="New state of your own task. Pending will be reopened automatically when the delegated task is closed"),
}
'state': fields.selection([('pending','Pending'), ('done','Done'), ], 'Validation State', required=True, help="New state of your own task. Pending will be reopened automatically when the delegated task is closed"), }
def _get_name(self, cr, uid, context={}):
def _get_name(self, cr, uid, context=None):
if context is None:
context = {}
if 'active_id' in context:
task = self.pool.get('project.task').browse(cr, uid, context['active_id'])
if task.name.startswith(_('CHECK: ')):
@@ -48,13 +47,17 @@ class project_task_delegate(osv.osv_memory):
return newname
return ''
def _get_plan_hour(self, cr, uid, context={}):
def _get_plan_hour(self, cr, uid, context=None):
if context is None:
context = {}
if 'active_id' in context:
task = self.pool.get('project.task').browse(cr, uid, context['active_id'])
return task.remaining_hours
return 0.0
def _get_prefix(self, cr, uid, context={}):
def _get_prefix(self, cr, uid, context=None):
if context is None:
context = {}
if 'active_id' in context:
task = self.pool.get('project.task').browse(cr, uid, context['active_id'])
if task.name.startswith(_('CHECK: ')):
@@ -64,7 +67,9 @@ class project_task_delegate(osv.osv_memory):
return _('CHECK: ')+ newname
return ''
def _get_new_desc(self, cr, uid, context={}):
def _get_new_desc(self, cr, uid, context=None):
if context is None:
context = {}
if 'active_id' in context:
task = self.pool.get('project.task').browse(cr, uid, context['active_id'])
return task.description
@@ -79,7 +84,9 @@ class project_task_delegate(osv.osv_memory):
'state': 'pending',
}
def validate(self, cr, uid, ids, context={}):
def validate(self, cr, uid, ids, context=None):
if context is None:
context = {}
task_obj = self.pool.get('project.task')
delegate_data = self.read(cr, uid, ids, context=context)[0]
task = task_obj.browse(cr, uid, context['active_id'], context=context)
@@ -25,7 +25,7 @@
<field name="state" />
<newline/>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
<button icon="gtk-ok" name="validate" string="Validate" type="object"/>
</group>
</form>
@@ -44,4 +44,4 @@
</record>
</data>
</openerp>
</openerp>
+8 -8
View File
@@ -20,15 +20,15 @@
##############################################################################
{
"name" : "Caldav task management",
"version" : "1.0",
"author" : "Tiny",
"category" : "Generic Modules/Others",
"name": "Caldav task management",
"version": "1.0",
"author": "Tiny",
"category": "Generic Modules/Others",
"description": """ Synchronize between Project task and Caldav Vtodo.""",
"depends" : ["project", "caldav", "base_calendar"],
"init_xml" : ["project_caldav_data.xml"],
"demo_xml" : [],
"update_xml" : ["project_caldav_view.xml"],
"depends": ["project", "caldav", "base_calendar"],
"init_xml": ["project_caldav_data.xml"],
"demo_xml": [],
"update_xml": ["project_caldav_view.xml"],
"active": False,
"website": "http://www.openerp.com",
"installable": True,
+9 -6
View File
@@ -26,8 +26,8 @@ class project_task(osv.osv):
_name = "project.task"
_inherit = ["calendar.todo", "project.task"]
_columns = {
'write_date' : fields.datetime('Write Date'),
'create_date' : fields.datetime('Create Date'),
'write_date': fields.datetime('Write Date'),
'create_date': fields.datetime('Create Date'),
'attendee_ids': fields.many2many('calendar.attendee', \
'task_attendee_rel', 'task_id', 'attendee_id', 'Attendees'),
}
@@ -37,7 +37,9 @@ class project_task(osv.osv):
vals = todo_obj.import_cal(cr, uid, data, context=context)
return self.check_import(cr, uid, vals, context=context)
def check_import(self, cr, uid, vals, context={}):
def check_import(self, cr, uid, vals, context=None):
if context is None:
context = {}
ids = []
for val in vals:
obj_tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.project_time_mode_id
@@ -65,7 +67,9 @@ class project_task(osv.osv):
ids.append(task_id)
return ids
def export_cal(self, cr, uid, ids, context={}):
def export_cal(self, cr, uid, ids, context=None):
if context is None:
context = {}
task_datas = self.read(cr, uid, ids, [], context ={'read': True})
tasks = []
for task in task_datas:
@@ -75,8 +79,7 @@ class project_task(osv.osv):
todo_obj = self.pool.get('basic.calendar.todo')
ical = todo_obj.export_cal(cr, uid, tasks, context={'model': self._name})
calendar_val = ical.serialize()
calendar_val = calendar_val.replace('"', '').strip()
return calendar_val
return calendar_val.replace('"', '').strip()
project_task()
@@ -74,11 +74,11 @@
<record model="basic.calendar.fields" id="map_todo_10">
<field name="name" ref="caldav.field_todo_vtimezone"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','vtimezone'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<field name="name" ref="caldav.field_todo_vtimezone"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','vtimezone'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_11">
<field name="name" ref="caldav.field_todo_summary"/>
+30 -44
View File
@@ -14,10 +14,9 @@
name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
icon="terp-partner" type="action"
context="{'model' : 'project.task'}" colspan="2"/>
<field name="attendee_ids" colspan="4"
<field name="attendee_ids" colspan="4"
nolabel="1" widget="one2many" mode="tree,form">
<tree string="Assignees details"
editable="top">
<tree string="Assignees details" editable="top">
<field name="email" />
<field name="role" select="1" />
<field name="state" />
@@ -29,15 +28,12 @@
<field name="rsvp" select="1" />
<field name="cutype" select="1" />
<field name="role" select="1" />
<separator colspan="4"
string="" />
<separator colspan="4" string="" />
<field name="state" />
</page>
<page string="Other">
<field name="user_id"
select="1" />
<field name="partner_address_id"
select="1" />
<field name="user_id" select="1" />
<field name="partner_address_id" select="1" />
<newline />
</page>
</notebook>
@@ -68,8 +64,7 @@
<field name="arch" type="xml">
<field name="progress" position="after">
<group colspan="2" col="4" >
<field name="rrule_type" string="Recurrency"
colspan="1" attrs="{'readonly':[('recurrent_uid','!=',False)]}"/>
<field name="rrule_type" string="Recurrency" colspan="1" attrs="{'readonly':[('recurrent_uid','!=',False)]}"/>
<button string="Edit All"
help="Edit all Ourrences of recurrent Task"
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"
@@ -85,44 +80,35 @@
<group col="4" colspan="6" name="rrule" attrs="{'invisible': [('rrule_type','!=','custom')]}">
<separator string="Data for Custom Rule" colspan="8"/>
<group col="8" colspan="4">
<field name="freq" />
<field name="interval" />
<field name="count" />
<field name="end_date" />
<field name="freq" />
<field name="interval" />
<field name="count" />
<field name="end_date" />
</group>
<group col="14" colspan="4" name="Select weekdays"
attrs="{'invisible' : [('freq','!=','weekly')]}">
<field name="mo" colspan="1" />
<field name="tu" colspan="1" />
<field name="we" colspan="1" />
<field name="th" colspan="1" />
<field name="fr" colspan="1" />
<field name="sa" colspan="1" />
<field name="su" colspan="1" />
<newline />
<group col="14" colspan="4" name="Select weekdays"
attrs="{'invisible': [('freq','=','weekly')]}">
<field name="mo" colspan="1" />
<field name="tu" colspan="1" />
<field name="we" colspan="1" />
<field name="th" colspan="1" />
<field name="fr" colspan="1" />
<field name="sa" colspan="1" />
<field name="su" colspan="1" />
<newline />
</group>
<group col="10" colspan="4"
attrs="{'invisible' : [('freq','!=','monthly'), ('freq','!=','yearly')]}">
<group col="10" colspan="4" attrs="{'invisible': [('freq','!=','monthly'), ('freq','!=','yearly')]}">
<group col="2" colspan="1">
<field name="select1" />
<field name="select1" />
</group>
<group col="2" colspan="1"
attrs="{'invisible' : [('select1','=','day')]}">
<field name="day"
attrs="{'required' : [('select1','=','date')]}" />
<group col="2" colspan="1" attrs="{'invisible' : [('select1','=','day')]}">
<field name="day" attrs="{'required' : [('select1','=','date')]}" />
</group>
<group col="3" colspan="1"
attrs="{'invisible' : [('select1','=','date')]}">
<field name="byday" string="The"
attrs="{'required' : [('select1','=','day')]}" />
<field name="week_list" nolabel="1"
attrs="{'required' : [('select1','=','day')]}" />
<group col="3" colspan="1" attrs="{'invisible' : [('select1','=','date')]}">
<field name="byday" string="The" attrs="{'required' : [('select1','=','day')]}" />
<field name="week_list" nolabel="1" attrs="{'required' : [('select1','=','day')]}" />
</group>
<group col="1" colspan="1"
attrs="{'invisible' : [('freq','!=','yearly')]}">
<field name="month_list" string="of"
colspan="1"
attrs="{'required' : [('freq','=','yearly')]}" />
<group col="1" colspan="1" attrs="{'invisible' : [('freq','!=','yearly')]}">
<field name="month_list" string="of" colspan="1" attrs="{'required' : [('freq','=','yearly')]}" />
</group>
</group>
</group>
@@ -144,7 +130,7 @@
<field name="rrule" invisible="1"/>
</field>
</field>
</record>
</record>
</data>
</openerp>
+9 -6
View File
@@ -46,7 +46,7 @@ class project_gtd_context(osv.osv):
'project_default_id': fields.many2one('project.project', 'Default Project', required=True),
}
_defaults = {
'sequence': lambda *args: 1
'sequence': 1
}
_order = "sequence, name"
@@ -125,15 +125,18 @@ class project_task(osv.osv):
}
def copy_data(self, cr, uid, id, default=None, context=None):
if context is None:
context = {}
if not default:
default = {}
default['timebox_id']=False
default['context_id']=False
default['timebox_id'] = False
default['context_id'] = False
return super(project_task,self).copy_data(cr, uid, id, default, context)
def _get_context(self,cr, uid, ctx):
ids = self.pool.get('project.gtd.context').search(cr, uid, [], context=ctx)
def _get_context(self,cr, uid, context=None):
ids = self.pool.get('project.gtd.context').search(cr, uid, [], context=context)
return ids and ids[0] or False
_defaults = {
'context_id': _get_context
}
@@ -192,7 +195,7 @@ class project_task(osv.osv):
context_id_info['context_id']['selection'] = attrs_sel
res['fields'].update(context_id_info)
return res
project_task()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+2 -2
View File
@@ -67,7 +67,7 @@
<field name="planned_hours">24.0</field>
<field name="remaining_hours">24.0</field>
<field name="timebox_id" ref="timebox_weekly"/>
<field name="context_id" ref="context_office"/>
<field name="context_id" ref="context_office"/>
<field name="user_id" ref="base.user_root"/>
<field name="project_id" ref="project.project_project_22"/>
<field name="name">Validation + latest modifications.</field>
@@ -100,7 +100,7 @@
<field name="planned_hours">24.0</field>
<field name="remaining_hours">24.0</field>
<field name="timebox_id" ref="timebox_weekly"/>
<field name="context_id" ref="context_office"/>
<field name="context_id" ref="context_office"/>
<field name="user_id" ref="base.user_root"/>
<field name="project_id" ref="project.project_project_22"/>
<field name="name">Validation + latest modifications.</field>
+3
View File
@@ -13,6 +13,7 @@
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_gtd_context_form">
<field name="name">project.gtd.context.form</field>
<field name="model">project.gtd.context</field>
@@ -25,6 +26,7 @@
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_gtd_context_tree">
<field name="name">Contexts</field>
<field name="res_model">project.gtd.context</field>
@@ -70,6 +72,7 @@
</record>
<menuitem name="Timeboxes" id="menu_open_gtd_time_timeboxes" parent="project.menu_tasks_config" action="open_gtd_timebox_tree"/>
<record model="ir.ui.view" id="project_task_tree">
<field name="name">project.task.tree.timebox</field>
<field name="model">project.task</field>
@@ -63,4 +63,4 @@ class project_timebox_empty(osv.osv_memory):
project_timebox_empty()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -32,10 +32,14 @@ class project_timebox_fill(osv.osv_memory):
}
def _get_from_tb(self, cr, uid, context=None):
if context is None:
context = {}
ids = self.pool.get('project.gtd.timebox').search(cr, uid, [], context=context)
return ids and ids[0] or False
def _get_to_tb(self, cr, uid, context=None):
if context is None:
context = {}
if 'active_id' in context:
return context['active_id']
return False
@@ -58,4 +62,4 @@ class project_timebox_fill(osv.osv_memory):
project_timebox_fill()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+3 -3
View File
@@ -48,9 +48,9 @@
"board_project_issue_view.xml",
],
'demo_xml': ['project_issue_demo.xml'],
'test' : [
'test/convert_issue_to_task.yml',
'test/test_project_issue_states.yml'
'test': [
'test/convert_issue_to_task.yml',
'test/test_project_issue_states.yml'
],
'installable': True,
'active': False,
@@ -85,9 +85,7 @@
<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="project.next_id_86"
<menuitem id="menu_deshboard_project_issue" name="Project Issue Dashboard" parent="project.next_id_86"
icon="terp-graph" action="open_board_project_issue"/>
</data>
</openerp>
+39 -45
View File
@@ -25,14 +25,14 @@ import re
import time
import mx.DateTime
from datetime import datetime, timedelta
import binascii
import collections
import tools
from crm import crm
from osv import fields,osv,orm
from osv.orm import except_orm
from tools.translate import _
import collections
import binascii
import tools
class project_issue(osv.osv, crm.crm_case):
@@ -54,7 +54,9 @@ class project_issue(osv.osv, crm.crm_case):
self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S')})
return res
def _compute_day(self, cr, uid, ids, fields, args, context={}):
def _compute_day(self, cr, uid, ids, fields, args, context=None):
if context is None:
context = {}
"""
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -66,7 +68,7 @@ class project_issue(osv.osv, crm.crm_case):
res_obj = self.pool.get('resource.resource')
res = {}
for issue in self.browse(cr, uid, ids, context):
for issue in self.browse(cr, uid, ids, context=context):
for field in fields:
res[issue.id] = {}
duration = 0
@@ -102,13 +104,7 @@ class project_issue(osv.osv, crm.crm_case):
duration = float(ans.days)
if issue.project_id and issue.project_id.resource_calendar_id:
duration = float(ans.days) * 24
new_dates = cal_obj.interval_min_get(cr,
uid,
issue.project_id.resource_calendar_id.id,
mx.DateTime.strptime(issue.create_date, '%Y-%m-%d %H:%M:%S'),
duration,
resource=resource_id
)
new_dates = cal_obj.interval_min_get(cr, uid, issue.project_id.resource_calendar_id.id, mx.DateTime.strptime(issue.create_date, '%Y-%m-%d %H:%M:%S'), duration, resource=resource_id)
no_days = []
date_until = mx.DateTime.strptime(date_until, '%Y-%m-%d %H:%M:%S')
for in_time, out_time in new_dates:
@@ -127,8 +123,8 @@ class project_issue(osv.osv, crm.crm_case):
'id': fields.integer('ID'),
'name': fields.char('Name', size=128, required=True),
'active': fields.boolean('Active', required=False),
'create_date': fields.datetime('Creation Date' , readonly=True),
'write_date': fields.datetime('Update Date' , readonly=True),
'create_date': fields.datetime('Creation Date', readonly=True),
'write_date': fields.datetime('Update Date', readonly=True),
'date_deadline': fields.date('Deadline'),
'date_closed': fields.datetime('Closed', readonly=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
@@ -140,28 +136,22 @@ class project_issue(osv.osv, crm.crm_case):
domain="[('partner_id','=',partner_id)]"),
'company_id': fields.many2one('res.company', 'Company'),
'description': fields.text('Description'),
'state': fields.selection([
('draft', 'Draft'),
('open', 'Todo'),
('cancel', 'Cancelled'),
('done', 'Closed'),
('pending', 'Pending'),
], 'State', size=16, readonly=True,
'state': fields.selection([('draft', 'Draft'), ('open', 'Todo'), ('cancel', 'Cancelled'), ('done', 'Closed'),('pending', 'Pending'), ], 'State', size=16, readonly=True,
help='The state is set to \'Draft\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the case is over, the state is set to \'Done\'.\
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
'email_from': fields.char('Email', size=128, help="These people will receive email."),
'email_cc': fields.text('Watchers Emails', size=252 , help="These people\
'email_cc': fields.text('Watchers Emails', size=252, help="These people\
will receive a copy of the future" \
" communication between partner and users by email"),
'date_open': fields.datetime('Opened', readonly=True),
# Project Issue fields
'date_closed': fields.datetime('Closed', readonly=True),
'date': fields.datetime('Date'),
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
'canal_id': fields.many2one('res.partner.canal', 'Channel', help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
'categ_id': fields.many2one('crm.case.categ','Category', domain="[('object_id.model', '=', 'crm.project.bug')]"),
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('object_id.model', '=', 'crm.project.bug')]"),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Severity'),
'type_id': fields.many2one('crm.case.resource.type', 'Version', domain="[('object_id.model', '=', 'project.issue')]"),
'partner_name': fields.char("Employee's Name", size=64),
@@ -176,7 +166,7 @@ class project_issue(osv.osv, crm.crm_case):
method=True, multi='day_open', type="float", store=True),
'day_close': fields.function(_compute_day, string='Days to Close', \
method=True, multi='day_close', type="float", store=True),
'assigned_to' : fields.many2one('res.users', 'Assigned to'),
'assigned_to': fields.many2one('res.users', 'Assigned to'),
'working_hours_open': fields.function(_compute_day, string='Working Hours to Open the Issue', \
method=True, multi='working_days_open', type="float", store=True),
'working_hours_close': fields.function(_compute_day, string='Working Hours to Close the Issue', \
@@ -194,15 +184,15 @@ class project_issue(osv.osv, crm.crm_case):
return False
_defaults = {
'active': lambda *a: 1,
'active': 1,
'user_id': crm.crm_case._get_default_user,
'partner_id': crm.crm_case._get_default_partner,
'partner_address_id': crm.crm_case._get_default_partner_address,
'email_from': crm.crm_case. _get_default_email,
'state': lambda *a: 'draft',
'state': 'draft',
'section_id': crm.crm_case. _get_section,
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.helpdesk', context=c),
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
'priority': crm.AVAILABLE_PRIORITIES[2][0],
'project_id':_get_project,
}
@@ -229,9 +219,9 @@ class project_issue(osv.osv, crm.crm_case):
'partner_id': bug.partner_id.id,
'description':bug.description,
'date': bug.date,
'project_id':bug.project_id.id,
'priority':bug.priority,
'user_id':bug.assigned_to.id,
'project_id': bug.project_id.id,
'priority': bug.priority,
'user_id': bug.assigned_to.id,
'planned_hours': 0.0,
})
@@ -269,7 +259,9 @@ class project_issue(osv.osv, crm.crm_case):
def convert_to_bug(self, cr, uid, ids, context=None):
return self._convert(cr, uid, ids, 'bug_categ', context=context)
def onchange_stage_id(self, cr, uid, ids, stage_id, context={}):
def onchange_stage_id(self, cr, uid, ids, stage_id, context=None):
if context is None:
context = {}
if not stage_id:
return {'value':{}}
stage = self.pool.get('crm.case.stage').browse(cr, uid, stage_id, context)
@@ -300,7 +292,7 @@ class project_issue(osv.osv, crm.crm_case):
def message_new(self, cr, uid, msg, context):
"""
Automatically calls when new email message arrives
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks
@@ -312,7 +304,7 @@ class project_issue(osv.osv, crm.crm_case):
body = msg.get('body')
msg_from = msg.get('from')
priority = msg.get('priority')
vals = {
'name': subject,
'email_from': msg_from,
@@ -322,18 +314,18 @@ class project_issue(osv.osv, crm.crm_case):
}
if msg.get('priority', False):
vals['priority'] = priority
res = mailgate_pool.get_partner(cr, uid, msg.get('from'))
if res:
vals.update(res)
res = self.create(cr, uid, vals, context)
self.convert_to_bug(cr, uid, [res], context=context)
attachents = msg.get('attachments', [])
for attactment in attachents or []:
data_attach = {
'name': attactment,
'datas':binascii.b2a_base64(str(attachents.get(attactment))),
'datas': binascii.b2a_base64(str(attachents.get(attactment))),
'datas_fname': attactment,
'description': 'Mail attachment',
'res_model': self._name,
@@ -343,17 +335,19 @@ class project_issue(osv.osv, crm.crm_case):
return res
def message_update(self, cr, uid, ids, vals={}, msg="", default_act='pending', context={}):
"""
def message_update(self, cr, uid, ids, vals={}, msg="", default_act='pending', context=None):
if context is None:
context = {}
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param ids: List of update mail’s IDs
@param ids: List of update mail’s IDs
"""
if isinstance(ids, (str, int, long)):
ids = [ids]
vals.update({
'description': msg['body']
})
@@ -361,9 +355,9 @@ class project_issue(osv.osv, crm.crm_case):
vals['priority'] = msg.get('priority')
maps = {
'cost':'planned_cost',
'cost': 'planned_cost',
'revenue': 'planned_revenue',
'probability':'probability'
'probability': 'probability'
}
vls = { }
for line in msg['body'].split('\n'):
@@ -372,7 +366,7 @@ class project_issue(osv.osv, crm.crm_case):
if res and maps.get(res.group(1).lower(), False):
key = maps.get(res.group(1).lower())
vls[key] = res.group(2).lower()
vals.update(vls)
res = self.write(cr, uid, ids, vals)
return res
@@ -399,4 +393,4 @@ class project(osv.osv):
}
project()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+5 -1
View File
@@ -1,6 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<!--
Case Categories
-->
@@ -11,6 +12,7 @@
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="feature_request_categ">
<field name="name">Feature Requests</field>
<field name="section_id" ref="crm.section_sales_department"/>
@@ -25,7 +27,8 @@
<field name="name">Version 4.2</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
</record>
</record>
<record model="crm.case.resource.type" id="type2">
<field name="name">Version 4.4</field>
<field name="section_id" ref="crm.section_sales_department"/>
@@ -67,5 +70,6 @@
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
</record>
</data>
</openerp>
@@ -1,6 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<record id="crm_case_buginaccountsmodule0" model="project.issue">
<field name="partner_address_id" ref="base.res_partner_address_8"/>
<field eval="time.strftime('%Y-%m-08 10:15:00')" name="date"/>
+4 -2
View File
@@ -2,7 +2,6 @@
<openerp>
<data>
######################## ISSUE TRACKING (menu) ###########################
<!--
ALL BUGS
@@ -14,21 +13,24 @@
<field name="view_mode">tree,calendar</field>
<field name="view_id" ref="project_issue_tree_view"/>
<field name="domain" eval="[('categ_id','=',ref('bug_categ'))]"/>
<field name="context">{"search_default_user_id": uid,"search_default_current":1,"search_default_project_id":project_id}</field>
<field name="context">{"search_default_user_id": uid, "search_default_current":1, "search_default_project_id":project_id}</field>
<field name="search_view_id" ref="view_project_issue_filter"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view0">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="project_issue_tree_view"/>
<field name="act_window_id" ref="project_issue_categ_act0"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_calendar_view0">
<field name="sequence" eval="2"/>
<field name="view_mode">calendar</field>
<field name="view_id" ref="project_issue_calendar_view"/>
<field name="act_window_id" ref="project_issue_categ_act0"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view0">
<field name="sequence" eval="3"/>
<field name="view_mode">form</field>
+55 -74
View File
@@ -31,58 +31,56 @@
<field name="arch" type="xml">
<form string="Issue Tracker Form">
<group colspan="4" col="6">
<field name="name"/>
<field name="project_id" required="True"/>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
<field name="user_id"/>
<field name="assigned_to" />
<field name="name"/>
<field name="project_id" required="True"/>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
<field name="user_id"/>
<field name="assigned_to" />
<group colspan="2" col="4">
<field name="stage_id" on_change="onchange_stage_id(stage_id)" domain="[('object_id.model', '=', 'project.issue')]" widget="selection"/>
<button icon="gtk-go-back" string="" name="stage_previous" type="object"/>
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
<field name="stage_id" on_change="onchange_stage_id(stage_id)" domain="[('object_id.model', '=', 'project.issue')]" widget="selection"/>
<button icon="gtk-go-back" string="" name="stage_previous" type="object"/>
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
</group>
</group>
<notebook colspan="4">
<page string="General">
<group col="2" colspan="2">
<separator colspan="2" string="Communication"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/>
<field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)"/>
<field name="email_from"/>
<separator colspan="2" string="Communication"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/>
<field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)"/>
<field name="email_from"/>
</group>
<group col="3" colspan="2">
<separator colspan="3" string="Status"/>
<field name="type_id" colspan="3"/>
<field name="priority" colspan="3"/>
<field name="task_id" />
<button string="Convert To Task"
name="convert_issue_task"
icon="gtk-index" type="object"
attrs="{'invisible':[('task_id','!=',False)]}" />
<separator colspan="3" string="Status"/>
<field name="type_id" colspan="3"/>
<field name="priority" colspan="3"/>
<field name="task_id" />
<button string="Convert To Task" name="convert_issue_task" icon="gtk-index" type="object"
attrs="{'invisible':[('task_id','!=',False)]}" />
</group>
<separator string= "Description" colspan="4"/>
<field name="description" nolabel="1" colspan="4"/>
<separator colspan="4"/>
<group col="8" colspan="4">
<field name="state" />
<button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" icon="gtk-go-up"/>
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
<field name="state" />
<button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" icon="gtk-go-up"/>
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
</group>
</page>
<page string="Emails" groups="base.group_extended">
<group colspan="4">
<field colspan="4" name="email_cc" string="CC"/>
<field colspan="4" name="email_cc" string="CC"/>
</group>
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree">
<form string="Communication history">
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<notebook colspan="4">
<page string="Details">
@@ -92,9 +90,7 @@
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
</page>
</notebook>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
<button colspan="4" string="Reply to Last Email" name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'project.issue', 'include_original' : True}"
icon="gtk-undo" type="action" />
</form>
@@ -113,23 +109,23 @@
</page>
<page string="History" groups="base.group_extended">
<group col="2" colspan="2">
<separator colspan="2" string="Date"/>
<field name="create_date"/>
<field name="write_date" />
<field name="date_closed"/>
<field name="date_open"/>
<separator colspan="2" string="Date"/>
<field name="create_date"/>
<field name="write_date" />
<field name="date_closed"/>
<field name="date_open"/>
</group>
<group colspan="2" col="2">
<separator string="Statistics" colspan="2" col="2"/>
<field name="day_open"/>
<field name="day_close"/>
<field name="working_hours_open" widget="float_time"/>
<field name="working_hours_close" widget="float_time"/>
<separator string="Statistics" colspan="2" col="2"/>
<field name="day_open"/>
<field name="day_close"/>
<field name="working_hours_open" widget="float_time"/>
<field name="working_hours_close" widget="float_time"/>
</group>
<group colspan="2" col="2">
<separator string="References" colspan="2"/>
<field name="id"/>
<field name="active"/>
<separator string="References" colspan="2"/>
<field name="id"/>
<field name="active"/>
</group>
<field name="log_ids" nolabel="1" colspan="4">
<tree string="Logs">
@@ -149,6 +145,7 @@
</form>
</field>
</record>
<record model="ir.ui.view" id="project_issue_tree_view">
<field name="name">Project Issue Tracker Tree</field>
<field name="model">project.issue</field>
@@ -162,11 +159,9 @@
<field name="partner_id"/>
<field name="priority" string="Severity"/>
<field name="stage_id" string="Resolution"/>
<button icon="gtk-go-back" string=""
name="stage_previous" type="object"
<button icon="gtk-go-back" string="" name="stage_previous" type="object"
states="open,draft,pending,done,cancel" />
<button icon="gtk-go-forward" string=""
name="stage_next" type="object"
<button icon="gtk-go-forward" string="" name="stage_next" type="object"
states="open,draft,pending,done,cancel" />
<field name="type_id" string="Version"/>
<field name="user_id"/>
@@ -193,14 +188,9 @@
<filter string="In Progress" domain="[('state','=','open')]" help="Open Issues" icon="terp-camera_test"/>
<filter string="Pending" domain="[('state','=','pending')]" help="Pending Issues" icon="terp-gtk-media-pause"/>
<separator orientation="vertical"/>
<filter icon="terp-go-today" string=" Today "
separator="1"
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
help="Today's bugs"
/>
<filter icon="terp-go-week"
string=" 7 Days " separator="1"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')), ('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
<filter icon="terp-go-today" string=" Today " separator="1" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]" help="Today's bugs" />
<filter icon="terp-go-week" string=" 7 Days " separator="1"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')), ('date', '&gt;=', (datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Bugs during last 7 days"
/>
<separator orientation="vertical"/>
@@ -260,11 +250,9 @@
<field name="partner_id"/>
<field name="priority" string="Severity"/>
<field name="stage_id" string="Resolution"/>
<button icon="gtk-go-back" string=""
name="stage_previous" type="object"
<button icon="gtk-go-back" string="" name="stage_previous" type="object"
states="open,draft,pending,done,cancel" />
<button icon="gtk-go-forward" string=""
name="stage_next" type="object"
<button icon="gtk-go-forward" string="" name="stage_next" type="object"
states="open,draft,pending,done,cancel" />
<field name="type_id" string="Version"/>
<field name="user_id"/>
@@ -286,16 +274,10 @@
<field name="arch" type="xml">
<search string="Feature Tracker Search">
<group>
<filter icon="terp-go-today" string=" Today "
separator="1"
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
help="Today's features"
/>
<filter icon="terp-go-week"
string=" 7 Days " separator="1"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')), ('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Features during last 7 days"
/>
<filter icon="terp-go-today" string=" Today " separator="1"
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]" help="Today's features"/>
<filter icon="terp-go-week" string=" 7 Days " separator="1"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')), ('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" help="Features during last 7 days"/>
</group>
<separator orientation="vertical"/>
<group>
@@ -306,7 +288,6 @@
<filter icon="terp-camera_test" domain="[('state','=','open')]" help="Open Features"/>
</field>
<field name="project_id" select="1" string="Project"/>
</group>
</search>
</field>
@@ -13,7 +13,9 @@ class project_issue_report(osv.osv):
_name = "project.issue.report"
_auto = False
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
def _get_data(self, cr, uid, ids, field_name, arg, context=None):
if context is None:
context = {}
""" @param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of case and section Datas IDs
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<data noupdate="1">
<record id="group_project_supporter" model="res.groups">
<field name="name">Project / Support Manager</field>
+7 -7
View File
@@ -25,22 +25,22 @@
'name': 'Add the Timesheet support for Issue Management in Project Management',
'version': '1.0',
'category': 'Generic Modules/CRM & SRM',
'description': """
This module adds the Timesheet support for the Issues/Bugs Management in Project
""",
'description': """
This module adds the Timesheet support for the Issues/Bugs Management in Project
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': [
'project_issue',
'hr_timesheet_sheet',
],
],
'init_xml': [
],
],
'update_xml': [
'project_issue_sheet_view.xml',
],
],
'demo_xml': [
],
],
'installable': True,
'active': False,
}
@@ -24,25 +24,30 @@ from tools.translate import _
class project_issue(osv.osv):
_inherit = 'project.issue'
_description = 'project issue'
_columns = {
'timesheet_ids' : fields.one2many('hr.analytic.timesheet', 'issue_id', 'Timesheets'),
'analytic_account_id': fields.related('project_id','category_id',string='Analytic Account')
'timesheet_ids': fields.one2many('hr.analytic.timesheet', 'issue_id', 'Timesheets'),
'analytic_account_id': fields.related('project_id', 'category_id', string='Analytic Account')
}
project_issue()
class account_analytic_line(osv.osv):
_inherit = 'account.analytic.line'
_description = 'account analytic line'
_columns = {
'create_date' : fields.datetime('Create Date', readonly=True),
}
}
account_analytic_line()
class hr_analytic_issue(osv.osv):
_inherit = 'hr.analytic.timesheet'
_description = 'hr analytic timesheet'
_columns = {
'issue_id' : fields.many2one('project.issue', 'Issue'),
}
hr_analytic_issue()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -17,7 +17,6 @@
<field name="account_id" invisible="0" domain="[('partner_id', '=', parent.partner_id)]" on_change="on_change_account_id(account_id)"/>
<field name="name"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>
<field invisible="1" name="journal_id"/>
<field invisible="1" name="product_id"/>
<field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
+1 -1
View File
@@ -22,4 +22,4 @@
import project_long_term
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+9 -8
View File
@@ -18,13 +18,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name" : "Long Term Project Management",
"name": "Long Term Project Management",
"version": "1.1",
"author" : "Tiny",
"website" : "http://www.openerp.com",
"category" : "Generic Modules/Projects & Services",
"depends" : ["project", "resource"],
"author": "Tiny",
"website": "http://www.openerp.com",
"category": "Generic Modules/Projects & Services",
"depends": ["project", "resource"],
"description": """
Long Term Project management module that tracks planning, scheduling, resources allocation.
@@ -36,9 +37,9 @@
- Schedule Tasks: All the tasks which are in draft,pending and open state are scheduled with taking the phase's start date
""",
"init_xml" : [],
"demo_xml" : ["project_long_term_demo.xml"],
"test" : [
"init_xml": [],
"demo_xml": ["project_long_term_demo.xml"],
"test": [
'test/schedule_project_phases.yml',
'test/schedule_project_tasks.yml',
'test/schedule_phase_tasks.yml'
+21 -14
View File
@@ -29,7 +29,10 @@ class project_phase(osv.osv):
_name = "project.phase"
_description = "Project Phase"
def _check_recursion(self, cr, uid, ids, context={}):
def _check_recursion(self, cr, uid, ids, context=None):
if context is None:
context = {}
data_phase = self.browse(cr, uid, ids[0], context=context)
prev_ids = data_phase.previous_phase_ids
next_ids = data_phase.next_phase_ids
@@ -45,7 +48,7 @@ class project_phase(osv.osv):
next_ids = [rec.id for rec in next_ids]
# iter prev_ids
while prev_ids:
cr.execute('select distinct prv_phase_id from project_phase_rel where next_phase_id IN %s',(tuple(prev_ids),))
cr.execute('SELECT distinct prv_phase_id FROM project_phase_rel WHERE next_phase_id IN %s', (tuple(prev_ids),))
prv_phase_ids = filter(None, map(lambda x: x[0], cr.fetchall()))
if data_phase.id in prv_phase_ids:
return False
@@ -55,7 +58,7 @@ class project_phase(osv.osv):
prev_ids = prv_phase_ids
# iter next_ids
while next_ids:
cr.execute('select distinct next_phase_id from project_phase_rel where prv_phase_id IN %s',(tuple(next_ids),))
cr.execute('SELECT distinct next_phase_id FROM project_phase_rel WHERE prv_phase_id IN %s', (tuple(next_ids),))
next_phase_ids = filter(None, map(lambda x: x[0], cr.fetchall()))
if data_phase.id in next_phase_ids:
return False
@@ -65,19 +68,19 @@ class project_phase(osv.osv):
next_ids = next_phase_ids
return True
def _check_dates(self, cr, uid, ids, context={}):
def _check_dates(self, cr, uid, ids, context=None):
for phase in self.read(cr, uid, ids, ['date_start', 'date_end'], context=context):
if phase['date_start'] and phase['date_end'] and phase['date_start'] > phase['date_end']:
return False
return True
def _check_constraint_start(self, cr, uid, ids, context={}):
def _check_constraint_start(self, cr, uid, ids, context=None):
phase = self.read(cr, uid, ids[0], ['date_start', 'constraint_date_start'], context=context)
if phase['date_start'] and phase['constraint_date_start'] and phase['date_start'] < phase['constraint_date_start']:
return False
return True
def _check_constraint_end(self, cr, uid, ids, context={}):
def _check_constraint_end(self, cr, uid, ids, context=None):
phase = self.read(cr, uid, ids[0], ['date_end', 'constraint_date_end'], context=context)
if phase['date_end'] and phase['constraint_date_end'] and phase['date_end'] > phase['constraint_date_end']:
return False
@@ -97,7 +100,7 @@ class project_phase(osv.osv):
'product_uom': fields.many2one('product.uom', 'Duration UoM', required=True, help="UoM (Unit of Measure) is the unit of measurement for Duration"),
'task_ids': fields.one2many('project.task', 'phase_id', "Project Tasks"),
'resource_ids': fields.one2many('project.resource.allocation', 'phase_id', "Project Resources"),
'responsible_id':fields.many2one('res.users', 'Responsible'),
'responsible_id': fields.many2one('res.users', 'Responsible'),
'state': fields.selection([('draft', 'Draft'), ('open', 'In Progress'), ('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True,
help='If the phase is created the state \'Draft\'.\n If the phase is started, the state becomes \'In Progress\'.\n If review is needed the phase is in \'Pending\' state.\
\n If the phase is over, the states is set to \'Done\'.')
@@ -116,7 +119,7 @@ class project_phase(osv.osv):
#(_check_constraint_end, 'Phase must end-before constraint end Date.', ['date_end', 'constraint_date_end']),
]
def onchange_project(self, cr, uid, ids, project, context={}):
def onchange_project(self, cr, uid, ids, project, context=None):
result = {}
project_obj = self.pool.get('project.project')
if project:
@@ -126,7 +129,9 @@ class project_phase(osv.osv):
return {'value': result}
return {'value': {'date_start': []}}
def _check_date_start(self, cr, uid, phase, date_end, context={}):
def _check_date_start(self, cr, uid, phase, date_end, context=None):
if context is None:
context = {}
"""
Check And Compute date_end of phase if change in date_start < older time.
"""
@@ -147,7 +152,9 @@ class project_phase(osv.osv):
dt_start = work_times[0][0].strftime('%Y-%m-%d %H:%M:%S')
self.write(cr, uid, [phase.id], {'date_start': dt_start, 'date_end': date_end.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
def _check_date_end(self, cr, uid, phase, date_start, context={}):
def _check_date_end(self, cr, uid, phase, date_start, context=None):
if context is None:
context = {}
"""
Check And Compute date_end of phase if change in date_end > older time.
"""
@@ -168,11 +175,11 @@ class project_phase(osv.osv):
dt_end = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
self.write(cr, uid, [phase.id], {'date_start': date_start.strftime('%Y-%m-%d %H:%M:%S'), 'date_end': dt_end}, context=context)
def write(self, cr, uid, ids, vals, context={}):
def write(self, cr, uid, ids, vals, context=None):
resource_calendar_obj = self.pool.get('resource.calendar')
resource_obj = self.pool.get('resource.resource')
uom_obj = self.pool.get('product.uom')
if not context:
if context is None:
context = {}
if context.get('scheduler',False):
return super(project_phase, self).write(cr, uid, ids, vals, context=context)
@@ -191,7 +198,7 @@ class project_phase(osv.osv):
# Change the date_start and date_end
# for previous and next phases respectively based on valid condition
if vals.get('date_start', False) and vals['date_start'] < phase.date_start:
dt_start = mx.DateTime.strptime(vals['date_start'],'%Y-%m-%d %H:%M:%S')
dt_start = mx.DateTime.strptime(vals['date_start'], '%Y-%m-%d %H:%M:%S')
work_times = resource_calendar_obj.interval_get(cr, uid, calendar_id, dt_start, avg_hours or 0.0, resource_id and resource_id[0] or False)
if work_times:
vals['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
@@ -214,7 +221,7 @@ class project_phase(osv.osv):
self.write(cr, uid, ids, {'state': 'open'})
return True
def set_pending(self, cr, uid, ids,*args):
def set_pending(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state': 'pending'})
return True
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Requests Links -->
<record id="req_link_project" model="res.request.link">
<field name="name">Project</field>
@@ -10,5 +11,6 @@
<field name="name">Project task</field>
<field name="object">project.task</field>
</record>
</data>
</openerp>
@@ -8,151 +8,151 @@
<field name="address_id" ref="base.main_address"/>
<field name="context_lang">en_US</field>
<field name="name">Demo User1</field>
<field eval="[(6,0,[ref('base.group_user')])]" name="groups_id"/>
<field eval="[(6, 0, [ref('base.group_user')])]" name="groups_id"/>
<field name="signature">Mr Demo</field>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Setup')]"/>
<field name="login">demo1</field>
<field name="password">demo1</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<record id="res_users_manager0" model="res.users">
<field model="ir.actions.actions" name="menu_id" search="[('name', '=', u'Menu')]"/>
<field name="context_lang">en_US</field>
<field name="name">Manager1</field>
<field eval="[(6,0,[ref('base.group_user'),ref('project.group_project_manager')])]" name="groups_id"/>
<field eval="[(6, 0, [ref('base.group_user'), ref('project.group_project_manager')])]" name="groups_id"/>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Menu')]"/>
<field name="login">manager1</field>
<field name="password">manager1</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<record id="res_users_manager1" model="res.users">
<field model="ir.actions.actions" name="menu_id" search="[('name', '=', u'Menu')]"/>
<field name="context_lang">en_US</field>
<field name="name">Manager2</field>
<field eval="[(6,0,[ref('base.group_user'),ref('project.group_project_manager')])]" name="groups_id"/>
<field eval="[(6, 0, [ref('base.group_user'), ref('project.group_project_manager')])]" name="groups_id"/>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Menu')]"/>
<field name="login">manager2</field>
<field name="password">manager2</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<record id="res_users_user0" model="res.users">
<field model="ir.actions.actions" name="menu_id" search="[('name', '=', u'Menu')]"/>
<field name="context_lang">en_US</field>
<field name="name">user1</field>
<field eval="[(6,0,[ref('base.group_user'),ref('project.group_project_user')])]" name="groups_id"/>
<field eval="[(6, 0, [ref('base.group_user'), ref('project.group_project_user')])]" name="groups_id"/>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Menu')]"/>
<field name="login">user1</field>
<field name="password">USER1</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<record id="res_users_user1" model="res.users">
<field model="ir.actions.actions" name="menu_id" search="[('name', '=', u'Menu')]"/>
<field name="context_lang">en_US</field>
<field name="name">user2</field>
<field eval="[(6,0,[ref('base.group_user'),ref('project.group_project_user')])]" name="groups_id"/>
<field eval="[(6, 0, [ref('base.group_user'), ref('project.group_project_user')])]" name="groups_id"/>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Menu')]"/>
<field name="login">user2</field>
<field name="password">user2</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<record id="res_users_userfinance0" model="res.users">
<field model="ir.actions.actions" name="menu_id" search="[('name', '=', u'Menu')]"/>
<field name="context_lang">en_US</field>
<field name="name">user_finance</field>
<field eval="[(6,0,[ref('base.group_user'),ref('project.group_project_finance')])]" name="groups_id"/>
<field eval="[(6, 0, [ref('base.group_user'), ref('project.group_project_finance')])]" name="groups_id"/>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Menu')]"/>
<field name="login">user_finance</field>
<field name="password">user_finance</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<record id="res_users_userdesign0" model="res.users">
<field model="ir.actions.actions" name="menu_id" search="[('name', '=', u'Menu')]"/>
<field name="context_lang">en_US</field>
<field name="name">user_design1</field>
<field eval="[(6,0,[ref('base.group_user')])]" name="groups_id"/>
<field eval="[(6, 0, [ref('base.group_user')])]" name="groups_id"/>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Menu')]"/>
<field name="login">user_design1</field>
<field name="password">user_design1</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<record id="res_users_userdesign1" model="res.users">
<field model="ir.actions.actions" name="menu_id" search="[('name', '=', u'Menu')]"/>
<field name="context_lang">en_US</field>
<field name="name">user_design2</field>
<field eval="[(6,0,[ref('base.group_user')])]" name="groups_id"/>
<field eval="[(6, 0, [ref('base.group_user')])]" name="groups_id"/>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Menu')]"/>
<field name="login">user_design2</field>
<field name="password">user_design2</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<record id="res_users_userdeveloper0" model="res.users">
<field model="ir.actions.actions" name="menu_id" search="[('name', '=', u'Menu')]"/>
<field name="context_lang">en_US</field>
<field name="name">user_developer1</field>
<field eval="[(6,0,[ref('base.group_user')])]" name="groups_id"/>
<field eval="[(6, 0, [ref('base.group_user')])]" name="groups_id"/>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Menu')]"/>
<field name="login">user_developer1</field>
<field name="password">user_developer1</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<record id="res_users_userdeveloper1" model="res.users">
<field model="ir.actions.actions" name="menu_id" search="[('name', '=', u'Menu')]"/>
<field name="context_lang">en_US</field>
<field name="name">user_developer2</field>
<field eval="[(6,0,[ref('base.group_user')])]" name="groups_id"/>
<field eval="[(6, 0, [ref('base.group_user')])]" name="groups_id"/>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Menu')]"/>
<field name="login">user_developer2</field>
<field name="password">user_developer1</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<record id="res_users_usertester0" model="res.users">
@@ -161,43 +161,43 @@
<field name="name">user_tester1</field>
<field eval="[(6,0,[ref('base.group_user')])]" name="groups_id"/>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Menu')]"/>
<field name="login">user_tester1</field>
<field name="password">user_tester1</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<record id="res_users_usertester1" model="res.users">
<field model="ir.actions.actions" name="menu_id" search="[('name', '=', u'Menu')]"/>
<field name="context_lang">en_US</field>
<field name="name">user_tester2</field>
<field eval="[(6,0,[ref('base.group_user')])]" name="groups_id"/>
<field eval="[(6, 0, [ref('base.group_user')])]" name="groups_id"/>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Menu')]"/>
<field name="login">user_tester2</field>
<field name="password">user_tester2</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<record id="res_users_useranalyst0" model="res.users">
<field model="ir.actions.actions" name="menu_id" search="[('name', '=', u'Menu')]"/>
<field name="context_lang">en_US</field>
<field name="name">user_analyst</field>
<field eval="[(6,0,[ref('base.group_user')])]" name="groups_id"/>
<field eval="[(6, 0, [ref('base.group_user')])]" name="groups_id"/>
<field name="company_id" ref="base.main_company"/>
<field eval="[(6,0,[])]" name="roles_id"/>
<field eval="[(6,0,[])]" name="rules_id"/>
<field eval="[(6, 0, [])]" name="roles_id"/>
<field eval="[(6, 0, [])]" name="rules_id"/>
<field eval="1" name="active"/>
<field model="ir.actions.actions" name="action_id" search="[('name', '=', u'Menu')]"/>
<field name="login">user_analyst</field>
<field name="password">user_analyst</field>
<field eval="[(6,0,[])]" name="company_ids"/>
<field eval="[(6, 0, [])]" name="company_ids"/>
</record>
<!-- Resources -->
@@ -255,17 +255,17 @@
<field name="state">open</field>
<field name="type">normal</field>
<field name="description">Develop an OpenERP Website.</field>
<field eval="[(6,0,[ref('res_users_manager0'),ref('res_users_user0'),ref('res_users_userfinance0'),ref('res_users_userdesign0'),ref('res_users_userdeveloper0'),ref('res_users_usertester0'),ref('res_users_useranalyst0')])]" name="members"/>
<field eval="[(6, 0, [ref('res_users_manager0'), ref('res_users_user0'), ref('res_users_userfinance0'), ref('res_users_userdesign0'), ref('res_users_userdeveloper0'), ref('res_users_usertester0'), ref('res_users_useranalyst0')])]" name="members"/>
<field name="date">2010-04-30</field>
<field name="user_id" ref="base.user_root"/>
<field name="currency_id" ref="base.EUR"/>
<field eval="[(6,0,[])]" name="type_ids"/>
<field eval="[(6, 0, [])]" name="type_ids"/>
<field name="name">OpenERP Website Development</field>
</record>
<!-- Project Phases -->
<record id="project_phase_informationgatheringandunderstanding0" model="project.phase">
<field eval="[(6,0,[])]" name="previous_phase_ids"/>
<field eval="[(6, 0, [])]" name="previous_phase_ids"/>
<field name="name">Information Gathering and Understanding</field>
<field name="product_uom" ref="product.uom_day"/>
<field eval="10" name="sequence"/>
@@ -280,7 +280,7 @@
</record>
<record id="project_phase_planning0" model="project.phase">
<field eval="[(6,0,[ref('project_phase_informationgatheringandunderstanding0')])]" name="previous_phase_ids"/>
<field eval="[(6, 0, [ref('project_phase_informationgatheringandunderstanding0')])]" name="previous_phase_ids"/>
<field name="name">Planning</field>
<field name="product_uom" ref="product.uom_day"/>
<field eval="10" name="sequence"/>
@@ -295,7 +295,7 @@
</record>
<record id="project_phase_webdesign0" model="project.phase">
<field eval="[(6,0,[ref('project_phase_informationgatheringandunderstanding0'),ref('project_phase_planning0')])]" name="previous_phase_ids"/>
<field eval="[(6, 0, [ref('project_phase_informationgatheringandunderstanding0'), ref('project_phase_planning0')])]" name="previous_phase_ids"/>
<field name="name">Web Design </field>
<field name="product_uom" ref="product.uom_day"/>
<field eval="10" name="sequence"/>
@@ -310,7 +310,7 @@
</record>
<record id="project_phase_developmentintegrationandtesting0" model="project.phase">
<field eval="[(6,0,[ref('project_phase_informationgatheringandunderstanding0'),ref('project_phase_planning0'),ref('project_phase_webdesign0')])]" name="previous_phase_ids"/>
<field eval="[(6, 0, [ref('project_phase_informationgatheringandunderstanding0'), ref('project_phase_planning0'), ref('project_phase_webdesign0')])]" name="previous_phase_ids"/>
<field name="name">Development, Integration and Testing</field>
<field name="product_uom" ref="product.uom_day"/>
<field eval="10" name="sequence"/>
@@ -325,7 +325,7 @@
</record>
<record id="project_phase_websitedeployment0" model="project.phase">
<field eval="[(6,0,[ref('project_phase_informationgatheringandunderstanding0'),ref('project_phase_planning0'),ref('project_phase_webdesign0'),ref('project_phase_developmentintegrationandtesting0')])]" name="previous_phase_ids"/>
<field eval="[(6, 0, [ref('project_phase_informationgatheringandunderstanding0'), ref('project_phase_planning0'), ref('project_phase_webdesign0'), ref('project_phase_developmentintegrationandtesting0')])]" name="previous_phase_ids"/>
<field name="name">Website Deployment</field>
<field name="product_uom" ref="product.uom_day"/>
<field eval="10" name="sequence"/>
@@ -403,10 +403,9 @@
<field name="date_start">2010-02-24 05:00:00</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Prepare Requirements Document</field>
<field name="date_deadline">2010-03-08</field>
@@ -422,10 +421,9 @@
<field name="date_start">2010-02-25 15:38:08</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Define Website Goals, Purposes and Target Audience</field>
<field name="date_deadline">2010-03-04</field>
@@ -441,10 +439,9 @@
<field name="date_start">2010-02-25 15:42:42</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Use Cases</field>
<field name="date_deadline">2010-03-10</field>
@@ -460,10 +457,9 @@
<field name="date_start">2010-02-25 15:51:00</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Budget Planning</field>
<field name="date_deadline">2010-03-31</field>
@@ -479,10 +475,9 @@
<field name="date_start">2010-02-25 15:54:42</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Quality Planning</field>
<field name="date_deadline">2010-03-31</field>
@@ -498,10 +493,9 @@
<field name="date_start">2010-02-25 15:55:11</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Risk Management Planning</field>
<field name="date_deadline">2010-03-31</field>
@@ -517,10 +511,9 @@
<field name="date_start">2010-02-25 15:57:48</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Create Project Schedules</field>
<field name="date_deadline">2010-03-31</field>
@@ -536,10 +529,9 @@
<field name="date_start">2010-02-25 16:04:16</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Dataflow Design</field>
<field name="date_deadline">2010-04-02</field>
@@ -555,10 +547,9 @@
<field name="date_start">2010-02-25 16:05:43</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">User Interface Design</field>
<field name="date_deadline">2010-04-10</field>
@@ -574,10 +565,9 @@
<field name="date_start">2010-02-25 16:06:52</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Task Level WBS</field>
<field name="date_deadline">2010-04-07</field>
@@ -593,10 +583,9 @@
<field name="date_start">2010-02-25 16:11:40</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Modular Programming</field>
<field name="date_deadline">2010-04-22</field>
@@ -611,10 +600,9 @@
<field name="date_start">2010-02-25 16:13:10</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Integrate Modules</field>
<field name="date_deadline">2010-04-24</field>
@@ -629,10 +617,9 @@
<field name="date_start">2010-02-25 16:14:32</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Unit Testing</field>
<field name="date_deadline">2010-04-24</field>
@@ -647,10 +634,9 @@
<field name="date_start">2010-02-25 16:15:38</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Regression Test</field>
<field name="date_deadline">2010-04-24</field>
@@ -665,10 +651,9 @@
<field name="date_start">2010-02-25 16:17:04</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Documentation</field>
<field name="date_deadline">2010-04-24</field>
@@ -683,10 +668,9 @@
<field name="date_start">2010-02-25 16:17:42</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Performance Tuning</field>
<field name="date_deadline">2010-04-24</field>
@@ -701,10 +685,9 @@
<field name="date_start">2010-02-25 16:21:15</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Deploy Website</field>
<field name="date_deadline">2010-04-26</field>
@@ -719,10 +702,9 @@
<field name="date_start">2010-02-25 16:22:09</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Presentation</field>
<field name="date_deadline">2010-04-28</field>
@@ -737,10 +719,9 @@
<field name="date_start">2010-02-25 16:36:02</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Deployment</field>
<field name="date_deadline">2010-04-28</field>
@@ -756,10 +737,9 @@
<field name="date_start">2010-02-25 16:36:43</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Presentation</field>
<field name="date_deadline">2010-04-29</field>
@@ -775,10 +755,9 @@
<field name="date_start">2010-02-25 17:22:46</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Modules Integration</field>
<field name="date_deadline">2010-04-24</field>
@@ -794,10 +773,9 @@
<field name="date_start">2010-02-25 17:34:32</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Unit Testing</field>
<field name="date_deadline">2010-04-24</field>
@@ -813,10 +791,9 @@
<field name="date_start">2010-02-25 17:35:46</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Modular Testing</field>
<field name="date_deadline">2010-04-24</field>
@@ -832,10 +809,9 @@
<field name="date_start">2010-02-25 17:36:27</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Documentation</field>
<field name="date_deadline">2010-04-28</field>
@@ -851,10 +827,9 @@
<field name="date_start">2010-02-25 17:37:03</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Performance Tuning</field>
<field name="date_deadline">2010-04-27</field>
@@ -871,10 +846,9 @@
<field name="date_start">2010-03-01 12:00:00</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="[(6,0,[])]" name="parent_ids"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Modular Programming</field>
<field name="date_deadline">2010-04-22</field>
@@ -882,5 +856,6 @@
<field eval="100.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_developmentintegrationandtesting0"/>
</record>
</data>
</openerp>
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report auto="False" id="report_project_task_gantt" model="project.task" name="project.tasks.gantt" string="Gantt Representation"/>
<report auto="False" id="report_project_project_gantt" model="project.project" name="project.project.gantt" string="Gantt Representation"/>
</data>
</openerp>
@@ -6,7 +6,7 @@
<!--<wizard id="wizard_schedule_task" menu="False" model="project.phase" name="phase.schedule.tasks" string="Schedule Tasks"/>-->
<!--<wizard id="wizard_compute_task" model="project.task" menu="False" name="wizard.compute.tasks" string="Compute Task Scheduling"/>-->
<!-- <menuitem icon="terp-project" id="base.menu_main" name="Project Management" sequence="1"/>-->
<!--<menuitem icon="terp-project" id="base.menu_main" name="Project Management" sequence="1"/>-->
<!--<menuitem id="base.menu_pm_planning" name="Planning" parent="base.menu_main" sequence="3"/>-->
<!-- <menuitem
action="wizard_compute_phase"
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="wkf_phase" model="workflow">
<field name="name">project.phase.wkf</field>
<field name="osv">project.phase</field>
@@ -104,5 +105,6 @@
<field name="act_to" ref="act_draft"/>
<field name="signal">set_draft</field>
</record>
</data>
</openerp>
</openerp>
@@ -25,4 +25,3 @@ import project_schedule_tasks
import working_calendar
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import datetime
from resource.faces import *
from new import classobj
@@ -48,6 +49,8 @@ class project_compute_phases(osv.osv_memory):
return self.compute_date(cr, uid, ids, context=context)
def _phase_schedule(self, cr, uid, phase, start_date, calendar_id=False, context=None):
if context is None:
context = {}
"""Schedule phase with the start date till all the next phases are completed.
Arguements: start_dsate -- start date for the phase
@@ -118,7 +121,7 @@ class project_compute_phases(osv.osv_memory):
context=ctx)
# Recursive call till all the next phases scheduled
for phase in phase.next_phase_ids:
if phase.state in ['draft','open','pending']:
if phase.state in ['draft', 'open', 'pending']:
id_cal = phase.project_id.resource_calendar_id and phase.project_id.resource_calendar_id.id or False
self._phase_schedule(cr, uid, phase, date_start, id_cal, context=context)
else:
@@ -9,20 +9,20 @@
<field name="arch" type="xml">
<form string="Compute Scheduling of Phases">
<group width="380" height="180">
<group colspan="4" col="4">
<label colspan="4" string="This wizard will schedule phases for all or specified project" />
<newline />
<field name="target_project" colspan="4"/>
</group>
<newline />
<group colspan="4" col="6" attrs="{'invisible':[('target_project','=','all')]}">
<field name="project_id"/>
</group>
<separator colspan="4"/>
<group colspan="4" col="6"> <!-- Improve me -->
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
<button icon="gtk-ok" name="check_selection" string="_Compute" type="object"/>
</group>
<group colspan="4" col="4">
<label colspan="4" string="This wizard will schedule phases for all or specified project" />
<newline />
<field name="target_project" colspan="4"/>
</group>
<newline />
<group colspan="4" col="6" attrs="{'invisible':[('target_project','=','all')]}">
<field name="project_id"/>
</group>
<separator colspan="4"/>
<group colspan="4" col="6"> <!-- Improve me -->
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
<button icon="gtk-ok" name="check_selection" string="_Compute" type="object"/>
</group>
</group>
</form>
</field>
@@ -35,7 +35,7 @@
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_project_compute_phases_select"/>
<field name="context">{'record_id' : active_id}</field>
<field name="context">{'record_id': active_id}</field>
<field name="target">new</field>
</record>
@@ -43,4 +43,4 @@
parent="menu_phase_schedule" action="action_project_compute_phases"/>
</data>
</openerp>
</openerp>
@@ -69,7 +69,7 @@ class project_compute_tasks(osv.osv_memory):
resource_id = resource_obj.search(cr, uid, [('user_id', '=', user.id)], context=context)
if resource_id:
# resource = resource_obj.browse(cr, uid, resource_id, context=context)[0]
resource = resource_obj.read(cr, uid, resource_id, ['calendar_id','time_efficiency'], context=context)[0]
resource = resource_obj.read(cr, uid, resource_id, ['calendar_id', 'time_efficiency'], context=context)[0]
if resource.get('calendar_id', False):
leaves = wkcal.compute_leaves(cr, uid, calendar_id , resource_id[0], resource['calendar_id'] and resource['calendar_id'][0] or False)
time_efficiency = resource.get('time_efficiency')
@@ -126,7 +126,7 @@ class project_compute_tasks(osv.osv_memory):
s_date = t.start.to_datetime()
e_date = t.end.to_datetime()
if loop_no == 0:
project_obj.write(cr, uid, [project_id], {'date' : e_date}, context=context)
project_obj.write(cr, uid, [project_id], {'date': e_date}, context=context)
else:
ctx = context.copy()
ctx.update({'scheduler': True})
@@ -34,4 +34,4 @@
parent="menu_phase_schedule" action="action_project_compute_tasks"/>
</data>
</openerp>
</openerp>
@@ -40,6 +40,8 @@ class project_schedule_task(osv.osv_memory):
}
def default_get(self, cr, uid, fields_list, context=None):
if context is None:
context = {}
res = super(project_schedule_task, self).default_get(cr, uid, fields_list, context)
self.compute_date(cr, uid, context=context)
return res
@@ -70,6 +72,8 @@ class project_schedule_task(osv.osv_memory):
return resource_objs
def compute_date(self, cr, uid, context=None):
if context is None:
context = {}
"""
Schedule the tasks according to resource available and priority.
"""
@@ -152,7 +156,7 @@ class project_schedule_task(osv.osv_memory):
'date_end': e_date.strftime('%Y-%m-%d %H:%M:%S'),
'user_id': user_id[0]},
context=ctx)
loop_no +=1
loop_no += 1
return {}
project_schedule_task()
@@ -25,9 +25,9 @@
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_project_schedule_tasks"/>
<field name="context">{'record_id' : active_id}</field>
<field name="context">{'record_id': active_id}</field>
<field name="target">new</field>
</record>
</data>
</openerp>
</openerp>
@@ -18,21 +18,27 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import datetime
import pooler
def convert_timeformat(cr, uid, time_string, context={}):
def convert_timeformat(cr, uid, time_string, context=None):
if context is None:
context = {}
""" Convert input time string: 8.5 to output time string 8:30."""
split_list = str(time_string).split('.')
hour_part = split_list[0]
mins_part = split_list[1]
round_mins = int(round(float(mins_part) * 60,-2))
round_mins = int(round(float(mins_part) * 60,-2))
converted_string = hour_part + ':' + str(round_mins)[0:2]
return converted_string
def compute_leaves(cr, uid, calendar_id, resource_id=False, resource_calendar=False, context={}):
def compute_leaves(cr, uid, calendar_id, resource_id=False, resource_calendar=False, context=None):
if context is None:
context = {}
"""Compute the leaves from the working calendar of the resource.
@@ -63,7 +69,10 @@ def compute_leaves(cr, uid, calendar_id, resource_id=False, resource_calendar=Fa
leave_list.sort()
return leave_list
def compute_working_calendar(cr, uid, calendar_id, context={}):
def compute_working_calendar(cr, uid, calendar_id, context=None):
if context is None:
context = {}
"""Change the format of working calendar from 'Openerp' format to bring it into 'Faces' format.
@@ -103,7 +112,7 @@ def compute_working_calendar(cr, uid, calendar_id, context={}):
for k,v in wk_time.items():
wktime_cal.append(tuple(v))
# Add for the non-working days like: [('sat, sun', '8:00-8:00')]
for k,v in wk_days.items():
for k, v in wk_days.items():
if week_days.has_key(k):
week_days.pop(k)
for v in week_days.itervalues():
@@ -111,4 +120,4 @@ def compute_working_calendar(cr, uid, calendar_id, context={}):
if non_working:
wktime_cal.append((non_working[:-1], time_range))
return wktime_cal
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+4 -4
View File
@@ -21,10 +21,10 @@
{
"name" : "In-Project Messaging System",
"version" : "1.0",
"depends" : ["project"],
"author" : "Tiny",
"name": "In-Project Messaging System",
"version": "1.0",
"depends": ["project"],
"author": "Tiny",
"description": """
This module provides the functionality to send messages within a project.'
A user can send messages individually to other user also he can broadcast
+9 -8
View File
@@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
import netsvc
@@ -29,16 +30,15 @@ class messages(osv.osv):
logger = netsvc.Logger()
_columns = {
'from_id':fields.many2one('res.users', 'From', ondelete="CASCADE"),
'to_id':fields.many2one('res.users', 'To', ondelete="CASCADE"),
'project_id':fields.many2one('project.project', 'Project',
'from_id': fields.many2one('res.users', 'From', ondelete="CASCADE"),
'to_id': fields.many2one('res.users', 'To', ondelete="CASCADE"),
'project_id': fields.many2one('project.project', 'Project',
required=True, ondelete="CASCADE"),
'message':fields.text('Message', required=True),
'message': fields.text('Message', required=True),
}
_defaults = {
'from_id':lambda self, cr, uid, context: uid,
'to_id':None,
'from_id': lambda self, cr, uid, context: uid,
'to_id': None,
}
def broadcast(self, cr, uid, project_id, message, context=None):
@@ -67,6 +67,7 @@ class project_with_message(osv.osv):
'project.messages', 'project_id', 'Messages',
domain="[('to_id','in',[uid,False])]"),
}
project_with_message()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-1
View File
@@ -21,4 +21,3 @@
import mrp
import project_mrp
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+22 -18
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,35 +15,38 @@
# 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/>.
#
##############################################################################
from osv import fields, osv, orm
import tools
class procurement_order(osv.osv):
_name = "procurement.order"
_inherit = "procurement.order"
def action_produce_assign_service(self, cr, uid, ids, context={}):
def action_produce_assign_service(self, cr, uid, ids, context=None):
if context is None:
context = {}
for procurement in self.browse(cr, uid, ids):
sline = self.pool.get('sale.order.line')
content = ''
sale_order = self.pool.get('sale.order')
so_ref = procurement.name.split(':')[0]
order_ids = sale_order.search(cr, uid, [('name','=',so_ref)], context)
order_ids = sale_order.search(cr, uid, [('name', '=', so_ref)], context)
if order_ids:
sale_ids = sale_order.read(cr, uid, order_ids[0],['order_line'],context=context)['order_line']
sale_ids = sale_order.read(cr, uid, order_ids[0], ['order_line'], context=context)['order_line']
else:
so_ref = procurement.origin.split(':')[0]
sale_ids = sline.search(cr, uid, [('procurement_id','=',procurement.id)], context)
sale_ids = sline.search(cr, uid, [('procurement_id', '=',procurement.id)], context)
l = None
project_id = None
analytic_account_id = False
partner_id = False
for line in sline.browse(cr, uid, sale_ids, context=context):
content += (line.notes or '')
l = line
@@ -53,28 +56,28 @@ class procurement_order(osv.osv):
partner_id = line.order_id.partner_id.id
content+="\n\n"+line.order_id.project_id.complete_name
break
# Creating a project for task.Project is created from Procurement.
project_obj = self.pool.get('project.project')
proj_name = tools.ustr(so_ref)
proj_exist_id = project_obj.search(cr, uid, [('name','=',proj_name)], context=context)
proj_exist_id = project_obj.search(cr, uid, [('name', '=', proj_name)], context=context)
if not proj_exist_id:
project_id = project_obj.create(cr, uid, {'name':proj_name, 'partner_id':partner_id})
project_id = project_obj.create(cr, uid, {'name': proj_name, 'partner_id': partner_id})
else:
project_id = proj_exist_id[0]
self.write(cr, uid, [procurement.id], {'state':'running'})
self.write(cr, uid, [procurement.id], {'state': 'running'})
name_task = ('','')
if procurement.product_id.type == 'service':
proc_name = procurement.name
if procurement.origin == proc_name:
proc_name = procurement.product_id.name
name_task = (procurement.origin, proc_name or '')
else:
name_task = (procurement.product_id.name or procurement.origin, procurement.name or '')
task_id = self.pool.get('project.task').create(cr, uid, {
'name': '%s:%s' % name_task,
'date_deadline': procurement.date_planned,
@@ -90,8 +93,9 @@ class procurement_order(osv.osv):
'company_id': procurement.company_id.id,
'project_id': project_id,
},context=context)
return task_id
procurement_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+1 -1
View File
@@ -49,4 +49,4 @@ class project_task(osv.osv):
project_task()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+7 -7
View File
@@ -1,11 +1,11 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="workflow.transition" id="procurement.trans_produce_service_make_done">
<field name="act_from" ref="procurement.act_produce_service"/>
<field name="act_to" ref="procurement.act_make_done"/>
<field name="signal">subflow.done</field>
</record>
</data>
<data>
<record model="workflow.transition" id="procurement.trans_produce_service_make_done">
<field name="act_from" ref="procurement.act_produce_service"/>
<field name="act_to" ref="procurement.act_make_done"/>
<field name="signal">subflow.done</field>
</record>
</data>
</openerp>
-1
View File
@@ -23,4 +23,3 @@ import project_planning
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -13,5 +13,6 @@
</xpath>
</field>
</record>"
</data>
</openerp>
+81 -55
View File
@@ -20,16 +20,17 @@
#
##############################################################################
import time
import mx.DateTime
from osv import fields, osv
from tools.translate import _
import time
import mx.DateTime
class one2many_mod3(fields.one2many):
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
if not context:
context = {}
context = context
res = {}
for obj in obj.browse(cr, user, ids, context=context):
res[obj.id] = []
@@ -48,7 +49,7 @@ class report_account_analytic_planning(osv.osv):
_name = "report_account_analytic.planning"
_description = "Planning"
def _get_total_planned(self, cr, uid, ids, name, args, context):
def _get_total_planned(self, cr, uid, ids, name, args, context=None):
result = {}
for plan in self.browse(cr, uid, ids, context):
plan_hrs=0.0
@@ -59,7 +60,7 @@ class report_account_analytic_planning(osv.osv):
result[plan.id] = plan_hrs
return result
def _get_total_free(self, cr, uid, ids, name, args, context):
def _get_total_free(self, cr, uid, ids, name, args, context=None):
result = {}
for plan in self.browse(cr, uid, ids, context):
total_free = 0.0
@@ -69,7 +70,9 @@ class report_account_analytic_planning(osv.osv):
result[plan.id] = total_free
return result
def _check_planning_responsible(self, cr, uid, ids, context={}):
def _check_planning_responsible(self, cr, uid, ids, context=None):
if context is None:
context = {}
for obj_plan in self.browse(cr, uid, ids, context=context):
cr.execute("""
SELECT id FROM report_account_analytic_planning plan
@@ -92,23 +95,23 @@ class report_account_analytic_planning(osv.osv):
'name': fields.char('Planning Name', required=True, size=32, states={'done':[('readonly', True)]}),
'code': fields.char('Code', size=32, states={'done':[('readonly', True)]}),
'user_id': fields.many2one('res.users', 'Responsible', required=True, states={'done':[('readonly', True)]}),
'date_from':fields.date('Start Date', required=True, states={'done':[('readonly', True)]}),
'date_from': fields.date('Start Date', required=True, states={'done':[('readonly', True)]}),
'date_to':fields.date('End Date', required=True, states={'done':[('readonly', True)]}),
'line_ids': fields.one2many('report_account_analytic.planning.line', 'planning_id', 'Planning lines', states={'done':[('readonly', True)]}),
'stat_ids': fields.one2many('report_account_analytic.planning.stat', 'planning_id', 'Planning analysis', readonly=True),
'state': fields.selection([('draft','Draft'),('open', 'Open'), ('done', 'Done'),('cancel','Cancelled')], 'Status', required=True),
'business_days' : fields.integer('Business Days', required=True, states={'done':[('readonly', True)]}, help='Set here the number of working days within this planning for one person full time'),
'state': fields.selection([('draft', 'Draft'), ('open', 'Open'), ('done', 'Done'), ('cancel', 'Cancelled')], 'Status', required=True),
'business_days': fields.integer('Business Days', required=True, states={'done':[('readonly', True)]}, help='Set here the number of working days within this planning for one person full time'),
'planning_user_ids': one2many_mod3('report_account_analytic.planning.user', 'planning_id', 'Planning By User'),
'planning_account': fields.one2many('report_account_analytic.planning.account', 'planning_id', 'Planning By Account'),
'total_planned' : fields.function(_get_total_planned, method=True, string='Total Planned'),
'total_free' : fields.function(_get_total_free, method=True, string='Total Free'),
'total_planned': fields.function(_get_total_planned, method=True, string='Total Planned'),
'total_free': fields.function(_get_total_free, method=True, string='Total Free'),
}
_defaults = {
'date_from': lambda *a: time.strftime('%Y-%m-01'),
'date_to': lambda *a: (mx.DateTime.now()+mx.DateTime.RelativeDateTime(months=1, day=1, days=-1)).strftime('%Y-%m-%d'),
'date_from': time.strftime('%Y-%m-01'),
'date_to': (mx.DateTime.now()+mx.DateTime.RelativeDateTime(months=1, day=1, days=-1)).strftime('%Y-%m-%d'),
'user_id': lambda self, cr, uid, c: uid,
'state': lambda *args: 'draft',
'business_days' : lambda *a: 20,
'state': 'draft',
'business_days': 20,
}
_order = 'date_from desc'
@@ -116,19 +119,27 @@ class report_account_analytic_planning(osv.osv):
(_check_planning_responsible, 'Invalid planning ! Planning dates can\'t overlap for the same responsible. ', ['user_id'])
]
def action_open(self, cr, uid, id, context={}):
def action_open(self, cr, uid, id, context=None):
if context is None:
context = {}
self.write(cr, uid, id, {'state' : 'open'}, context=context)
return True
def action_cancel(self, cr, uid, id, context={}):
def action_cancel(self, cr, uid, id, context=None):
if context is None:
context = {}
self.write(cr, uid, id, {'state' : 'cancel'}, context=context)
return True
def action_draft(self, cr, uid, id, context={}):
def action_draft(self, cr, uid, id, context=None):
if context is None:
context = {}
self.write(cr, uid, id, {'state' : 'draft'}, context=context)
return True
def action_done(self, cr, uid, id, context={}):
def action_done(self, cr, uid, id, context=None):
if context is None:
context = {}
self.write(cr, uid, id, {'state' : 'done'}, context=context)
return True
@@ -139,10 +150,12 @@ class report_account_analytic_planning_line(osv.osv):
_description = "Planning Line"
_rec_name = 'user_id'
def name_get(self, cr, uid, ids, context={}):
def name_get(self, cr, uid, ids, context=None):
if context is None:
context = {}
if not len(ids):
return []
reads = self.read(cr, uid, ids, ['user_id','planning_id','note'], context)
reads = self.read(cr, uid, ids, ['user_id', 'planning_id', 'note'], context)
res = []
for record in reads:
name = '['+record['planning_id'][1]
@@ -155,7 +168,9 @@ class report_account_analytic_planning_line(osv.osv):
res.append((record['id'], name))
return res
def _amount_base_uom(self, cr, uid, ids, name, args, context):
def _amount_base_uom(self, cr, uid, ids, name, args, context=None):
if context is None:
context = {}
users_obj = self.pool.get('res.users')
result = {}
tm = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
@@ -168,7 +183,7 @@ class report_account_analytic_planning_line(osv.osv):
return result
_columns = {
'account_id':fields.many2one('account.analytic.account', 'Analytic account', required=True),
'account_id': fields.many2one('account.analytic.account', 'Analytic account', required=True),
'planning_id': fields.many2one('report_account_analytic.planning', 'Planning', required=True, ondelete='cascade'),
'user_id': fields.many2one('res.users', 'User'),
'amount': fields.float('Quantity', required=True),
@@ -177,7 +192,7 @@ class report_account_analytic_planning_line(osv.osv):
'amount_in_base_uom': fields.function(_amount_base_uom, method=True, string='Quantity in base uom', store=True),
'task_ids': fields.one2many('project.task', 'planning_line_id', 'Planning Tasks'),
}
_order = 'user_id,account_id'
_order = 'user_id, account_id'
report_account_analytic_planning_line()
@@ -199,7 +214,7 @@ class project_task(osv.osv):
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
if not context:
context = {}
context = context
if not context.get('planning'):
return super(project_task,self).search(cr, user, args, offset, limit, order, context)
cr.execute(" SELECT t.id, t.name \
@@ -211,15 +226,15 @@ class project_task(osv.osv):
project_task()
class report_account_analytic_planning_user(osv.osv):
_name = "report_account_analytic.planning.user"
_description = "Planning by User"
_rec_name = 'user_id'
_auto = False
def _get_tasks(self, cr, uid, ids, name, args, context):
def _get_tasks(self, cr, uid, ids, name, args, context=None):
if context is None:
context = {}
users_obj = self.pool.get('res.users')
result = {}
tm = users_obj.browse(cr, uid, uid, context=context).company_id.project_time_mode_id
@@ -243,7 +258,9 @@ class report_account_analytic_planning_user(osv.osv):
result[line.id] = 0
return result
def _get_free(self, cr, uid, ids, name, args, context):
def _get_free(self, cr, uid, ids, name, args, context=None):
if context is None:
context = {}
result = {}
for line in self.browse(cr, uid, ids, context):
if line.user_id:
@@ -252,7 +269,9 @@ class report_account_analytic_planning_user(osv.osv):
result[line.id] = 0.0
return result
def _get_timesheets(self, cr, uid, ids, name, args, context):
def _get_timesheets(self, cr, uid, ids, name, args, context=None):
if context is None:
context = {}
users_obj = self.pool.get('res.users')
result = {}
tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
@@ -275,9 +294,9 @@ class report_account_analytic_planning_user(osv.osv):
_columns = {
'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'),
'user_id': fields.many2one('res.users', 'User', readonly=True),
'tasks' : fields.function(_get_tasks, method=True, string='Remaining Tasks', help='This value is given by the sum of work remaining to do on the task for this planning, expressed in days.'),
'tasks': fields.function(_get_tasks, method=True, string='Remaining Tasks', help='This value is given by the sum of work remaining to do on the task for this planning, expressed in days.'),
'plan_tasks': fields.float('Time Planned on Tasks', readonly=True, help='This value is given by the sum of time allocation with task(s) linked, expressed in days.'),
'free' : fields.function(_get_free, method=True, string='Unallocated Time', readonly=True,help='Computed as \
'free': fields.function(_get_free, method=True, string='Unallocated Time', readonly=True, help='Computed as \
Business Days - (Time Allocation of Tasks + Time Allocation without Tasks + Holiday Leaves)'),
'plan_open': fields.float('Time Allocation without Tasks', readonly=True,help='This value is given by the sum of time allocation without task(s) linked, expressed in days.'),
'holiday': fields.float('Leaves',help='This value is given by the total of validated leaves into the \'Date From\' and \'Date To\' of the planning.'),
@@ -361,7 +380,9 @@ class report_account_analytic_planning_account(osv.osv):
_rec_name = 'account_id'
_auto = False
def _get_tasks(self, cr, uid, ids, name, args, context):
def _get_tasks(self, cr, uid, ids, name, args, context=None):
if context is None:
context = {}
users_obj = self.pool.get('res.users')
result = {}
tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
@@ -386,7 +407,9 @@ class report_account_analytic_planning_account(osv.osv):
result[line.id] = cr.fetchall()[0][0] / div * div2
return result
def _get_timesheets(self, cr, uid, ids, name, args, context):
def _get_timesheets(self, cr, uid, ids, name, args, context=None):
if context is None:
context = {}
users_obj = self.pool.get('res.users')
result = {}
tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
@@ -409,10 +432,10 @@ class report_account_analytic_planning_account(osv.osv):
_columns = {
'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'),
'account_id': fields.many2one('account.analytic.account', 'Analytic account', readonly=True),
'tasks' : fields.function(_get_tasks, method=True, string='Remaining Tasks', help='This value is given by the sum of work remaining to do on the task for this planning, expressed in days.'),
'plan_tasks': fields.float('Time Allocation of Tasks', readonly=True,help='This value is given by the sum of time allocation with the checkbox \'Assigned in Taks\' set to TRUE expressed in days.'),
'plan_open': fields.float('Time Allocation without Tasks', readonly=True,help='This value is given by the sum of time allocation with the checkbox \'Assigned in Taks\' set to FALSE, expressed in days.'),
'timesheet': fields.function(_get_timesheets, method=True, string='Timesheet',help='This value is given by the sum of all work encoded in the timesheet(s) between the \'Date From\' and \'Date To\' of the planning.'),
'tasks': fields.function(_get_tasks, method=True, string='Remaining Tasks', help='This value is given by the sum of work remaining to do on the task for this planning, expressed in days.'),
'plan_tasks': fields.float('Time Allocation of Tasks', readonly=True, help='This value is given by the sum of time allocation with the checkbox \'Assigned in Taks\' set to TRUE expressed in days.'),
'plan_open': fields.float('Time Allocation without Tasks', readonly=True, help='This value is given by the sum of time allocation with the checkbox \'Assigned in Taks\' set to FALSE, expressed in days.'),
'timesheet': fields.function(_get_timesheets, method=True, string='Timesheet', help='This value is given by the sum of all work encoded in the timesheet(s) between the \'Date From\' and \'Date To\' of the planning.'),
}
def init(self, cr):
@@ -448,7 +471,6 @@ class report_account_analytic_planning_account(osv.osv):
)
""")
report_account_analytic_planning_account()
class report_account_analytic_planning_stat(osv.osv):
@@ -459,7 +481,9 @@ class report_account_analytic_planning_stat(osv.osv):
_log_access = False
_order = 'planning_id,user_id'
def _sum_amount_real(self, cr, uid, ids, name, args, context):
def _sum_amount_real(self, cr, uid, ids, name, args, context=None):
if context is None:
context = {}
users_obj = self.pool.get('res.users')
result = {}
tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
@@ -469,15 +493,17 @@ class report_account_analytic_planning_stat(osv.osv):
div2 = 1.0
for line in self.browse(cr, uid, ids, context):
if line.user_id:
cr.execute('''select sum(acc.unit_amount/uom.factor) from account_analytic_line acc
cr.execute('''SELECT sum(acc.unit_amount/uom.factor) FROM account_analytic_line acc
LEFT JOIN product_uom uom ON (uom.id = acc.product_uom_id)
where user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.id, line.account_id.id, line.planning_id.date_from, line.planning_id.date_to))
WHERE user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.id, line.account_id.id, line.planning_id.date_from, line.planning_id.date_to))
else:
cr.execute('select sum(unit_amount) from account_analytic_line where account_id=%s and date>=%s and date<=%s', (line.account_id.id, line.planning_id.date_from, line.planning_id.date_to))
cr.execute('SELECT sum(unit_amount) FROM account_analytic_line WHERE account_id=%s AND date>=%s AND date<=%s', (line.account_id.id, line.planning_id.date_from, line.planning_id.date_to))
result[line.id] = cr.fetchone()[0] * div2
return result
def _sum_amount_tasks(self, cr, uid, ids, name, args, context):
def _sum_amount_tasks(self, cr, uid, ids, name, args, context=None):
if context is None:
context = {}
users_obj = self.pool.get('res.users')
result = {}
tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
@@ -496,12 +522,12 @@ where user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.i
where = 'user_id=' + str(line.user_id.id) + ' and '
cr.execute('''select
sum(planned_hours)
from
FROM
project_task
where
WHERE
''' + where + '''
project_id in (select id from project_project where category_id=%s) and
date_close>=%s and
project_id IN (select id from project_project where category_id=%s) AND
date_close>=%s AND
date_close<=%s''', (
line.account_id.id,
line.planning_id.date_from,
@@ -523,23 +549,24 @@ where user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.i
def init(self, cr):
cr.execute("""
create or replace view report_account_analytic_planning_stat as (
select
SELECT
min(l.id) as id,
l.user_id as user_id,
a.user_id as manager_id,
l.account_id as account_id,
sum(l.amount/u.factor) as sum_amount,
l.planning_id
from
FROM
report_account_analytic_planning_line l
left join
LEFT JOIN
report_account_analytic_planning a on (a.id = l.planning_id)
left join
LEFT JOIN
product_uom u on (l.amount_unit = u.id)
group by
GROUP BY
l.planning_id, l.user_id, l.account_id, a.user_id
)
""")
report_account_analytic_planning_stat()
class res_company(osv.osv):
@@ -547,9 +574,8 @@ class res_company(osv.osv):
_columns = {
'planning_time_mode_id': fields.many2one('product.uom', 'Planning Time Unit',
help='This will set the unit of measure used in plannings.',
),
}
res_company()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -19,6 +19,4 @@
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -20,4 +20,3 @@
##############################################################################
import project_retro_planning
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -19,7 +19,6 @@
#
##############################################################################
{
'name': 'Project Retro planning',
'version': '0.1',
@@ -19,12 +19,14 @@
#
##############################################################################
from datetime import date,timedelta,datetime
from datetime import date, timedelta, datetime
import time
from osv import fields, osv
class project_project(osv.osv):
_inherit = 'project.project'
def write(self, cr, uid, ids,vals, *args, **kwargs):
if 'date' in vals and vals['date']:
data_project = self.browse(cr, uid, ids)
@@ -43,4 +45,3 @@ class project_project(osv.osv):
project_project()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-1
View File
@@ -22,4 +22,3 @@ import project_timesheet
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-1
View File
@@ -19,7 +19,6 @@
#
##############################################################################
{
'name': 'Project Timesheet',
'version': '1.0',
@@ -39,7 +39,6 @@
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
@@ -71,7 +70,5 @@
<field model="process.node" name="source_node_id" ref="project.process_node_donetask0"/>
</record>
</data>
</openerp>
</openerp>
@@ -93,6 +93,8 @@ class project_work(osv.osv):
return super(project_work,self).create(cr, uid, vals, *args, **kwargs)
def write(self, cr, uid, ids, vals, context=None):
if context is None:
context = {}
vals_line = {}
obj = self.pool.get('hr.analytic.timesheet')
timesheet_obj = self.pool.get('hr.analytic.timesheet')
@@ -152,7 +154,9 @@ class task(osv.osv):
return super(task,self).unlink(cr, uid, ids, *args, **kwargs)
def write(self, cr, uid, ids,vals,context={}):
def write(self, cr, uid, ids,vals,context=None):
if context is None:
context = {}
if (vals.has_key('project_id') and vals['project_id']) or (vals.has_key('name') and vals['name']):
vals_line = {}
hr_anlytic_timesheet = self.pool.get('hr.analytic.timesheet')
@@ -178,6 +182,8 @@ class project_project(osv.osv):
_inherit = "project.project"
def name_get(self, cr, user, ids, context=None):
if context is None:
context = {}
result = []
for project in self.browse(cr, user, ids, context):
name = "[%s] %s" % (project.category_id and project.category_id.code or '?', project.name)
@@ -187,4 +193,3 @@ class project_project(osv.osv):
project_project()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -20,4 +20,3 @@
##############################################################################
import task_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -128,7 +128,6 @@ class report_timesheet_task_user(osv.osv):
}
def init(self, cr):
cr.execute(""" create or replace view report_timesheet_task_user as (
select
@@ -156,4 +155,3 @@ class report_timesheet_task_user(osv.osv):
report_timesheet_task_user()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -9,7 +9,6 @@
<!-- 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>
@@ -19,16 +19,12 @@
#
##############################################################################
import time
from mx import DateTime
import netsvc
from osv import fields, osv
import ir
from tools import config
class sale_order_line(osv.osv):
_name='sale.order.line'
_inherit='sale.order.line'
_name = 'sale.order.line'
_inherit = 'sale.order.line'
_columns = {
'analytics_id':fields.many2one('account.analytic.plan.instance','Analytic Distribution'),
}
+9 -15
View File
@@ -23,7 +23,6 @@ from osv import fields, osv
from tools.translate import _
from mx.DateTime import now
class crm_make_sale(osv.osv_memory):
""" Make sale order for crm """
@@ -63,16 +62,14 @@ class crm_make_sale(osv.osv_memory):
context = {}
mod_obj = self.pool.get('ir.model.data')
result = mod_obj._get_id(cr, uid, 'sale', 'view_sales_order_filter')
id = mod_obj.read(cr, uid, result, ['res_id'])
case_obj = self.pool.get('crm.lead')
sale_obj = self.pool.get('sale.order')
partner_obj = self.pool.get('res.partner')
sale_line_obj = self.pool.get('sale.order.line')
result = mod_obj._get_id(cr, uid, 'sale', 'view_sales_order_filter')
id = mod_obj.read(cr, uid, result, ['res_id'])
data = context and context.get('active_ids', []) or []
for make in self.browse(cr, uid, ids):
@@ -149,8 +146,6 @@ class crm_make_sale(osv.osv_memory):
'res_id': new_ids and new_ids[0]
}
else:
value = {
'domain': str([('id', 'in', new_ids)]),
@@ -159,24 +154,23 @@ class crm_make_sale(osv.osv_memory):
'res_model': 'sale.order',
'view_id': False,
'type': 'ir.actions.act_window',
'res_id':new_ids
'res_id': new_ids
}
return value
_columns = {
'shop_id': fields.many2one('sale.shop', 'Shop', required = True),
'partner_id': fields.many2one('res.partner', 'Customer', required = True, help = 'Use this partner if there is no partner on the Opportunity'),
'shop_id': fields.many2one('sale.shop', 'Shop', required=True),
'partner_id': fields.many2one('res.partner', 'Customer', required=True, help='Use this partner if there is no partner on the Opportunity'),
'picking_policy': fields.selection([('direct','Partial Delivery'),
('one','Complete Delivery')], 'Picking Policy', required = True),
('one','Complete Delivery')], 'Picking Policy', required=True),
'product_ids': fields.many2many('product.product', 'product_sale_rel',\
'sale_id', 'product_id', 'Products'),
'analytic_account': fields.many2one('account.analytic.account', 'Analytic Account'),
'close': fields.boolean('Close Case', help = 'Check this to close the case after having created the sale order.'),
'close': fields.boolean('Close Case', help='Check this to close the case after having created the sale order.'),
}
_defaults = {
'partner_id': _selectPartner,
'close': lambda *a: 1
'close': 1
}
crm_make_sale()
+2 -2
View File
@@ -208,7 +208,7 @@ class res_partner(osv.osv):
res_partner()
class picking(osv.osv):
_inherit="stock.picking"
_inherit = "stock.picking"
_columns = {
'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal', domain=[('state','!=', 'done')]),
'sale_journal_id': fields.many2one('sale_journal.sale.journal', 'Sale Journal'),
@@ -217,7 +217,7 @@ class picking(osv.osv):
picking()
class sale(osv.osv):
_inherit="sale.order"
_inherit = "sale.order"
_columns = {
'journal_id': fields.many2one('sale_journal.sale.journal', 'Journal', domain=[('state','!=', 'done')]),
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type')
+5 -5
View File
@@ -29,15 +29,15 @@ class account_invoice_line(osv.osv):
'cost_price': fields.float('Cost Price', digits=(16, 2)),
}
def write(self, cr, uid, ids, vals, context={}):
if vals.get('product_id' , False):
res=self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price'])
vals['cost_price']=res[0]['standard_price']
if vals.get('product_id', False):
res = self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price'])
vals['cost_price'] = res[0]['standard_price']
return super(account_invoice_line, self).write(cr, uid, ids, vals, context)
def create(self, cr, uid, vals, context={}):
if vals.get('product_id',False):
res=self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price'])
vals['cost_price']=res[0]['standard_price']
res = self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price'])
vals['cost_price'] = res[0]['standard_price']
return super(account_invoice_line, self).create(cr, uid, vals, context)
account_invoice_line()
+15 -15
View File
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
@@ -24,7 +24,7 @@ from osv import osv, fields
class mrp_production(osv.osv):
_inherit = 'mrp.production'
def _ref_calc(self, cr, uid, ids, field_names=None, arg=False, context={}):
""" Finds reference of sale order for production order.
@param field_names: Names of fields.
@@ -32,48 +32,48 @@ class mrp_production(osv.osv):
@return: Dictionary of values.
"""
if not field_names:
field_names=[]
field_names = []
res = {}
for id in ids:
res[id] = {}.fromkeys(field_names, False)
for f in field_names:
field_name = False
if f=='sale_name':
for f in field_names:
field_name = False
if f == 'sale_name':
field_name = 'name'
if f=='sale_ref':
field_name = 'client_order_ref'
field_name = 'client_order_ref'
for key, value in self._get_sale_ref(cr, uid, ids, field_name).items():
res[key][f] = value
return res
def _get_sale_ref(self, cr, uid, ids, field_name=False):
move_obj=self.pool.get('stock.move')
def get_parent_move(move_id):
move = move_obj.browse(cr, uid, move_id)
if move.move_dest_id:
return get_parent_move(move.move_dest_id.id)
return move_id
productions = self.read(cr, uid, ids, ['id','move_prod_id'])
productions = self.read(cr, uid, ids, ['id','move_prod_id'])
res={}
for production in productions:
res[production['id']] = False
if production.get('move_prod_id',False):
parent_move_line = get_parent_move(production['move_prod_id'][0])
if parent_move_line:
move = move_obj.browse(cr,uid,parent_move_line)
move = move_obj.browse(cr,uid,parent_move_line)
if field_name == 'name':
res[production['id']] = move.sale_line_id and move.sale_line_id.order_id.name or False
if field_name=='client_order_ref':
res[production['id']] = move.sale_line_id and move.sale_line_id.order_id.client_order_ref or False
return res
_columns = {
'sale_name': fields.function(_ref_calc, method=True, multi='sale_name', type='char', string='Sale Name', help='Indicate the name of sale order.'),
'sale_ref': fields.function(_ref_calc, method=True, multi='sale_ref', type='char', string='Sale Reference', help='Indicate the Customer Reference from sale order.'),
}
mrp_production()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+3 -3
View File
@@ -34,11 +34,11 @@ Add commitment, requested and effective dates on the sale order.
],
'update_xml': [
'sale_view.xml',
'sale_order_dates_view.xml',
],
'demo_xml': [
],
'test': [],
],
'test': [],
'installable': True,
'active': False,
}