diff --git a/addons/account/account.py b/addons/account/account.py
index 23635b298ac..449a58f136d 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -470,7 +470,7 @@ class account_journal(osv.osv):
'user_id': lambda self,cr,uid,context: uid,
}
def create(self, cr, uid, vals, context={}):
- journal_id = super(osv.osv, self).create(cr, uid, vals, context)
+ journal_id = super(account_journal, self).create(cr, uid, vals, context)
# journal_name = self.browse(cr, uid, [journal_id])[0].code
# periods = self.pool.get('account.period')
# ids = periods.search(cr, uid, [('date_stop','>=',time.strftime('%Y-%m-%d'))])
@@ -481,6 +481,7 @@ class account_journal(osv.osv):
# 'period_id': period.id
# })
return journal_id
+
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
if not args:
args=[]
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index 044296625bb..0d82951eb7d 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -390,6 +390,7 @@ class crm_case(osv.osv):
'email_from': _get_default_email,
'state': lambda *a: 'open',
'priority': lambda *a: AVAILABLE_PRIORITIES[2][0],
+ 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
}
_order = 'priority, date_deadline desc, date desc,id desc'
diff --git a/addons/hr_timesheet/wizard/sign_in_out.py b/addons/hr_timesheet/wizard/sign_in_out.py
index 400f9f7f242..538a55f75ac 100644
--- a/addons/hr_timesheet/wizard/sign_in_out.py
+++ b/addons/hr_timesheet/wizard/sign_in_out.py
@@ -141,7 +141,7 @@ def _state_check(self, cr, uid, data, context):
class wiz_si_so(wizard.interface):
states = {
'init' : {
- 'actions' : [],
+ 'actions' : [_get_empid],
'result' : {'type' : 'choice', 'next_state': _state_check}
},
'sign_out' : { # this means sign_in...
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
index 5b19583070c..7ff1967c63a 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
@@ -51,12 +51,12 @@ class invoice_create(wizard.interface):
for account in analytic_account_obj.browse(cr, uid, account_ids, context):
partner = account.partner_id
if (not partner) or not (account.pricelist_id):
- raise wizard.except_wizard(_('Analytic account incomplete'),
- _('Please fill in the partner and pricelist field in the analytic account:\n%s') % (account.name,))
+ raise wizard.except_wizard(_('Analytic Account incomplete'),
+ _('Please fill in the Associate Partner and Sale Pricelist fields in the Analytic Account:\n%s') % (account.name,))
if not partner.address:
raise wizard.except_wizard(_('Partner incomplete'),
- _('Please fill in the address field in the partner: %s.') % (partner.name,))
+ _('Please fill in the Address field in the Partner: %s.') % (partner.name,))
date_due = False
if partner.property_payment_term:
diff --git a/addons/membership/membership.py b/addons/membership/membership.py
index 507a6722961..a0d45169278 100644
--- a/addons/membership/membership.py
+++ b/addons/membership/membership.py
@@ -362,7 +362,7 @@ class Partner(osv.osv):
selection = STATE ,store = {
'account.invoice':(_get_invoice_partner,['state'], 10),
'membership.membership_line':(_get_partner_id,['state'], 10),
- 'res.partner':(_get_partners, ['free_member','membership_state'], 10)
+ 'res.partner':(_get_partners, ['free_member', 'membership_state'], 10)
}
),
'membership_start': fields.function(
@@ -756,5 +756,4 @@ class account_invoice_line(osv.osv):
return result
account_invoice_line()
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/membership/wizard/invoice_membership.py b/addons/membership/wizard/invoice_membership.py
index 9767c27f9f4..30d8bc6e6bf 100644
--- a/addons/membership/wizard/invoice_membership.py
+++ b/addons/membership/wizard/invoice_membership.py
@@ -28,7 +28,6 @@ def _invoice_membership(self, cr, uid, data, context):
partner_ids = data['ids']
product_id = data['form']['product']
pool = pooler.get_pool(cr.dbname)
-
cr.execute('''
SELECT partner_id, id, type
FROM res_partner_address
@@ -43,7 +42,6 @@ def _invoice_membership(self, cr, uid, data, context):
pid = fetchal[x][0]
id = fetchal[x][1]
type = fetchal[x][2]
-
if partner_address_ids.has_key(pid) and partner_address_ids[pid]['type'] == 'invoice':
continue
partner_address_ids[pid] = {'id': id, 'type': type}
@@ -95,7 +93,6 @@ def _invoice_membership(self, cr, uid, data, context):
'res_model': 'account.invoice',
'type': 'ir.actions.act_window',
}
-
return value
wizard_arch= """
@@ -110,7 +107,6 @@ wizard_arch= """
class wizard_invoice_membership(wizard.interface):
states = {
-
'init' : {
'actions' : [],
'result' : {
diff --git a/addons/report_sale/report_sale.py b/addons/report_sale/report_sale.py
index 4ea8325afdd..548c84860fb 100644
--- a/addons/report_sale/report_sale.py
+++ b/addons/report_sale/report_sale.py
@@ -110,5 +110,26 @@ class report_sale_order_category(osv.osv):
""")
report_sale_order_category()
+class report_turnover_per_month(osv.osv):
+ _name = "report.turnover.per.month"
+ _description = "Turnover Per Month"
+ _auto = False
+ _columns = {
+ 'name': fields.date('Month', readonly=True),
+ 'turnover': fields.float('Total Turnover', readonly=True),
+ }
+
+ def init(self, cr):
+ cr.execute("""
+ create or replace view report_turnover_per_month as (
+ select min(am.id) as id, sum(credit) as turnover,to_char(am.date, 'YYYY-MM-01') as name from account_move_line am
+ where am.account_id in (select distinct(account_id) from account_invoice_line)
+ and
+ am.move_id in(select distinct(aw.move_id) from account_invoice aw,account_invoice_line l where l.invoice_id=aw.id)
+ group by to_char(am.date, 'YYYY-MM-01')
+ )
+ """)
+report_turnover_per_month()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/report_sale/report_sale_view.xml b/addons/report_sale/report_sale_view.xml
index 1cfb0509ae1..92ab470f700 100644
--- a/addons/report_sale/report_sale_view.xml
+++ b/addons/report_sale/report_sale_view.xml
@@ -171,6 +171,38 @@
[('state','<>','done')]
+
+ report.turnover.per.month.tree
+ report.turnover.per.month
+ tree
+
+
+
+
+
+
+
+
+
+ report.turnover.per.month.graph
+ report.turnover.per.month
+ graph
+
+
+
+
+
+
+
+
+
+ ir.actions.act_window
+ Turnover Per Month
+ report.turnover.per.month
+ form
+ tree,graph
+
+
diff --git a/addons/report_task/report_task.py b/addons/report_task/report_task.py
index 92272468c9b..758a654a7a4 100644
--- a/addons/report_task/report_task.py
+++ b/addons/report_task/report_task.py
@@ -59,6 +59,44 @@ class report_task_user_pipeline_open (osv.osv):
report_task_user_pipeline_open()
+#class report_timesheet_task(osv.osv):
+# _name = "report.timesheet.task"
+# _description = "Report on Timesheets and Tasks per User Per Month"
+# _auto = False
+#
+# def get_hrs_timesheet(self, cr, uid, ids, name,args,context):
+# result = {}
+#
+# for record in self.browse(cr, uid, ids, context):
+# last_date = mx.DateTime.strptime(record.month, '%Y-%m-%d') + mx.DateTime.RelativeDateTime(months=1) - 1
+# obj=self.pool.get('hr_timesheet_sheet.sheet')
+# sheet_ids = obj.search(cr,uid,[('user_id','=',record.user_id.id),('date_current','>=',record.month),('date_current','<=',last_date.strftime('%Y-%m-%d'))])
+# data_days = obj.read(cr,uid,sheet_ids,['total_attendance_day','date_current','user_id'])
+# total = 0.0
+# for day_attendance in data_days:
+# total += day_attendance['total_attendance_day']
+# result[record.id] = total
+#
+# return result
+#
+# _columns = {
+# 'month': fields.date('Month', required=True,readonly=True),
+# 'user_id': fields.many2one('res.users', 'User' ,readonly=True, required=True),
+# 'timesheet_hrs': fields.function(get_hrs_timesheet,method=True, string="Timesheet Hrs" ),
+# 'task_hrs': fields.float('Task Hrs', readonly=True, required=True),
+# }
+#
+#
+# def init(self, cr):
+# cr.execute("""create or replace view report_timesheet_task as (
+# select min(p.id) as id, to_char(p.date, 'YYYY-MM-01') as month, min(r.id) as user_id, sum(p.hours) as task_hrs,0.0 as timesheet_hrs
+# from project_task_work p,res_users r
+# where (r.id=p.user_id)
+# group by to_char(p.date, 'YYYY-MM-01'))""")
+#
+#
+#
+#report_timesheet_task()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: