diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index aa3bf57da31..066c5bee06c 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1620,8 +1620,6 @@
-
-
diff --git a/addons/account/report/account_balance_landscape.rml b/addons/account/report/account_balance_landscape.rml
old mode 100755
new mode 100644
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 448f2abaf6d..e3f1321d02f 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -18,8 +18,6 @@
-
-
@@ -29,6 +27,8 @@
+
+
@@ -57,31 +57,31 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
+
@@ -89,14 +89,14 @@
+ string="My Invoices"
+ help="My Invoices"
+ domain="[('user_id','=',uid)]"/>
-
-
+
+
-
+
@@ -111,9 +111,9 @@
-
-
-
+
+
+
@@ -139,11 +139,19 @@
account.invoice.report
form
tree,graph
- {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_month':1,'search_default_product':1,'group_by_no_leaf':1,'group_by':[]}
+
+
diff --git a/addons/account/report/compare_account_balance.rml b/addons/account/report/compare_account_balance.rml
old mode 100755
new mode 100644
diff --git a/addons/account/report/voucher_print.py b/addons/account/report/voucher_print.py
old mode 100755
new mode 100644
diff --git a/addons/account/report/voucher_print.rml b/addons/account/report/voucher_print.rml
old mode 100755
new mode 100644
diff --git a/addons/analytic/project.py b/addons/analytic/project.py
index f52dd23caa0..77a881744bc 100644
--- a/addons/analytic/project.py
+++ b/addons/analytic/project.py
@@ -153,13 +153,15 @@ class account_analytic_account(osv.osv):
def name_get(self, cr, uid, ids, context={}):
if not len(ids):
return []
- reads = self.read(cr, uid, ids, ['name','parent_id'], context)
res = []
- for record in reads:
- name = record['name']
- if record['parent_id']:
- name = record['parent_id'][1]+' / '+name
- res.append((record['id'], name))
+ for account in self.browse(cr, uid, ids, context=context):
+ data = []
+ acc = account
+ while acc:
+ data.insert(0, acc.name)
+ acc = acc.parent_id
+ data = ' / '.join(data)
+ res.append((account.id, data))
return res
def _complete_name_calc(self, cr, uid, ids, prop, unknow_none, unknow_dict):
@@ -197,7 +199,7 @@ class account_analytic_account(osv.osv):
'date': fields.date('Date End'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'company_currency_id': fields.function(_get_company_currency, method=True, type='many2one', relation='res.currency', string='Currency'),
- 'state': fields.selection([('draft','Draft'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Closed'),('template', 'Template')], 'State', required=True,readonly=True,
+ 'state': fields.selection([('draft','Draft'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Closed'),('template', 'Template')], 'State', required=True,
help='* When an account is created its in \'Draft\' state.\
\n* If any associated partner is there, it can be in \'Open\' state.\
\n* If any pending balance is there it can be in \'Pending\'. \
@@ -314,7 +316,7 @@ class account_analytic_line(osv.osv):
_columns = {
'name' : fields.char('Description', size=256, required=True),
- 'date' : fields.date('Date', required=True),
+ 'date' : fields.date('Date', required=True, select=1),
'amount' : fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price.'),
'unit_amount' : fields.float('Quantity', help='Specifies the amount of quantity to count.'),
'account_id' : fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True),
diff --git a/addons/auction/board_auction_demo.xml b/addons/auction/board_auction_demo.xml
index 504a02263da..f260f8bb1fc 100644
--- a/addons/auction/board_auction_demo.xml
+++ b/addons/auction/board_auction_demo.xml
@@ -2,13 +2,13 @@
-
- Auction dashboard
-
- ir.ui.menu
- 4
-
-
+
+
+
+
+
+
+
diff --git a/addons/base_contact/base_contact_demo.xml b/addons/base_contact/base_contact_demo.xml
index 6acdd08cf14..2c76b1844e8 100644
--- a/addons/base_contact/base_contact_demo.xml
+++ b/addons/base_contact/base_contact_demo.xml
@@ -179,7 +179,7 @@
CTO
-
+
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index feb49ba7ae7..c46519cdb97 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -118,20 +118,18 @@ class crm_case(object):
@param context: A standard dictionary for contextual values"""
if not context:
context = {}
-
s = self.get_stage_dict(cr, uid, ids, context=context)
section = self._name
+ stage = False
stage_pool = self.pool.get('crm.case.stage')
for case in self.browse(cr, uid, ids, context):
if section in s:
st = case.stage_id.id or False
if st in s[section]:
data = {'stage_id': s[section][st]}
- stage = stage_pool.browse(cr, uid, s[section][st], context=context)
- if stage.on_change:
- data.update({'probability': stage.probability})
+ stage = s[section][st]
self.write(cr, uid, [case.id], data)
- return True
+ return stage
def get_stage_dict(self, cr, uid, ids, context=None):
"""This function gives dictionary for stage according to stage levels
@@ -174,9 +172,10 @@ class crm_case(object):
s[section] = dict([(v, k) for (k, v) in s[section].iteritems()])
if st in s[section]:
data = {'stage_id': s[section][st]}
- stage = stage_pool.browse(cr, uid, s[section][st], context=context)
- if stage.on_change:
- data.update({'probability': stage.probability})
+ if s[section][st]:
+ stage = stage_pool.browse(cr, uid, s[section][st], context=context)
+ if stage.on_change:
+ data.update({'probability': stage.probability})
self.write(cr, uid, [case.id], data)
return True
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 2700581d6cc..0ecfdca357e 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -120,8 +120,8 @@ and users by email"),
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.lead')]"),
'partner_name': fields.char("Partner Name", size=64),
- 'optin': fields.selection([('yes','Yes'),('no','No'),('unknown','/')],'Opt-In'),
- 'optout': fields.selection([('yes','Yes'),('no','No'),('unknown','/')],'Opt-Out'),
+ 'optin': fields.boolean('Opt-In'),
+ 'optout': fields.boolean('Opt-Out'),
'type':fields.selection([
('lead','Lead'),
('opportunity','Opportunity'),
@@ -153,8 +153,6 @@ and users by email"),
'user_id': crm_case._get_default_user,
'email_from': crm_case._get_default_email,
'state': lambda *a: 'draft',
- 'optin': lambda *a: 'unknown',
- 'optout': lambda *a: 'unknown',
'section_id': crm_case._get_section,
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.lead', context=c),
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
@@ -238,6 +236,15 @@ and users by email"),
}
return value
+ def stage_next(self, cr, uid, ids, context=None):
+ stage = super(crm_lead, self).stage_next(cr, uid, ids, context)
+ if stage:
+ stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, stage, context=context)
+ if stage_obj.on_change:
+ data = {'probability': stage_obj.probability}
+ self.write(cr, uid, ids, data)
+ return stage
+
def message_new(self, cr, uid, msg, context):
"""
Automatically calls when new email message arrives
@@ -361,7 +368,6 @@ and users by email"),
@param **args: Return Dictionary of Keyword Value
"""
return True
-
crm_lead()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm/crm_opportunity_demo.xml b/addons/crm/crm_opportunity_demo.xml
index aa965a07594..3c06d16dc19 100644
--- a/addons/crm/crm_opportunity_demo.xml
+++ b/addons/crm/crm_opportunity_demo.xml
@@ -55,7 +55,7 @@
-
+
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index 4060337bdd7..23d3ffcbe58 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -154,6 +154,8 @@
+
+
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index 790debb007f..ef068e122a3 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -38,7 +38,6 @@
crm.phonecall
tree
-
diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py
index a70bd45875d..f9c39c92403 100644
--- a/addons/crm/report/crm_lead_report.py
+++ b/addons/crm/report/crm_lead_report.py
@@ -77,7 +77,6 @@ class crm_lead_report(osv.osv):
'name': fields.char('Year', size=64, required=False, readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
'section_id':fields.many2one('crm.case.section', 'Section', readonly=True),
- 'nbr': fields.integer('# of Cases', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
'avg_answers': fields.function(_get_data, string='Avg. Answers', method=True, type="integer"),
'perc_done': fields.function(_get_data, string='%Done', method=True, type="float"),
@@ -92,10 +91,10 @@ class crm_lead_report(osv.osv):
'create_date': fields.datetime('Create Date', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'email': fields.integer('# of Emails', size=128, readonly=True),
- 'delay_open': fields.float('Delay to open',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
+ 'delay_open': fields.float('Delay to Open',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
+ 'delay_close': fields.float('Delay to Close',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'delay_expected': fields.float('Overpassed Deadline',digits=(16,2),readonly=True, group_operator="avg"),
- 'delay_close': fields.float('Delay to close',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
- 'probability': fields.float('Probability',digits=(16,2),readonly=True),
+ 'probability': fields.float('Probability',digits=(16,2),readonly=True, group_operator="avg"),
'planned_revenue': fields.float('Planned Revenue',digits=(16,2),readonly=True),
'categ_id': fields.many2one('crm.case.categ', 'Category',\
domain="[('section_id','=',section_id),\
@@ -107,6 +106,7 @@ class crm_lead_report(osv.osv):
'opening_date': fields.date('Opening Date', readonly=True),
'creation_date': fields.date('Creation Date', readonly=True),
'date_closed': fields.date('Close Date', readonly=True),
+ 'nbr': fields.integer('# of Cases', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'type':fields.selection([
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index 014a08299e2..43092ccd6c6 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -23,35 +23,15 @@
-
-
-
+
+
+
-
-
-
- crm.lead.report.form
- crm.lead.report
- form
-
-
-
-
-
@@ -75,37 +55,49 @@
search
-
-
-
+
+
+
+
+
+
-
+ domain="[('create_date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"/>
+
-
-
-
-
-
+
+
+
+
+
+
-
+
-
@@ -133,19 +125,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -187,10 +179,9 @@
Leads Analysis
crm.lead.report
form
- {"search_default_User":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_opportunity':1, "search_default_user":1,"search_default_this_month":1,'group_by_no_leaf':1,'group_by':[]}
tree,graph
- ['|',('type', '=', 'lead'),('type', '=', False)]
-
+ []
@@ -211,10 +202,9 @@
Opportunities Analysis
crm.lead.report
form
- {"search_default_User":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}
+ {"search_default_opportunity": 1, "search_default_user":1,"search_default_this_month":1,'group_by_no_leaf':1,'group_by':[]}
tree,graph
- [('type', '=', 'opportunity')]
-
+ []
diff --git a/addons/crm/res_partner_view.xml b/addons/crm/res_partner_view.xml
index d5bd5c1a3e9..5f3fa8472c0 100644
--- a/addons/crm/res_partner_view.xml
+++ b/addons/crm/res_partner_view.xml
@@ -4,62 +4,92 @@
-
- res.partner.crm.info.inherit
+
+ res.partner.crm.info.inherit1
res.partner
form
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+ res.partner.crm.info.inherit2
+ res.partner
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ res.partner.crm.info.inherit3
+ res.partner
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py
index 12edf5edc6d..00a2fb761f1 100644
--- a/addons/crm/wizard/crm_lead_to_opportunity.py
+++ b/addons/crm/wizard/crm_lead_to_opportunity.py
@@ -81,9 +81,7 @@ class crm_lead2opportunity(osv.osv_memory):
'partner_id': this.partner_id.id,
'type': 'opportunity'
}
-
lead_obj.write(cr, uid, lead.id, vals, context=context)
-
lead_obj._history(cr, uid, [lead], _('Opportunity'), details='Converted to Opportunity', context=context)
value = {
diff --git a/addons/crm/wizard/crm_send_email.py b/addons/crm/wizard/crm_send_email.py
index 92cf8e1031b..3f6aacc0f39 100644
--- a/addons/crm/wizard/crm_send_email.py
+++ b/addons/crm/wizard/crm_send_email.py
@@ -107,12 +107,7 @@ class crm_send_new_email(osv.osv_memory):
body = obj.text
body = case_pool.format_body(body)
- email_from = getattr(obj, 'email_from', False)
-
- x_headers = {
- 'model': model,
- 'resource-id': res_id
- }
+ email_from = getattr(obj, 'email_from', False)
if message_id:
x_headers['References'] = "%s" % (message_id)
diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py
index 133a47563a8..a015ef81418 100644
--- a/addons/email_template/email_template.py
+++ b/addons/email_template/email_template.py
@@ -222,39 +222,41 @@ class email_template(osv.osv):
'template_language' : lambda *a:'mako',
}
+
_sql_constraints = [
('name', 'unique (name)', _('The template name must be unique !'))
]
- def create(self, cr, uid, vals, context=None):
- id = super(email_template, self).create(cr, uid, vals, context)
- src_obj = self.pool.get('ir.model').read(cr, uid, vals['object_name'], ['model'], context)['model']
+ def create_action(self, cr, uid, ids, context):
+ vals = {}
+ template_obj = self.browse(cr, uid, ids)[0]
+ src_obj = template_obj.object_name.model
vals['ref_ir_act_window'] = self.pool.get('ir.actions.act_window').create(cr, uid, {
- 'name': _("%s Mail Form") % vals['name'],
+ 'name': _("%s Mail Form") % template_obj.name,
'type': 'ir.actions.act_window',
'res_model': 'email_template.send.wizard',
'src_model': src_obj,
'view_type': 'form',
- 'context': "{'src_model':'%s','template_id':'%d','src_rec_id':active_id,'src_rec_ids':active_ids}" % (src_obj, id),
+ 'context': "{'src_model':'%s','template_id':'%d','src_rec_id':active_id,'src_rec_ids':active_ids}" % (src_obj, template_obj.id),
'view_mode':'form,tree',
'view_id': self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'email_template.send.wizard.form')], context=context)[0],
'target': 'new',
'auto_refresh':1
}, context)
vals['ref_ir_value'] = self.pool.get('ir.values').create(cr, uid, {
- 'name': _('Send Mail (%s)') % vals['name'],
+ 'name': _('Send Mail (%s)') % template_obj.name,
'model': src_obj,
'key2': 'client_action_multi',
'value': "ir.actions.act_window," + str(vals['ref_ir_act_window']),
'object': True,
}, context)
- self.write(cr, uid, id, {
+ self.write(cr, uid, ids, {
'ref_ir_act_window': vals['ref_ir_act_window'],
'ref_ir_value': vals['ref_ir_value'],
}, context)
- return id
+ return True
- def unlink(self, cr, uid, ids, context=None):
+ def unlink_action(self, cr, uid, ids, context):
for template in self.browse(cr, uid, ids, context):
obj = self.pool.get(template.object_name.model)
try:
@@ -264,6 +266,13 @@ class email_template(osv.osv):
self.pool.get('ir.values').unlink(cr, uid, template.ref_ir_value.id, context)
except:
raise osv.except_osv(_("Warning"), _("Deletion of Record failed"))
+
+ def delete_action(self, cr, uid, ids, context):
+ self.unlink_action(cr, uid, ids, context)
+ return True
+
+ def unlink(self, cr, uid, ids, context=None):
+ self.unlink_action(cr, uid, ids, context)
return super(email_template, self).unlink(cr, uid, ids, context)
def copy(self, cr, uid, id, default=None, context=None):
diff --git a/addons/email_template/email_template_mailbox.py b/addons/email_template/email_template_mailbox.py
index b89a9aeda26..b20fa9f76bf 100644
--- a/addons/email_template/email_template_mailbox.py
+++ b/addons/email_template/email_template_mailbox.py
@@ -41,6 +41,7 @@ class email_template_mailbox(osv.osv):
return True
def send_this_mail(self, cr, uid, ids=None, context=None):
+ result = True
for id in (ids or []):
try:
account_obj = self.pool.get('email_template.account')
diff --git a/addons/email_template/email_template_view.xml b/addons/email_template/email_template_view.xml
index 1d574ff8675..c6eb3757604 100644
--- a/addons/email_template/email_template_view.xml
+++ b/addons/email_template/email_template_view.xml
@@ -114,6 +114,10 @@
+
+
+
+
diff --git a/addons/event/board_association_demo.xml b/addons/event/board_association_demo.xml
index 959f2c1f5a8..c30dad64790 100644
--- a/addons/event/board_association_demo.xml
+++ b/addons/event/board_association_demo.xml
@@ -6,13 +6,13 @@
Administrator shortcut
Demo user startup menu
-->
-
- Dashboard
-
- ir.ui.menu
- 1
-
-
+
+
+
+
+
+
+
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index 14981c13837..947434052ae 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -50,7 +50,7 @@ class email_server(osv.osv):
'type':fields.selection([
('pop', 'POP Server'),
('imap', 'IMAP Server'),
- ], 'State', select=True, readonly=False),
+ ], 'Server Type', select=True, readonly=False),
'is_ssl':fields.boolean('SSL ?', required=False),
'attach':fields.boolean('Add Attachments ?', required=False),
'date': fields.date('Date', readonly=True, states={'draft':[('readonly', False)]}),
@@ -107,11 +107,13 @@ class email_server(osv.osv):
ids = self.search(cr, uid, [])
return self.fetch_mail(cr, uid, ids, context)
- def fetch_mail(self, cr, uid, ids, context={}):
+ def fetch_mail(self, cr, uid, ids, context=None):
+ if not context:
+ context = {}
email_tool = self.pool.get('email.server.tools')
for server in self.browse(cr, uid, ids, context):
logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail start checking for new emails on %s' % (server.name))
-
+ context.update({'server_id': server.id, 'server_type': server.type})
count = 0
try:
if server.type == 'imap':
@@ -123,10 +125,10 @@ class email_server(osv.osv):
imap_server.login(server.user, server.password)
imap_server.select()
- result, data = imap_server.search(None, '(UNSEEN)')
+ result, data = imap_server.search(None, '(UNSEEN)')
for num in data[0].split():
result, data = imap_server.fetch(num, '(RFC822)')
- res_id = email_tool.process_email(cr, uid, server.object_id.model, data[0][1], attach=server.attach, server_id=server.id, server_type=server.type, context=context)
+ res_id = email_tool.process_email(cr, uid, server.object_id.model, data[0][1], attach=server.attach, context=context)
if res_id and server.action_id:
action_pool = self.pool.get('ir.actions.server')
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]})
@@ -154,7 +156,7 @@ class email_server(osv.osv):
for num in range(1, numMsgs + 1):
(header, msges, octets) = pop_server.retr(num)
msg = '\n'.join(msges)
- res_id = email_tool.process_email(cr, uid, server.object_id.model, data[0][1], attach=server.attach, server_id=server.id, server_type=server.type, context=context)
+ res_id = email_tool.process_email(cr, uid, server.object_id.model, data[0][1], attach=server.attach, context=context)
if res_id and server.action_id:
action_pool = self.pool.get('ir.actions.server')
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]})
@@ -182,10 +184,34 @@ class mailgate_message(osv.osv):
'type':fields.selection([
('pop', 'POP Server'),
('imap', 'IMAP Server'),
- ], 'State', select=True, readonly=True),
+ ], 'Server Type', select=True, readonly=True),
}
_order = 'id desc'
+ def create(self, cr, uid, values, context=None):
+ if not context:
+ context={}
+ server_id = context.get('server_id',False)
+ server_type = context.get('server_type',False)
+ if server_id:
+ values['server_id'] = server_id
+ if server_type:
+ values['server_type'] = server_type
+ res = super(mailgate_message,self).create(cr, uid, values, context=context)
+ return res
+
+ def write(self, cr, uid, ids, values, context=None):
+ if not context:
+ context={}
+ server_id = context.get('server_id',False)
+ server_type = context.get('server_type',False)
+ if server_id:
+ values['server_id'] = server_id
+ if server_type:
+ values['server_type'] = server_type
+ res = super(mailgate_message,self).write(cr, uid, ids, values, context=context)
+ return res
+
mailgate_message()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_attendance/hr_attendance.py b/addons/hr_attendance/hr_attendance.py
index 9f5846601ef..e14a91df084 100644
--- a/addons/hr_attendance/hr_attendance.py
+++ b/addons/hr_attendance/hr_attendance.py
@@ -54,7 +54,7 @@ class hr_attendance(osv.osv):
return res
_columns = {
- 'name' : fields.datetime('Date', required=True),
+ 'name' : fields.datetime('Date', required=True, select=1),
'action' : fields.selection([('sign_in', 'Sign In'), ('sign_out', 'Sign Out'),('action','Action')], 'Action', required=True),
'action_desc' : fields.many2one("hr.action.reason", "Action reason", domain="[('action_type', '=', action)]", help='Specifies the reason for Signing In/Signing Out in case of extra hours.'),
'employee_id' : fields.many2one('hr.employee', "Employee's Name", required=True, select=True),
diff --git a/addons/hr_timesheet/__openerp__.py b/addons/hr_timesheet/__openerp__.py
index 930877b77c2..601bf134598 100644
--- a/addons/hr_timesheet/__openerp__.py
+++ b/addons/hr_timesheet/__openerp__.py
@@ -42,6 +42,7 @@ to set up a management by affair.
'update_xml': [
'security/ir.model.access.csv',
'hr_timesheet_view.xml',
+ 'report/hr_timesheet_report_view.xml',
'hr_timesheet_report.xml',
'hr_timesheet_wizard.xml',
'process/hr_timesheet_process.xml',
diff --git a/addons/hr_timesheet/report/__init__.py b/addons/hr_timesheet/report/__init__.py
index 156a4b83c63..d54615fbd0b 100644
--- a/addons/hr_timesheet/report/__init__.py
+++ b/addons/hr_timesheet/report/__init__.py
@@ -19,8 +19,7 @@
#
##############################################################################
+import hr_timesheet_report
import user_timesheet
import users_timesheet
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/hr_timesheet/report/hr_timesheet_report.py b/addons/hr_timesheet/report/hr_timesheet_report.py
new file mode 100644
index 00000000000..100041ca35a
--- /dev/null
+++ b/addons/hr_timesheet/report/hr_timesheet_report.py
@@ -0,0 +1,78 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import tools
+from osv import fields,osv
+
+class hr_timesheet_report(osv.osv):
+ _name = "hr.timesheet.report"
+ _description = "Timesheet"
+ _auto = False
+ _columns = {
+ 'year': fields.char('Year',size=64,required=False, readonly=True),
+ 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
+ ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
+ ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
+ 'date': fields.date('Date', readonly=True),
+ 'name': fields.char('Description', size=64,readonly=True),
+ 'product_id' : fields.many2one('product.product', 'Product',readonly=True),
+ 'journal_id' : fields.many2one('account.analytic.journal', 'Journal',readonly=True),
+ 'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True),
+ 'user_id': fields.many2one('res.users', 'User',readonly=True),
+ 'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company',readonly=True),
+ 'cost': fields.float('Cost',readonly=True),
+ 'quantity': fields.float('Quantity',readonly=True),
+ }
+
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'hr_timesheet_report')
+ cr.execute("""
+ create or replace view hr_timesheet_report as (
+ select
+ min(t.id) as id,
+ l.date as date,
+ to_char(l.date,'YYYY') as year,
+ to_char(l.date,'MM') as month,
+ sum(l.amount) as cost,
+ sum(l.unit_amount) as quantity,
+ l.account_id as account_id,
+ l.journal_id as journal_id,
+ l.product_id as product_id,
+ l.general_account_id as general_account_id,
+ l.user_id as user_id,
+ l.company_id as company_id,
+ l.currency_id as currency_id
+ from
+ hr_analytic_timesheet as t
+ left join account_analytic_line as l ON (t.line_id=l.id)
+ group by
+ l.date,
+ l.account_id,
+ l.product_id,
+ l.general_account_id,
+ l.journal_id,
+ l.user_id,
+ l.company_id,
+ l.currency_id
+ )
+ """)
+hr_timesheet_report()
diff --git a/addons/hr_timesheet/report/hr_timesheet_report_view.xml b/addons/hr_timesheet/report/hr_timesheet_report_view.xml
new file mode 100644
index 00000000000..7f2df2e815e
--- /dev/null
+++ b/addons/hr_timesheet/report/hr_timesheet_report_view.xml
@@ -0,0 +1,99 @@
+
+
+
+
+ hr.timesheet.report.graph
+ hr.timesheet.report
+ graph
+
+
+
+
+
+
+
+
+ hr.timesheet.report.tree
+ hr.timesheet.report
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hr.timesheet.report.search
+ hr.timesheet.report
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Timesheet Analysis
+ hr.timesheet.report
+ form
+ tree,graph
+ {'search_default_month':1,'search_default_group_user_id':1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+
diff --git a/addons/hr_timesheet/report/user_timesheet.py b/addons/hr_timesheet/report/user_timesheet.py
index 8dbda07ea76..d444e4a19bc 100644
--- a/addons/hr_timesheet/report/user_timesheet.py
+++ b/addons/hr_timesheet/report/user_timesheet.py
@@ -101,6 +101,3 @@ class report_custom(report_rml):
report_custom('report.hr.analytical.timesheet', 'hr.employee', '', 'addons/hr_timesheet/report/user_timesheet.xsl')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/hr_timesheet/security/ir.model.access.csv b/addons/hr_timesheet/security/ir.model.access.csv
index ce340fb4eb9..d0573745208 100644
--- a/addons/hr_timesheet/security/ir.model.access.csv
+++ b/addons/hr_timesheet/security/ir.model.access.csv
@@ -6,3 +6,4 @@
"access_hr_sign_out_project","hr.sign.out.project","model_hr_sign_out_project","hr.group_hr_user",1,1,1,1
"access_hr_analytal_timesheet_employee","hr.analytical.timesheet.employee","model_hr_analytical_timesheet_employee","hr.group_hr_manager",1,1,1,1
"access_hr_analytal_timesheet_user","hr.analytical.timesheet.user","model_hr_analytical_timesheet_users","hr.group_hr_user",1,1,1,1
+"access_hr_timesheet_report","hr.timesheet.report","model_hr_timesheet_report","hr.group_hr_manager",1,0,0,0
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index 487e3687b36..050b798f16d 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -96,12 +96,15 @@
form