+
@@ -147,10 +148,11 @@
-
@@ -171,7 +173,6 @@
Expenseshr.expense.expenseform
- {"search_default_my_expns":1}
diff --git a/addons/hr_expense/report/hr_expense_report.py b/addons/hr_expense/report/hr_expense_report.py
index 81cb18dcc09..cc3f282e9fa 100644
--- a/addons/hr_expense/report/hr_expense_report.py
+++ b/addons/hr_expense/report/hr_expense_report.py
@@ -31,12 +31,16 @@ class hr_expense_report(osv.osv):
_columns = {
'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
+ 'day': fields.char('Day', size=128, 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),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
+ 'journal_id': fields.many2one('account.journal', 'Force Journal', readonly=True),
'product_qty':fields.float('Qty', readonly=True),
'employee_id': fields.many2one('hr.employee', "Employee's Name", readonly=True),
+ 'date_confirm': fields.date('Confirmation Date', readonly=True),
+ 'date_valid': fields.date('Validation Date', readonly=True),
'invoice_id': fields.many2one('account.invoice', 'Invoice',readonly=True),
'department_id':fields.many2one('hr.department','Department',readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
@@ -60,12 +64,16 @@ class hr_expense_report(osv.osv):
create or replace view hr_expense_report as (
select
min(l.id) as id,
- s.date as date,
+ date_trunc('day',s.create_date) as date,
s.employee_id,
+ s.journal_id,
+ to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_confirm,
+ to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_valid,
s.invoice_id,
s.department_id,
- to_char(s.date, 'YYYY') as year,
- to_char(s.date, 'MM') as month,
+ to_char(date_trunc('day',s.create_date), 'YYYY') as year,
+ to_char(date_trunc('day',s.create_date), 'MM') as month,
+ to_char(date_trunc('day',s.create_date), 'YYYY-MM-DD') as day,
l.product_id as product_id,
sum(l.unit_quantity * u.factor) as product_qty,
s.user_id as user_id,
@@ -80,10 +88,19 @@ class hr_expense_report(osv.osv):
hr_expense_expense s on (s.id=l.expense_id)
left join product_uom u on (u.id=l.uom_id)
group by
- s.date, l.product_id,s.invoice_id,
+ date_trunc('day',s.create_date),
+ to_char(date_trunc('day',s.create_date), 'YYYY-MM-DD'),
+ to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY'),
+ to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY'),
+ l.product_id,
+ s.invoice_id,
s.department_id,
- l.uom_id, s.user_id, s.state,
- s.company_id,s.employee_id
+ l.uom_id,
+ s.user_id,
+ s.state,
+ s.journal_id,
+ s.company_id,
+ s.employee_id
)
""")
hr_expense_report()
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index 2f9a0afb29c..972557edd0c 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -7,16 +7,18 @@
tree
-
-
-
+
+
+
+
-
-
+
+
+
@@ -31,8 +33,9 @@
graph
-
-
+
+
+
@@ -43,41 +46,81 @@
search
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
+
+
+
+
@@ -90,7 +133,7 @@
hr.expense.reportformtree,graph
- {"search_default_expenses":1,"search_default_by_user":1}
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/hr_holidays/__openerp__.py b/addons/hr_holidays/__openerp__.py
index f5a57313348..83ce130e360 100644
--- a/addons/hr_holidays/__openerp__.py
+++ b/addons/hr_holidays/__openerp__.py
@@ -55,6 +55,8 @@
'hr_holidays_view.xml',
'hr_holidays_wizard.xml',
'hr_holidays_report.xml',
+ 'report/hr_holidays_report_view.xml',
+ 'report/available_holidays_view.xml',
'wizard/hr_holidays_summary_department_view.xml',
'wizard/hr_holidays_summary_employees_view.xml',
#'process/hr_holidays_process.xml'
diff --git a/addons/hr_holidays/hr_holidays_report.xml b/addons/hr_holidays/hr_holidays_report.xml
index 165b54c72f0..23d1e1a75bf 100644
--- a/addons/hr_holidays/hr_holidays_report.xml
+++ b/addons/hr_holidays/hr_holidays_report.xml
@@ -1,23 +1,14 @@
-
-
+
+
-
-
-
-
+
diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index 92e4acd7f63..d5e0602e5bb 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -10,8 +10,9 @@
-
-
+
+
-
-
+
+
-
+
diff --git a/addons/hr_holidays/i18n/nl.po b/addons/hr_holidays/i18n/nl.po
index 02819b8cfe7..e8501d64af1 100644
--- a/addons/hr_holidays/i18n/nl.po
+++ b/addons/hr_holidays/i18n/nl.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-12-11 20:08+0000\n"
-"Last-Translator: Pieter J. Kersten (EduSense BV) \n"
+"PO-Revision-Date: 2010-04-22 09:05+0000\n"
+"Last-Translator: Jan Verlaan (Veritos) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
+"X-Launchpad-Export-Date: 2010-04-23 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
@@ -600,7 +600,7 @@ msgstr "Verlofaanvraag"
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_action_holiday_waiting
msgid "Holidays Requests Awaiting for Validation"
-msgstr ""
+msgstr "Verlofaanvragen wachtend op bevestiging"
#. module: hr_holidays
#: view:hr.holidays:0
diff --git a/addons/hr_holidays/report/__init__.py b/addons/hr_holidays/report/__init__.py
index 00783721fe3..a617b4b6d8a 100644
--- a/addons/hr_holidays/report/__init__.py
+++ b/addons/hr_holidays/report/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,11 +15,12 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
import holidays_summary_report
import available_holidays
+import hr_holidays_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_holidays/report/available_holidays.py b/addons/hr_holidays/report/available_holidays.py
index e69de29bb2d..4a1972f1f7d 100644
--- a/addons/hr_holidays/report/available_holidays.py
+++ b/addons/hr_holidays/report/available_holidays.py
@@ -0,0 +1,76 @@
+# -*- 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 .
+#
+##############################################################################
+from osv import fields,osv
+import tools
+
+class available_holidays_report(osv.osv):
+ _name = "available.holidays.report"
+ _auto = False
+ _columns = {
+ 'date': fields.datetime('Date', readonly=True),
+ 'year': fields.char('Year', size=4, 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),
+ 'employee_id': fields.many2one ('hr.employee', 'Employee', readonly=True),
+ 'holiday_status_id': fields.many2one('hr.holidays.status', 'Leave Type', readonly=True),
+ 'max_leave': fields.float('Allocated Leaves', readonly=True),
+ 'taken_leaves': fields.float('Taken Leaves', readonly=True),
+ 'remaining_leave': fields.float('Remaining Leaves',readonly=True),
+ 'user_id':fields.many2one('res.users', 'User', readonly=True),
+ }
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'available_holidays_report')
+ cr.execute("""
+ create or replace view available_holidays_report as (
+ select
+ min(h.id) as id,
+ date_trunc('day',h.create_date) as date,
+ to_char(s.create_date, 'YYYY') as year,
+ to_char(s.create_date, 'MM') as month,
+ h.employee_id as employee_id,
+ h.user_id as user_id,
+ h.state as state,
+ h.holiday_status_id as holiday_status_id,
+ sum(number_of_days) as remaining_leave,
+ (select sum(number_of_days_temp) from hr_holidays
+ where type='remove'
+ and employee_id=h.employee_id
+ and holiday_status_id=h.holiday_status_id
+ and state='validate') as taken_leaves,
+ (select sum(number_of_days_temp) from hr_holidays
+ where type='add'
+ and employee_id=h.employee_id
+ and holiday_status_id=h.holiday_status_id
+ and state='validate') as max_leave
+ from hr_holidays h
+ left join hr_holidays_status s on (s.id = h.holiday_status_id)
+ where h.state='validate'
+ and h.employee_id is not null
+ and s.active <> 'f'
+ group by h.holiday_status_id, h.employee_id,
+ date_trunc('day',h.create_date),to_char(s.create_date, 'YYYY'),
+ to_char(s.create_date, 'MM'),h.user_id,h.state
+
+ )""")
+available_holidays_report()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_holidays/report/available_holidays_view.xml b/addons/hr_holidays/report/available_holidays_view.xml
new file mode 100644
index 00000000000..18ea7d58d45
--- /dev/null
+++ b/addons/hr_holidays/report/available_holidays_view.xml
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+ available.holidays.report.tree
+ available.holidays.report
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ available.holidays.report.form
+ available.holidays.report
+ form
+
+
+
+
+
+
+
+
+
+ available.holidays.report.graph
+ available.holidays.report
+ graph
+
+
+
+
+
+
+
+
+
+
+ available.holidays.report.search
+ available.holidays.report
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Available Holidays
+ available.holidays.report
+ form
+ tree,graph
+
+
+
+
+
+
+ tree
+
+
+
+
+
+
+
+ graph
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/hr_holidays/report/hr_holidays_report.py b/addons/hr_holidays/report/hr_holidays_report.py
index 59a0a361eeb..435eee71ea5 100644
--- a/addons/hr_holidays/report/hr_holidays_report.py
+++ b/addons/hr_holidays/report/hr_holidays_report.py
@@ -63,6 +63,7 @@ class hr_holidays_report(osv.osv):
s.state
from
hr_holidays s
+ where type='remove'
group by
s.create_date,s.state,s.date_from,s.date_to,
s.number_of_days_temp,s.employee_id,s.user_id
@@ -70,3 +71,37 @@ class hr_holidays_report(osv.osv):
""")
hr_holidays_report()
+class hr_holidays_remaining_leaves_user(osv.osv):
+ _name = "hr.holidays.remaining.leaves.user"
+ _description = "Total holidays by type"
+ _auto = False
+ _columns = {
+ 'name': fields.char('Employee',size=64),
+ 'no_of_leaves': fields.integer('Remaining leaves'),
+ 'user_id': fields.many2one('res.users','User'),
+ 'leave_type': fields.char('Leave Type',size=64),
+
+ }
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'hr_holidays_remaining_leaves_user')
+ cr.execute("""
+ create or replace view hr_holidays_remaining_leaves_user as (
+ select
+ min(hrs.id) as id,
+ rr.name as name,
+ sum(hrs.number_of_days) as no_of_leaves,
+ rr.user_id as user_id,
+ hhs.name as leave_type
+ from
+ hr_holidays as hrs, hr_employee as hre,
+ resource_resource as rr,hr_holidays_status as hhs
+ where
+ hrs.employee_id = hre.id and
+ hre.resource_id = rr.id and
+ hhs.id = hrs.holiday_status_id
+ group by
+ rr.name,rr.user_id,hhs.name
+ )
+ """)
+
+hr_holidays_remaining_leaves_user()
diff --git a/addons/hr_holidays/report/hr_holidays_report_view.xml b/addons/hr_holidays/report/hr_holidays_report_view.xml
index 66094e70f5c..e9e0e6aae36 100644
--- a/addons/hr_holidays/report/hr_holidays_report_view.xml
+++ b/addons/hr_holidays/report/hr_holidays_report_view.xml
@@ -9,7 +9,6 @@
-
@@ -47,6 +46,20 @@
domain="[('month','=',time.strftime('%%m'))]"
help="Leaves of this month"/>
+
+
+
+
+
+
-
+
@@ -72,10 +85,36 @@
hr.holidays.reportformtree,graph
+ {'search_default_employee': 1}
-
+
-
+
+ hr.holidays.remaining.leaves.user.tree
+ hr.holidays.remaining.leaves.user
+ tree
+
+
+
+
+
+
+
+
+
+
+ hr.holidays.remaining.leaves.user.graph
+ hr.holidays.remaining.leaves.user
+ graph
+
+
+
+
+
+
+
+
+
diff --git a/addons/hr_holidays/security/ir.model.access.csv b/addons/hr_holidays/security/ir.model.access.csv
index a7426724594..d928a8dcb9b 100644
--- a/addons/hr_holidays/security/ir.model.access.csv
+++ b/addons/hr_holidays/security/ir.model.access.csv
@@ -3,3 +3,9 @@
"access_hr_holidays_user","hr holidays user","model_hr_holidays","hr.group_hr_user",1,1,1,0
"access_hr_holydays_status_manager","hr.holidays.status manager","model_hr_holidays_status","hr.group_hr_manager",1,1,1,1
"access_hr_holidays_manager","hr holidays manager","model_hr_holidays","hr.group_hr_manager",1,1,1,1
+"access_hr_holidays_remain","hr holidays user","model_hr_holidays_remaining_leaves_user","hr.group_hr_user",1,0,0,0
+"access_hr_holidays_report","hr.holidays.report","model_hr_holidays_report","hr.group_hr_manager",1,1,1,1
+"access_hr_holidays_remaining_leaves_user","hr.hr.holidays.remaining.leaves.user","model_hr_holidays_remaining_leaves_user","hr.group_hr_manager",1,1,1,1
+"access_available_holidays_report","hr.available.holidays.report","model_available_holidays_report","hr.group_hr_manager",1,1,1,1
+"access_hr_holidays_report_user","hr.holidays.report","model_hr_holidays_report","hr.group_hr_user",1,0,0,0
+"access_available_holidays_report_user","hr.available.holidays.report","model_available_holidays_report","hr.group_hr_user",1,0,0,0
diff --git a/addons/hr_recruitment/__openerp__.py b/addons/hr_recruitment/__openerp__.py
index a19ef25515b..14557c33c42 100644
--- a/addons/hr_recruitment/__openerp__.py
+++ b/addons/hr_recruitment/__openerp__.py
@@ -39,14 +39,15 @@ system to store and search in your CV base.
'hr_recruitment_data.xml'
],
'update_xml': [
- 'hr_recruitment_wizard.xml',
+ 'wizard/hr_recruitment_phonecall_view.xml',
'hr_recruitment_view.xml',
'hr_recruitment_menu.xml',
# 'report_hr_recruitment_view.xml',
'security/hr_recruitment_security.xml',
'security/ir.model.access.csv',
'board_hr_recruitment_statistical_view.xml',
- 'report/hr_recruitment_report_view.xml'
+ 'report/hr_recruitment_report_view.xml',
+ 'wizard/hr_recruitment_create_partner_job_view.xml',
],
'demo_xml': [
'hr_recruitment_demo.xml'
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index 6fe8b91aa3e..eb0d1ae1334 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -20,7 +20,6 @@
##############################################################################
from osv import fields,osv,orm
-from tools.translate import _
AVAILABLE_STATES = [
('draft','New'),
@@ -55,8 +54,8 @@ class hr_applicant(osv.osv):
'partner_name': fields.char("Applicant's Name", size=64),
'partner_phone': fields.char('Phone', size=32),
'partner_mobile': fields.char('Mobile', size=32),
- 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'hr.applicant')]"),
- 'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('object_id.model', '=', 'hr.applicant')]"),
+ 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"),
+ 'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"),
'department_id':fields.many2one('hr.department','Department'),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
'survey' : fields.related('job_id', 'survey_id', type='many2one', relation='survey', string='Survey'),
@@ -65,7 +64,7 @@ class hr_applicant(osv.osv):
def stage_previous(self, cr, uid, ids, context=None):
"""This function computes previous stage for case from its current stage
- using available stage for that case type
+ using available stage for that case type
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -83,7 +82,7 @@ class hr_applicant(osv.osv):
def stage_next(self, cr, uid, ids, context=None):
"""This function computes next stage for case from its current stage
- using available stage for that case type
+ using available stage for that case type
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -168,7 +167,6 @@ class hr_applicant(osv.osv):
context.update({'survey_id': record.survey.id, 'response_id' : [record.response], 'response_no':0,})
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context)
return value
-
hr_applicant()
class hr_job(osv.osv):
diff --git a/addons/hr_recruitment/hr_recruitment_menu.xml b/addons/hr_recruitment/hr_recruitment_menu.xml
index bbf32cf0501..ba3278b3c66 100644
--- a/addons/hr_recruitment/hr_recruitment_menu.xml
+++ b/addons/hr_recruitment/hr_recruitment_menu.xml
@@ -9,7 +9,6 @@
hr.applicanttree,form,graph
- {"search_default_current":1,"search_default_my_recrui":1}
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index 2367603502c..beb9467814c 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -43,8 +43,8 @@
-
-
+
+
@@ -71,16 +71,16 @@
-
+
+ name="%(action_hr_recruitment_phonecall)d" icon="gtk-redo" type="action"/>
+ icon="gtk-execute" context="{'survey_id': survey, 'response_id': [response], 'response_no':0 ,'active' : response, 'object' : 'hr.applicant', 'cur_id' :active_id}" attrs="{'readonly':[('survey','=',False)]}"/>
@@ -160,10 +160,10 @@
+ string="Reply to Last Email"
+ name="%(crm.action_crm_send_mail)d"
+ context="{'mail':'reply', 'model': 'hr.applicant'}"
+ icon="gtk-undo" type="action" />
@@ -172,9 +172,9 @@
+ name="%(crm.action_crm_send_mail)d"
+ context="{'mail':'new', 'model': 'hr.applicant'}"
+ icon="gtk-go-forward" type="action" />
@@ -201,10 +201,10 @@
search
-
-
-
-
+
@@ -232,9 +231,8 @@
domain="[('department_id','=',context.get('department_id',False))]"
help="My Department"/>
-
-
+
diff --git a/addons/hr_recruitment/hr_recruitment_wizard.xml b/addons/hr_recruitment/hr_recruitment_wizard.xml
index b2ef149d604..d82153eabbb 100644
--- a/addons/hr_recruitment/hr_recruitment_wizard.xml
+++ b/addons/hr_recruitment/hr_recruitment_wizard.xml
@@ -9,6 +9,14 @@
multi="True"
string="Schedule Phone Call" />
+
+
tree
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -39,57 +44,88 @@
search
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -100,7 +136,7 @@
hr.recruitment.reportformtree,graph
- {"search_default_user_id":1,"search_default_by_user":1}
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/hr_recruitment/wizard/__init__.py b/addons/hr_recruitment/wizard/__init__.py
index 48e225c5a54..c946ed7264f 100644
--- a/addons/hr_recruitment/wizard/__init__.py
+++ b/addons/hr_recruitment/wizard/__init__.py
@@ -20,10 +20,8 @@
##############################################################################
-import hr_recruitment_wizard
-
-
-
+import hr_recruitment_phonecall
+import hr_recruitment_create_partner_job
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py
new file mode 100644
index 00000000000..4627751f731
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py
@@ -0,0 +1,92 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import osv, fields
+from tools.translate import _
+
+class hr_recruitment_partner_create(osv.osv_memory):
+ _name = 'hr.recruitment.partner.create'
+ _description = 'Create Partner from job application'
+ _columns = {
+ 'close': fields.boolean('Close job request'),
+ }
+
+ def view_init(self, cr , uid , fields_list, context=None):
+ case_obj = self.pool.get('hr.applicant')
+ for case in case_obj.browse(cr, uid, context['active_ids']):
+ if case.partner_id:
+ raise osv.except_osv(_('Warning !'),
+ _('A partner is already defined on this job request.'))
+ pass
+
+ def make_order(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ partner_obj = self.pool.get('res.partner')
+ contact_obj = self.pool.get('res.partner.address')
+ case_obj = self.pool.get('hr.applicant')
+
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [], context)[0]
+ result = mod_obj._get_id(cr, uid, 'base', 'view_res_partner_filter')
+ res = mod_obj.read(cr, uid, result, ['res_id'])
+
+ for case in case_obj.browse(cr, uid, context['active_ids']):
+ partner_id = partner_obj.search(cr, uid, [('name', '=', case.partner_name or case.name)])
+ if partner_id:
+ raise osv.except_osv(_('Warning !'),_('A partner is already existing with the same name.'))
+ else:
+ partner_id = partner_obj.create(cr, uid, {
+ 'name': case.partner_name or case.name,
+ 'user_id': case.user_id.id,
+ 'comment': case.description,
+ })
+ contact_id = contact_obj.create(cr, uid, {
+ 'partner_id': partner_id,
+ 'name': case.partner_name,
+ 'phone': case.partner_phone,
+ 'mobile': case.partner_mobile,
+ 'email': case.email_from
+ })
+
+ case_obj.write(cr, uid, context['active_ids'], {
+ 'partner_id': partner_id,
+ 'partner_address_id': contact_id
+ })
+ if data['close']:
+ case_obj.case_close(cr, uid, context['active_ids'])
+
+ value = {
+ 'domain': "[]",
+ 'view_type': 'form',
+ 'view_mode': 'form,tree',
+ 'res_model': 'res.partner',
+ 'res_id': int(partner_id),
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': res['res_id']
+ }
+ return value
+
+hr_recruitment_partner_create()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job_view.xml b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job_view.xml
new file mode 100644
index 00000000000..1eaaa2fefdd
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job_view.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ hr.recruitment.partner.create.form
+ hr.recruitment.partner.create
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create Partner
+ ir.actions.act_window
+ hr.recruitment.partner.create
+ form
+ form
+ new
+
+
+
+
+
+ Create Partner
+ client_action_multi
+
+ action
+ hr.applicant
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py
new file mode 100644
index 00000000000..27c0a2c49bd
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py
@@ -0,0 +1,116 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import time
+
+from osv import osv, fields
+from tools.translate import _
+
+class job2phonecall(osv.osv_memory):
+ _name = 'hr.recruitment.job2phonecall'
+ _description = 'Schedule Phone Call'
+ _columns = {
+ 'user_id': fields.many2one('res.users', 'Assign To'),
+ 'deadline': fields.datetime('Planned Date'),
+ 'note': fields.text('Goals'),
+ 'category_id': fields.many2one('crm.case.categ', 'Category', required=True),
+ }
+
+ def _date_user(self, cr, uid, context=None):
+ case_obj = self.pool.get('hr.applicant')
+ case = case_obj.browse(cr, uid, context['active_id'])
+ return case.user_id and case.user_id.id or False
+
+ def _date_category(self, cr, uid, context=None):
+ categ_id = self.pool.get('crm.case.categ').search(cr, uid, [('name','=','Outbound')])
+ return categ_id and categ_id[0] or case.categ_id and case.categ_id.id or False
+
+ def _get_note(self, cr, uid, context=None):
+ case_obj = self.pool.get('hr.applicant')
+ case = case_obj.browse(cr, uid, context['active_id'])
+ return case.description or ''
+
+ _defaults = {
+ 'user_id': _date_user,
+ 'category_id': _date_category,
+ 'note': _get_note
+ }
+
+ def make_phonecall(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ job_case_obj = self.pool.get('hr.applicant')
+ data_obj = self.pool.get('ir.model.data')
+ phonecall_case_obj = self.pool.get('crm.phonecall')
+
+ form = self.read(cr, uid, ids, [], context=context)[0]
+# form = data['form']
+ result = mod_obj._get_id(cr, uid, 'crm', 'view_crm_case_phonecalls_filter')
+ res = mod_obj.read(cr, uid, result, ['res_id'])
+ # Select the view
+
+ id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_tree_view')
+ id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_form_view')
+ if id2:
+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+ if id3:
+ id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+
+ for job in job_case_obj.browse(cr, uid, context['active_ids']):
+ #TODO : Take other info from job
+ new_phonecall_id = phonecall_case_obj.create(cr, uid, {
+ 'name' : job.name,
+ 'user_id' : form['user_id'],
+ 'categ_id' : form['category_id'],
+ 'description' : form['note'],
+ 'date' : form['deadline'],
+# 'section_id' : form['section_id'],
+ 'description':job.description,
+ 'partner_id':job.partner_id.id,
+ 'partner_address_id':job.partner_address_id.id,
+ 'partner_phone':job.partner_phone,
+ 'partner_mobile':job.partner_mobile,
+ 'description':job.description,
+ 'date':job.date,
+ }, context=context)
+ new_phonecall = phonecall_case_obj.browse(cr, uid, new_phonecall_id)
+ vals = {}
+# if not job.case_id:
+# vals.update({'phonecall_id' : new_phonecall.id})
+ job_case_obj.write(cr, uid, [job.id], vals)
+ job_case_obj.case_cancel(cr, uid, [job.id])
+ phonecall_case_obj.case_open(cr, uid, [new_phonecall_id])
+
+ value = {
+ 'name': _('Phone Call'),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'crm.phonecall',
+ 'res_id' : new_phonecall_id,
+ 'views': [(id3,'form'),(id2,'tree'),(False,'calendar'),(False,'graph')],
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': res['res_id']
+ }
+ return value
+
+job2phonecall()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:>>>>>>> MERGE-SOURCE
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml b/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml
new file mode 100644
index 00000000000..f7c162594d2
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ hr.recruitment.job2phonecall.form
+ hr.recruitment.job2phonecall
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Schedule Phone Call
+ ir.actions.act_window
+ hr.recruitment.job2phonecall
+ form
+ form
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_wizard.py b/addons/hr_recruitment/wizard/hr_recruitment_wizard.py
deleted file mode 100644
index a12ff4957eb..00000000000
--- a/addons/hr_recruitment/wizard/hr_recruitment_wizard.py
+++ /dev/null
@@ -1,218 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
-# $Id$
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from mx.DateTime import now
-
-import wizard
-import netsvc
-import ir
-import pooler
-import time
-
-from tools.translate import _
-
-class job2phonecall(wizard.interface):
- case_form = """
-
+
+
+
+
+ Sign in / Sign out by project
+ hr.sign.in.project
+ form
+ tree,form
+
+ new
+
+
+
+
+
+ hr.sign.out.project.form
+ hr.sign.out.project
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sign in / Sign out by project
+ hr.sign.out.project
+ form
+ tree,form
+
+ new
+
+
+
+
diff --git a/addons/hr_timesheet/wizard/sign_in_out.py b/addons/hr_timesheet/wizard/sign_in_out.py
deleted file mode 100644
index ff532afc260..00000000000
--- a/addons/hr_timesheet/wizard/sign_in_out.py
+++ /dev/null
@@ -1,174 +0,0 @@
-# -*- 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 wizard
-import time
-import pooler
-from tools.translate import _
-
-si_form ='''
-
'''
-
-so_fields = {
- 'name': {'string':"Employee's name", 'type':'char', 'required':True, 'readonly':True},
- 'state': {'string':"Current state", 'type':'char', 'required':True, 'readonly':True},
- 'account_id': {'string':"Analytic Account", 'type':'many2one', 'relation':'account.analytic.account', 'required':True, 'domain':"[('type','=','normal')]"},
- 'info': {'string':"Work Description", 'type':'char', 'size':256, 'required':True},
- 'date': {'string':"Closing Date", 'type':'datetime'},
- 'date_start': {'string':"Starting Date", 'type':'datetime', 'readonly':True},
- 'server_date': {'string':"Current Server Date", 'type':'datetime', 'readonly':True},
- 'analytic_amount': {'string':"Minimum Analytic Amount", 'type':'float'},
-}
-
-def _get_empid(self, cr, uid, data, context):
- emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
- emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
- if emp_id:
- employee = emp_obj.read(cr, uid, emp_id)[0]
- return {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0], 'date':False, 'server_date':time.strftime('%Y-%m-%d %H:%M:%S')}
- raise wizard.except_wizard(_('UserError'), _('No employee defined for your user !'))
-
-def _get_empid2(self, cr, uid, data, context):
- res = _get_empid(self,cr, uid, data, context)
- cr.execute('select name,action from hr_attendance where employee_id=%s order by name desc limit 1', (res['emp_id'],))
- res['server_date'] = time.strftime('%Y-%m-%d %H:%M:%S')
- res['date_start'] = cr.fetchone()[0]
- res['info'] = ''
- res['account_id'] = False
- return res
-
-def _sign_in_result(self, cr, uid, data, context):
- emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
- emp_id = data['form']['emp_id']
- from osv.osv import except_osv
- try:
- success = emp_obj.attendance_action_change(cr, uid, [emp_id], type = 'sign_in' ,dt=data['form']['date'] or False)
- except except_osv, e:
- raise wizard.except_wizard(e.name, e.value)
- return {}
-
-def _write(self, cr, uid, data, emp_id, context):
- timesheet_obj = pooler.get_pool(cr.dbname).get('hr.analytic.timesheet')
- emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
- hour = (time.mktime(time.strptime(data['form']['date'] or time.strftime('%Y-%m-%d %H:%M:%S'), '%Y-%m-%d %H:%M:%S')) -
- time.mktime(time.strptime(data['form']['date_start'], '%Y-%m-%d %H:%M:%S'))) / 3600.0
- minimum = data['form']['analytic_amount']
- if minimum:
- hour = round(round((hour + minimum / 2) / minimum) * minimum, 2)
- res = timesheet_obj.default_get(cr, uid, ['product_id','product_uom_id'])
- if not res['product_uom_id']:
- raise wizard.except_wizard(_('UserError'), _('No cost unit defined for this employee !'))
- up = timesheet_obj.on_change_unit_amount(cr, uid, False, res['product_id'], hour, res['product_uom_id'])['value']
- res['name'] = data['form']['info']
- res['account_id'] = data['form']['account_id']
- res['unit_amount'] = hour
- emp_journal = emp_obj.browse(cr, uid, emp_id, context).journal_id
- res['journal_id'] = emp_journal and emp_journal.id or False
- res.update(up)
- up = timesheet_obj.on_change_account_id(cr, uid, [], res['account_id']).get('value', {})
- res.update(up)
- return timesheet_obj.create(cr, uid, res, context)
-
-def _sign_out_result_end(self, cr, uid, data, context):
- emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
- emp_id = data['form']['emp_id']
- emp_obj.attendance_action_change(cr, uid, [emp_id], type='sign_out',dt=data['form']['date'])
- _write(self, cr, uid, data, emp_id, context)
- return {}
-
-def _sign_out_result(self, cr, uid, data, context):
- emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
- emp_id = data['form']['emp_id']
- emp_obj.attendance_action_change(cr, uid, [emp_id], type='action',dt=data['form']['date'])
- _write(self, cr, uid, data, emp_id, context)
- return {}
-
-def _state_check(self, cr, uid, data, context):
- emp_id = _get_empid(self, cr, uid, data, context)['emp_id']
- # get the latest action (sign_in or out) for this employee
- cr.execute('select action from hr_attendance where employee_id=%s and action in (\'sign_in\',\'sign_out\') order by name desc limit 1', (emp_id,))
- res = (cr.fetchone() or ('sign_out',))[0]
-#TODO: invert sign_in et sign_out
- return res
-
-class wiz_si_so(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [_get_empid],
- 'result' : {'type' : 'choice', 'next_state': _state_check}
- },
- 'sign_out' : { # this means sign_in...
- 'actions' : [_get_empid],
- 'result' : {'type':'form', 'arch':si_form, 'fields' : si_fields, 'state':[('end', 'Cancel'),('si_result', 'Start Working') ] }
- },
- 'si_result' : {
- 'actions' : [_sign_in_result],
- 'result' : {'type':'state', 'state':'end'}
- },
- 'sign_in' : { # this means sign_out...
- 'actions' : [_get_empid2],
- 'result' : {'type':'form', 'arch':so_form, 'fields':so_fields, 'state':[('end', 'Cancel'),('so_result', 'Change Work'),('so_result_end', 'Stop Working') ] }
- },
- 'so_result' : {
- 'actions' : [_sign_out_result],
- 'result' : {'type':'state', 'state':'end'}
- },
- 'so_result_end' : {
- 'actions' : [_sign_out_result_end],
- 'result' : {'type':'state', 'state':'end'}
- },
- }
-wiz_si_so('hr_timesheet.si_so')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/hr_timesheet_invoice/__openerp__.py b/addons/hr_timesheet_invoice/__openerp__.py
index f335c7dbd77..72148b83f63 100644
--- a/addons/hr_timesheet_invoice/__openerp__.py
+++ b/addons/hr_timesheet_invoice/__openerp__.py
@@ -39,6 +39,10 @@ reports, eso.""",
'hr_timesheet_invoice_report.xml',
'report/report_analytic_view.xml',
'report/hr_timesheet_invoice_report_view.xml',
+ 'wizard/hr_timesheet_invoice_analytic_cost_ledger_view.xml',
+ 'wizard/hr_timesheet_analytic_profit_view.xml',
+ 'wizard/hr_timesheet_invoice_create_view.xml',
+ 'wizard/hr_timesheet_invoice_create_final_view.xml',
],
'demo_xml': ['hr_timesheet_invoice_demo.xml'],
'installable': True,
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml
index 5db8bfeb921..f2d9f5a8c4a 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml
@@ -13,7 +13,7 @@
sequence="2" />
-
+
-
+ groups="hr.group_hr_manager"/>-->
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_wizard.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_wizard.xml
index 350f30c780d..50ca292d39d 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_wizard.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_wizard.xml
@@ -1,8 +1,8 @@
-
-
-
+
+
+
diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py
index 28f129dce22..b7cf2e8a2df 100644
--- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py
+++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,13 +15,67 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
from osv import fields,osv
from tools.sql import drop_view_if_exists
+class report_timesheet_line(osv.osv):
+ _name = "report.timesheet.line"
+ _description = "Timesheet Line"
+ _auto = False
+ _columns = {
+ 'name': fields.char('Year',size=64,required=False, readonly=True),
+ 'user_id':fields.many2one('res.users', 'User', readonly=True),
+ 'date' : fields.date('Date', readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True),
+ 'quantity': fields.float('Quantity', readonly=True),
+ 'cost': fields.float('Cost', readonly=True),
+ 'product_id' : fields.many2one('product.product', 'Product',readonly=True),
+ 'account_id' : fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
+ 'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True),
+ 'invoice_id': fields.many2one('account.invoice', 'Invoiced', 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),
+ }
+ _order = 'name desc,user_id desc'
+ def init(self, cr):
+ drop_view_if_exists(cr, 'report_timesheet_line')
+ cr.execute("""
+ create or replace view report_timesheet_line as (
+ select
+ min(l.id) as id,
+ l.date as date,
+ to_char(l.date,'YYYY') as name,
+ to_char(l.date,'MM') as month,
+ l.user_id,
+ to_char(l.date, 'YYYY-MM-DD') as day,
+ l.invoice_id,
+ l.product_id,
+ l.account_id,
+ l.general_account_id,
+ sum(l.unit_amount) as quantity,
+ sum(l.amount) as cost
+ from
+ account_analytic_line l
+ where
+ l.user_id is not null
+ group by
+ l.date,
+ l.user_id,
+ l.product_id,
+ l.account_id,
+ l.general_account_id,
+ l.invoice_id
+ )
+ """)
+report_timesheet_line()
+
+
+
+
class report_timesheet_user(osv.osv):
_name = "report_timesheet.user"
_description = "Timesheet per day"
@@ -102,7 +156,7 @@ class report_timesheet_account_date(osv.osv):
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
}
_order = 'name desc,account_id desc,user_id desc'
-
+
def init(self, cr):
drop_view_if_exists(cr, 'report_timesheet_account_date')
cr.execute("""
@@ -167,7 +221,7 @@ class report_random_timsheet(osv.osv):
_name = "report.random.timesheet"
_description = "Random Timesheet Report"
_auto = False
-
+
_columns = {
'analytic_account_id' : fields.many2one('account.analytic.account','Analytic Account', readonly=True),
'name': fields.char('Description', size=64, readonly=True),
@@ -176,34 +230,34 @@ class report_random_timsheet(osv.osv):
'user_id' : fields.many2one('res.users', 'User', readonly=True)
}
_order = "date desc"
-
+
def __init__(self, pool, cr):
super(report_random_timsheet, self).__init__(pool, cr)
self.called = False
-
+
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
""" To call the init() method timely
"""
if not self.called:
self.init(cr, user)
self.called = True # To make sure that init doesn't get called multiple times
-
+
res = super(report_random_timsheet, self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
return res
-
+
def init(self, cr, uid=1):
drop_view_if_exists(cr, 'report_random_timesheet')
-
+
cr.execute("""create or replace view report_random_timesheet as (
- select
+ select
line.id as id, line.account_id as analytic_account_id, line.name as name,
line.unit_amount as quantity, line.date as date, line.user_id as user_id
- from
+ from
account_analytic_line line, hr_department dept,hr_department_user_rel dept_user
where
(dept.id = dept_user.department_id AND dept_user.user_id=line.user_id AND line.user_id is not null)
- AND (dept.manager_id = """ + str(uid) + """ )
+ AND (dept.manager_id = """ + str(uid) + """ )
AND (line.date <= CURRENT_DATE AND line.date > (CURRENT_DATE-3))
LIMIT 10
)
@@ -215,32 +269,32 @@ class random_timesheet_lines(osv.osv):
_name = "random.timesheet.lines"
_description = "Random Timesheet Lines"
_auto = False
-
+
_columns = {
- 'date': fields.date('Date', readonly=True),
+ 'date': fields.date('Date', readonly=True),
'name': fields.char('Description', size=64, readonly=True),
'user_id' : fields.many2one('res.users', 'User', readonly=True),
'quantity' : fields.float('Quantity', readonly=True),
- 'product_id' : fields.many2one('product.product', 'Product', readonly=True),
+ 'product_id' : fields.many2one('product.product', 'Product', readonly=True),
'analytic_account_id' : fields.many2one('account.analytic.account','Analytic Account', readonly=True),
'uom_id' : fields.many2one('product.uom', 'UoM', readonly=True),
'amount' : fields.float('Amount', readonly=True),
'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Invoicing', readonly=True),
'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True)
}
-
+
_order = "date desc"
-
+
def init(self, cr):
drop_view_if_exists(cr, 'random_timesheet_lines')
-
+
cr.execute("""create or replace view random_timesheet_lines as (
- select
+ select
line.id as id, line.date as date, line.name as name, line.unit_amount as quantity,
line.product_id as product_id, line.account_id as analytic_account_id,
line.product_uom_id as uom_id, line.amount as amount, line.to_invoice as to_invoice,
- line.general_account_id as general_account_id, line.user_id as user_id
- from
+ line.general_account_id as general_account_id, line.user_id as user_id
+ from
account_analytic_line line
where
(line.date <= CURRENT_DATE AND line.date > (CURRENT_DATE-15))
diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
index c895250284e..4de60162d1a 100644
--- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
+++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
@@ -6,6 +6,106 @@
name="Reporting"
parent="hr.menu_hr_root"
sequence="40" />
+
+
+ report.timesheet.line.graph
+ report.timesheet.line
+ graph
+
+
+
+
+
+
+
+
+
+
+ report.timesheet.line.tree
+ report.timesheet.line
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.timesheet.line.search
+ report.timesheet.line
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Timesheet Line
+ report.timesheet.line
+ form
+ tree,graph
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+
+
@@ -89,7 +189,7 @@
graph,tree
-
+
@@ -155,7 +255,7 @@
graph,tree
-
+
@@ -229,7 +329,7 @@
graph,tree
-
+
@@ -304,7 +404,7 @@
graph,tree
-
+
diff --git a/addons/hr_timesheet_invoice/wizard/__init__.py b/addons/hr_timesheet_invoice/wizard/__init__.py
index e1948e45406..6dce6a7b651 100644
--- a/addons/hr_timesheet_invoice/wizard/__init__.py
+++ b/addons/hr_timesheet_invoice/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,14 +15,14 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
import hr_timesheet_invoice_create
-import account_analytic_profit
+import hr_timesheet_analytic_profit
import hr_timesheet_final_invoice_create
-import wizard_account_analytic_cost_ledger_report
+import hr_timesheet_analytic_cost_ledger_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_timesheet_invoice/wizard/account_analytic_profit.py b/addons/hr_timesheet_invoice/wizard/account_analytic_profit.py
deleted file mode 100644
index 90861b6f5a9..00000000000
--- a/addons/hr_timesheet_invoice/wizard/account_analytic_profit.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# -*- 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 wizard
-import datetime
-import pooler
-from tools.translate import _
-
-form='''
-
-
-
-
-
-
'''
-
-class wizard_report(wizard.interface):
- def _date_from(*a):
- return datetime.datetime.today().strftime('%Y-%m-1')
-
- def _date_to(*a):
- return datetime.datetime.today().strftime('%Y-%m-%d')
-
- def _check(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- line_obj = pool.get('account.analytic.line')
- product_obj = pool.get('product.product')
- price_obj = pool.get('product.pricelist')
- ids = line_obj.search(cr, uid, [
- ('date', '>=', data['form']['date_from']),
- ('date', '<=', data['form']['date_to']),
- ('journal_id', 'in', data['form']['journal_ids'][0][2]),
- ('user_id', 'in', data['form']['employee_ids'][0][2]),
- ])
- if not ids:
- raise wizard.except_wizard(_('Data Insufficient!'), _('No Records Found for Report!'))
-
- return data['form']
-
-
- fields={
- 'date_from':{
- 'string':'From',
- 'type':'date',
- 'required':True,
- 'default':_date_from,
- },
- 'date_to':{
- 'string':'To',
- 'type':'date',
- 'required':True,
- 'default':_date_to,
- },
- 'journal_ids':{
- 'string':'Journal',
- 'type':'many2many',
- 'relation':'account.analytic.journal',
- 'required':True,
- },
- 'employee_ids':{
- 'string':'Employee',
- 'type':'many2many',
- 'relation':'res.users',
- 'required':True,
- },
- }
-
- states={
- 'init':{
- 'actions':[],
- 'result':{'type':'form', 'arch':form, 'fields':fields, 'state':[('end', 'Cancel', 'gtk-cancel'), ('report', 'Print', 'gtk-ok')]}
- },
- 'report':{
- 'actions':[_check],
- 'result':{'type':'print', 'report':'account.analytic.profit', 'state':'end'}
- }
- }
-wizard_report('account.analytic.profit')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_cost_ledger_report.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_cost_ledger_report.py
new file mode 100644
index 00000000000..418aac5edd3
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_cost_ledger_report.py
@@ -0,0 +1,52 @@
+# -*- 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 time
+
+from osv import osv, fields
+
+class hr_timesheet_analytic_cost_ledger(osv.osv_memory):
+ _name = 'hr.timesheet.analytic.cost.ledger'
+ _description = 'hr.timesheet.analytic.cost.ledger'
+ _columns = {
+ 'date1': fields.date('Start of period', required=True),
+ 'date2': fields.date('End of period', required=True)
+ }
+ _defaults = {
+ 'date1': lambda *a: time.strftime('%Y-01-01'),
+ 'date2': lambda *a: time.strftime('%Y-%m-%d')
+ }
+ def print_report(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+ datas = {
+ 'ids': 'active_ids' in context and context['active_ids'] or [],
+ 'model': 'account.analytic.account',
+ 'form': self.read(cr, uid, ids)[0]
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'hr.timesheet.invoice.account.analytic.account.cost_ledger',
+ 'datas': datas,
+ }
+
+hr_timesheet_analytic_cost_ledger()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py
new file mode 100644
index 00000000000..f5b37256a02
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py
@@ -0,0 +1,79 @@
+# -*- 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 datetime
+
+from osv import osv, fields
+from tools.translate import _
+
+class account_analytic_profit(osv.osv_memory):
+ _name = 'hr.timesheet.analytic.profit'
+ _description = 'Print Timesheet Profit'
+ _columns = {
+ 'date_from': fields.date('From', required=True),
+ 'date_to': fields.date('To', required=True),
+ 'journal_ids': fields.many2many('account.analytic.journal', 'analytic_profit_journal_rel', 'analytic_id', 'journal_id', 'Journal', required=True),
+ 'employee_ids': fields.many2many('res.users', 'analytic_profit_emp_rel', 'analytic_id', 'emp_id', 'Employee', required=True),
+ }
+
+ def _date_from(*a):
+ return datetime.datetime.today().strftime('%Y-%m-1')
+
+ def _date_to(*a):
+ return datetime.datetime.today().strftime('%Y-%m-%d')
+
+ _defaults = {
+ 'date_from': _date_from,
+ 'date_to': _date_to
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ line_obj = self.pool.get('account.analytic.line')
+ product_obj = self.pool.get('product.product')
+ price_obj = self.pool.get('product.pricelist')
+ data = {}
+ data['form'] = self.read(cr, uid , ids, [], context=context)[0]
+ if context is None:
+ context = {}
+ ids_chk = line_obj.search(cr, uid, [
+ ('date', '>=', data['form']['date_from']),
+ ('date', '<=', data['form']['date_to']),
+ ('journal_id', 'in', data['form']['journal_ids']),
+ ('user_id', 'in', data['form']['employee_ids']),
+ ])
+ if not ids_chk:
+ raise osv.except_osv(_('Data Insufficient!'), _('No Records Found for Report!'))
+
+ data['form']['journal_ids'] = [(6, 0, data['form']['journal_ids'])] # Improve me => Change the rml/sxw so that it can support withou [0][2]
+ data['form']['employee_ids'] = [(6, 0, data['form']['employee_ids'])]
+ datas = {
+ 'ids': [],
+ 'model': 'account.analytic.line',
+ 'form': data['form']
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.profit',
+ 'datas': datas,
+ }
+
+account_analytic_profit()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit_view.xml
new file mode 100644
index 00000000000..f79cae2eef8
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit_view.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+ Timesheet Profit
+ hr.timesheet.analytic.profit
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Timesheet Profit
+ ir.actions.act_window
+ hr.timesheet.analytic.profit
+ form
+ form
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
index 1f9efe9641f..e8309d84921 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,15 +15,14 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
-import wizard
-import pooler
import time
-from tools.translate import _
+from osv import osv, fields
+from tools.translate import _
#
# Create an final invoice based on selected timesheet lines
#
@@ -31,26 +30,37 @@ from tools.translate import _
#
# TODO: check unit of measure !!!
#
-class final_invoice_create(wizard.interface):
- def _get_defaults(self, cr, uid, data, context):
- return {}
+class final_invoice_create(osv.osv_memory):
+ _name = 'hr.timesheet.invoice.create.final'
+ _description = 'Create invoice from timesheet final'
+ _columns = {
+ 'date': fields.boolean('Date', help='Display date in the history of works'),
+ 'time': fields.boolean('Time spent', help='Display time in the history of works'),
+ 'name': fields.boolean('Name of entry', help='Display detail of work in the invoice line.'),
+ 'price': fields.boolean('Cost', help='Display cost of the item you reinvoice'),
+ 'balance_product': fields.many2one('product.product', 'Balance product', help='The product that will be used to invoice the remaining amount'),
+ }
- def _do_create(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- mod_obj = pool.get('ir.model.data')
+ def do_create(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ analytic_account_obj = self.pool.get('account.analytic.account')
+ res_partner_obj = self.pool.get('res.partner')
+ account_payment_term_obj = self.pool.get('account.payment.term')
+ invoices = []
+
+ if context is None:
+ context = {}
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
res = mod_obj.read(cr, uid, result, ['res_id'])
- analytic_account_obj = pool.get('account.analytic.account')
- res_partner_obj = pool.get('res.partner')
- account_payment_term_obj = pool.get('account.payment.term')
- account_ids = data['ids']
- invoices = []
+ data = self.read(cr, uid, ids, [], context)[0]
+ account_ids = 'active_ids' in context and context['active_ids'] or []
+
for account in analytic_account_obj.browse(cr, uid, account_ids, context):
partner = account.partner_id
amount_total=0.0
if (not partner) or not (account.pricelist_id):
- raise wizard.except_wizard(_('Analytic account incomplete'),
+ raise osv.except_osv(_('Analytic account incomplete'),
_('Please fill in the partner and pricelist field '
'in the analytic account:\n%s') % (account.name,))
@@ -67,15 +77,15 @@ class final_invoice_create(wizard.interface):
curr_invoice = {
'name': time.strftime('%D')+' - '+account.name,
'partner_id': account.partner_id.id,
- 'address_contact_id': pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['contact'])['contact'],
- 'address_invoice_id': pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['invoice'])['invoice'],
+ 'address_contact_id': self.pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['contact'])['contact'],
+ 'address_invoice_id': self.pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['invoice'])['invoice'],
'payment_term': partner.property_payment_term.id or False,
'account_id': partner.property_account_receivable.id,
'currency_id': account.pricelist_id.currency_id.id,
'date_due': date_due,
'fiscal_position': account.partner_id.property_account_position.id
}
- last_invoice = pool.get('account.invoice').create(cr, uid, curr_invoice)
+ last_invoice = self.pool.get('account.invoice').create(cr, uid, curr_invoice)
invoices.append(last_invoice)
context2=context.copy()
@@ -106,14 +116,14 @@ class final_invoice_create(wizard.interface):
line.product_uom_id,
move_line.ref""", (account.id,))
for product_id, amount, account_id, product_uom_id, ref in cr.fetchall():
- product = pool.get('product.product').browse(cr, uid, product_id, context2)
+ product = self.pool.get('product.product').browse(cr, uid, product_id, context2)
if product:
taxes = product.taxes_id
else:
taxes = []
- tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
+ tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
curr_line = {
'price_unit': -amount,
'quantity': 1.0,
@@ -126,14 +136,14 @@ class final_invoice_create(wizard.interface):
'account_id': account_id,
'account_analytic_id': account.id
}
- pool.get('account.invoice.line').create(cr, uid, curr_line)
+ self.pool.get('account.invoice.line').create(cr, uid, curr_line)
- if not data['form']['balance_product']:
- raise wizard.except_wizard(_('Balance product needed'), _('Please fill a Balance product in the wizard'))
- product = pool.get('product.product').browse(cr, uid, data['form']['balance_product'], context2)
+ if not data['balance_product']:
+ raise osv.except_osv(_('Balance product needed'), _('Please fill a Balance product in the wizard'))
+ product = self.pool.get('product.product').browse(cr, uid, data['balance_product'], context2)
taxes = product.taxes_id
- tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
+ tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
curr_line = {
'price_unit': account.amount_max - amount_total,
@@ -147,9 +157,9 @@ class final_invoice_create(wizard.interface):
'account_id': account_id,
'account_analytic_id': account.id
}
- pool.get('account.invoice.line').create(cr, uid, curr_line)
+ self.pool.get('account.invoice.line').create(cr, uid, curr_line)
if account.amount_max < amount_total:
- pool.get('account.invoice').write(cr, uid, [last_invoice], {'type': 'out_refund',})
+ self.pool.get('account.invoice').write(cr, uid, [last_invoice], {'type': 'out_refund',})
cr.execute('update account_analytic_line set invoice_id=%s where invoice_id is null and account_id=%s', (last_invoice, account.id))
return {
@@ -161,40 +171,9 @@ class final_invoice_create(wizard.interface):
'view_id': False,
'context': "{'type':'out_invoice'}",
'type': 'ir.actions.act_window',
- 'search_view_id': res['res_id']
- }
+ 'search_view_id': res['res_id']
+ }
+final_invoice_create()
- _create_form = """
-
-
-
-
-
-
-
-
-
"""
-
- _create_fields = {
- 'date': {'string':'Date', 'type':'boolean', 'help':"Display date in the history of works"},
- 'time': {'string':'Time spent', 'type':'boolean', 'help':"Display time in the history of works"},
- 'name': {'string':'Name of entry', 'type':'boolean', 'help':"Display detail of work in the invoice line."},
- 'price': {'string':'Cost', 'type':'boolean', 'help':"Display cost of the item you reinvoice"},
- 'balance_product': {'string':'Balance product', 'type': 'many2one', 'relation':'product.product', 'help':"The product that will be used to invoice the remaining amount."},
- }
-
- states = {
- 'init' : {
- 'actions' : [_get_defaults],
- 'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','Cancel', 'gtk-cancel'),('create','Create invoices', 'gtk-ok')]},
- },
- 'create' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_do_create, 'state':'end'},
- },
- }
-final_invoice_create('hr.timesheet.final.invoice.create')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_analytic_cost_ledger_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_analytic_cost_ledger_view.xml
new file mode 100644
index 00000000000..c8f9806a309
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_analytic_cost_ledger_view.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+ Cost Ledger
+ hr.timesheet.analytic.cost.ledger
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cost Ledger
+ ir.actions.act_window
+ hr.timesheet.analytic.cost.ledger
+ form
+ form
+ new
+
+
+
+
+
+ Cost Ledger
+ client_print_multi
+
+ action
+ account.analytic.account
+
+
+
+
\ No newline at end of file
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 7e5edca5474..89ff5e92697 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
@@ -19,52 +19,69 @@
#
##############################################################################
-import wizard
-import pooler
import time
+
+from osv import osv, fields
from tools.translate import _
-#
-# Create an invoice based on selected timesheet lines
+## Create an invoice based on selected timesheet lines
#
#
# TODO: check unit of measure !!!
#
-class invoice_create(wizard.interface):
- def _get_accounts(self, cr, uid, data, context):
- if not len(data['ids']):
+class hr_timesheet_invoice_create(osv.osv_memory):
+
+ _name = 'hr.timesheet.invoice.create'
+ _description = 'Create invoice from timesheet'
+ _columns = {
+ 'accounts': fields.many2many('account.analytic.account', 'invoice_id', 'account_id', 'Analytic Accounts', required=True),
+ 'date': fields.boolean('Date', help='The real date of each work will be displayed on the invoice'),
+ 'time': fields.boolean('Time spent', help='The time of each work done will be displayed on the invoice'),
+ 'name': fields.boolean('Name of entry', help='The detail of each work done will be displayed on the invoice'),
+ 'price': fields.boolean('Cost', help='The cost of each work done will be displayed on the invoice. You probably don\'t want to check this'),
+ 'product': fields.many2one('product.product', 'Product', help='Complete this field only if you want to force to use a specific product. Keep empty to use the real product that comes from the cost.'),
+ }
+
+ def _get_accounts(self, cr, uid, context=None):
+ if context is None:
+ context = {}
+ if not len(context['active_ids']):
return {}
#Checking whether the analytic line is invoiced or not
- pool = pooler.get_pool(cr.dbname)
- analytic_line_obj = pool.get('account.analytic.line').browse(cr, uid, data['ids'], context)
+ analytic_line_obj = self.pool.get('account.analytic.line').browse(cr, uid, context['active_ids'], context)
for obj_acc in analytic_line_obj:
if obj_acc.invoice_id and obj_acc.invoice_id.state !='cancel':
- raise wizard.except_wizard(_('Warning'),_('The analytic entry "%s" is already invoiced!')%(obj_acc.name,))
-
- cr.execute("SELECT distinct(account_id) from account_analytic_line where id =ANY(%s)",(data['ids'],))
- account_ids = cr.fetchall()
- return {'accounts': [x[0] for x in account_ids]}
+ raise osv.except_osv(_('Warning'),_('The analytic entry "%s" is already invoiced!')%(obj_acc.name,))
+
+ cr.execute("SELECT distinct(account_id) from account_analytic_line where id =ANY(%s)",(context['active_ids'],))
+ account_ids = cr.fetchall()
+ return [x[0] for x in account_ids]
+
+ _defaults = {
+ 'accounts': _get_accounts
+ }
+
+ def do_create(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ analytic_account_obj = self.pool.get('account.analytic.account')
+ res_partner_obj = self.pool.get('res.partner')
+ account_payment_term_obj = self.pool.get('account.payment.term')
+ invoices = []
- def _do_create(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- mod_obj = pool.get('ir.model.data')
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
res = mod_obj.read(cr, uid, result, ['res_id'])
- analytic_account_obj = pool.get('account.analytic.account')
- res_partner_obj = pool.get('res.partner')
- account_payment_term_obj = pool.get('account.payment.term')
- account_ids = data['form']['accounts'][0][2]
- invoices = []
+ data = self.read(cr, uid, ids, [], context)[0]
+ account_ids = data['accounts']
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'),
+ raise osv.except_osv(_('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'),
+ raise osv.except_osv(_('Partner incomplete'),
_('Please fill in the Address field in the Partner: %s.') % (partner.name,))
date_due = False
@@ -90,7 +107,7 @@ class invoice_create(wizard.interface):
'date_due': date_due,
'fiscal_position': account.partner_id.property_account_position.id
}
- last_invoice = pool.get('account.invoice').create(cr, uid, curr_invoice)
+ last_invoice = self.pool.get('account.invoice').create(cr, uid, curr_invoice)
invoices.append(last_invoice)
context2=context.copy()
@@ -99,26 +116,26 @@ class invoice_create(wizard.interface):
"FROM account_analytic_line as line " \
"WHERE account_id = %s " \
"AND id =ANY(%s) AND to_invoice IS NOT NULL " \
- "GROUP BY product_id,to_invoice", (account.id,data['ids'],))
+ "GROUP BY product_id,to_invoice", (account.id,context['active_ids'],))
for product_id,factor_id,qty in cr.fetchall():
product = pool.get('product.product').browse(cr, uid, product_id, context2)
if not product:
- raise wizard.except_wizard(_('Error'), _('At least one line has no product !'))
+ raise osv.except_osv(_('Error'), _('At least one line has no product !'))
factor_name = ''
factor = pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context2)
- if not data['form']['product']:
+ if not data['product']:
if factor.customer_name:
factor_name = product.name+' - '+factor.customer_name
else:
factor_name = product.name
else:
- factor_name = pool.get('product.product').name_get(cr, uid, [data['form']['product']], context=context)[0][1]
+ factor_name = pool.get('product.product').name_get(cr, uid, [data['product']], context=context)[0][1]
if account.pricelist_id:
pl = account.pricelist_id.id
- price = pool.get('product.pricelist').price_get(cr,uid,[pl], data['form']['product'] or product_id, qty or 1.0, account.partner_id.id)[pl]
+ price = pool.get('product.pricelist').price_get(cr,uid,[pl], data['product'] or product_id, qty or 1.0, account.partner_id.id)[pl]
else:
price = 0.0
@@ -132,7 +149,7 @@ class invoice_create(wizard.interface):
'invoice_line_tax_id': [(6,0,tax )],
'invoice_id': last_invoice,
'name': factor_name,
- 'product_id': data['form']['product'] or product_id,
+ 'product_id': data['product'] or product_id,
'invoice_line_tax_id': [(6,0,tax)],
'uos_id': product.uom_id.id,
'account_id': account_id,
@@ -149,27 +166,27 @@ class invoice_create(wizard.interface):
for line in line_ids:
# set invoice_line_note
details = []
- if data['form']['date']:
+ if data['date']:
details.append(line['date'])
- if data['form']['time']:
+ if data['time']:
if line['product_uom_id']:
details.append("%s %s" % (line['unit_amount'], pool.get('product.uom').browse(cr, uid, [line['product_uom_id']])[0].name))
else:
details.append("%s" % (line['unit_amount'], ))
- if data['form']['name']:
+ if data['name']:
details.append(line['name'])
- #if data['form']['price']:
+ #if data['price']:
# details.append(abs(line['amount']))
note.append(u' - '.join(map(lambda x: unicode(x) or '',details)))
curr_line['note'] = "\n".join(map(lambda x: unicode(x) or '',note))
pool.get('account.invoice.line').create(cr, uid, curr_line)
- cr.execute("update account_analytic_line set invoice_id=%s WHERE account_id = %s and id =ANY(%s)" ,(last_invoice,account.id,data['ids']))
+ cr.execute("update account_analytic_line set invoice_id=%s WHERE account_id = %s and id =ANY(%s)" ,(last_invoice, account.id,data['ids']))
- pool.get('account.invoice').button_reset_taxes(cr, uid, [last_invoice], context)
+ self.pool.get('account.invoice').button_reset_taxes(cr, uid, [last_invoice], context)
- mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
- act_obj = pooler.get_pool(cr.dbname).get('ir.actions.act_window')
+ mod_obj = self.pool.get('ir.model.data')
+ act_obj = self.pool.get('ir.actions.act_window')
mod_id = mod_obj.search(cr, uid, [('name', '=', 'action_invoice_tree1')])[0]
res_id = mod_obj.read(cr, uid, mod_id, ['res_id'])['res_id']
@@ -190,45 +207,8 @@ class invoice_create(wizard.interface):
# 'search_view_id': res['res_id']
# }
- _create_form = """
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
"""
- _create_fields = {
- 'accounts': {'string':'Analytic Accounts', 'type':'many2many', 'required':'true', 'relation':'account.analytic.account'},
- 'date': {'string':'Date', 'type':'boolean', 'help':'The real date of each work will be displayed on the invoice'},
- 'time': {'string':'Time spent', 'type':'boolean', 'help':'The time of each work done will be displayed on the invoice'},
- 'name': {'string':'Name of entry', 'type':'boolean', 'help':'The detail of each work done will be displayed on the invoice'},
- 'price': {'string':'Cost', 'type':'boolean', 'help':'The cost of each work done will be displayed on the invoice. You probably don\'t want to check this.'},
- 'product': {'string':'Product', 'type':'many2one', 'relation': 'product.product', 'help':"Complete this field only if you want to force to use a specific product. Keep empty to use the real product that comes from the cost."},
- }
-
- states = {
- 'init' : {
- 'actions' : [_get_accounts],
- 'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','Cancel', 'gtk-cancel'),('create','Create Invoices', 'gtk-ok')]},
- },
- 'create' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_do_create, 'state':'end'},
- },
- }
-invoice_create('hr.timesheet.invoice.create')
+hr_timesheet_invoice_create()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml
new file mode 100644
index 00000000000..7b3f5ed4d6a
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+ hr.timesheet.invoice.create.final.form
+ hr.timesheet.invoice.create.final
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Final Invoice
+ ir.actions.act_window
+ hr.timesheet.invoice.create.final
+ form
+ form
+ new
+
+
+
+
+
+ Final Invoice
+ client_action_multi
+
+ action
+ account.analytic.account
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml
new file mode 100644
index 00000000000..7ddf3bc99a7
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+ hr.timesheet.invoice.create.form
+ hr.timesheet.invoice.create
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Invoice analytic lines
+ ir.actions.act_window
+ hr.timesheet.invoice.create
+ form
+ form
+ new
+
+
+
+
+
+ Invoice analytic lines
+ client_action_multi
+
+ action
+ account.analytic.line
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_timesheet_sheet/__init__.py b/addons/hr_timesheet_sheet/__init__.py
index 46961316bb4..d7635359c74 100644
--- a/addons/hr_timesheet_sheet/__init__.py
+++ b/addons/hr_timesheet_sheet/__init__.py
@@ -21,6 +21,6 @@
import hr_timesheet_sheet
import wizard
-
+import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_timesheet_sheet/__openerp__.py b/addons/hr_timesheet_sheet/__openerp__.py
index 9042d4200f1..44058d048cb 100644
--- a/addons/hr_timesheet_sheet/__openerp__.py
+++ b/addons/hr_timesheet_sheet/__openerp__.py
@@ -52,7 +52,8 @@ The validation can be configured in te company:
'security/hr_timesheet_data.xml',
'hr_timesheet_sheet_view.xml',
'hr_timesheet_workflow.xml',
- 'process/hr_timesheet_sheet_process.xml'
+ 'process/hr_timesheet_sheet_process.xml',
+ 'report/timesheet_report_view.xml',
],
'demo_xml': ['hr_timesheet_sheet_demo.xml'],
'installable': True,
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index 81b86fecfa6..1a8b110d690 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -20,7 +20,18 @@
-
+
+ hr.timesheet.sheet.graph
+ hr_timesheet_sheet.sheet
+ graph
+
+
+
+
+
+
+
+ hr.timesheet.account.formhr_timesheet_sheet.sheet.account
@@ -181,10 +192,10 @@
-
+
-
-
+
+
diff --git a/addons/hr_timesheet_sheet/report/__init__.py b/addons/hr_timesheet_sheet/report/__init__.py
new file mode 100644
index 00000000000..89f12b7c9a6
--- /dev/null
+++ b/addons/hr_timesheet_sheet/report/__init__.py
@@ -0,0 +1,25 @@
+# -*- 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 timesheet_report
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report.py b/addons/hr_timesheet_sheet/report/timesheet_report.py
new file mode 100644
index 00000000000..ee016df56d7
--- /dev/null
+++ b/addons/hr_timesheet_sheet/report/timesheet_report.py
@@ -0,0 +1,94 @@
+# -*- 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 timesheet_report(osv.osv):
+ _name = "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),
+ 'day': fields.char('Day', size=128, readonly=True),
+ 'name': fields.char('Description', size=64,readonly=True),
+ 'user_id': fields.many2one('res.users', 'User',readonly=True),
+ 'nbr': fields.integer('#Nbr',readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company',readonly=True),
+ 'department_id':fields.many2one('hr.department','Department',readonly=True),
+ 'date_from': fields.date('Date from',readonly=True,),
+ 'date_to': fields.date('Date to',readonly=True),
+ 'date_current': fields.date('Current date', required=True),
+ 'state' : fields.selection([
+ ('new', 'New'),
+ ('draft','Draft'),
+ ('confirm','Confirmed'),
+ ('done','Done')], 'State', readonly=True),
+ 'total_att': fields.float('Total Timesheet',readonly=True),
+ 'total_ts': fields.float('Total Attendance',readonly=True),
+ 'total_diff': fields.float('Difference', readonly=True),
+ }
+
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'timesheet_report')
+ cr.execute("""
+ create or replace view timesheet_report as (
+ select
+ min(aal.id) as id,
+ htss.date_current,
+ htss.name,
+ htss.date_from,
+ htss.date_to,
+ to_char(htss.date_current,'YYYY') as year,
+ to_char(htss.date_current,'MM') as month,
+ to_char(htss.date_current, 'YYYY-MM-DD') as day,
+ count(*) as nbr,
+ sum(day.total_attendance) as total_att,
+ sum(day.total_timesheet) as total_ts,
+ sum(day.total_difference) as total_diff,
+ aal.account_id,
+ htss.user_id,
+ htss.company_id,
+ htss.department_id,
+ htss.state
+ from account_analytic_line as aal
+ left join hr_analytic_timesheet as hat ON (hat.line_id=aal.id)
+ left join hr_timesheet_sheet_sheet as htss ON (hat.line_id=htss.id)
+ left join hr_timesheet_sheet_sheet_day AS day ON (htss.id = day.sheet_id)
+ group by
+ to_char(htss.date_current,'YYYY'),
+ to_char(htss.date_current,'MM'),
+ to_char(htss.date_current, 'YYYY-MM-DD'),
+ aal.account_id,
+ htss.date_from,
+ htss.date_to,
+ htss.date_current,
+ htss.name,
+ htss.company_id,
+ htss.state,
+ htss.department_id,
+ htss.user_id
+ )
+ """)
+timesheet_report()
\ No newline at end of file
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
new file mode 100644
index 00000000000..976b2a6f8ea
--- /dev/null
+++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
@@ -0,0 +1,119 @@
+
+
+
+
+ timesheet.report.graph
+ timesheet.report
+ graph
+
+
+
+
+
+
+
+
+
+
+ timesheet.report.tree
+ timesheet.report
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ timesheet.report.search
+ timesheet.report
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Timesheet
+ timesheet.report
+ form
+ tree,graph
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+
+
diff --git a/addons/hr_timesheet_sheet/wizard/__init__.py b/addons/hr_timesheet_sheet/wizard/__init__.py
index f6fba6021af..485bfbe5db2 100644
--- a/addons/hr_timesheet_sheet/wizard/__init__.py
+++ b/addons/hr_timesheet_sheet/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,12 +15,11 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
-import wizard_timesheet_current
-import wizard_timesheet_department
+import hr_timesheet_current
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_timesheet_sheet/wizard/wizard_timesheet_current.py b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py
similarity index 73%
rename from addons/hr_timesheet_sheet/wizard/wizard_timesheet_current.py
rename to addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py
index 8613df3bc82..4d9998014c8 100644
--- a/addons/hr_timesheet_sheet/wizard/wizard_timesheet_current.py
+++ b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,27 +15,27 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
-
-
-import wizard
-import netsvc
import time
-import pooler
-from osv import osv
+
+from osv import osv, fields
from tools.translate import _
-class wiz_timesheet_open(wizard.interface):
- def _open_timesheet(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- user_ids = pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)])
- if not len(user_ids):
- raise wizard.except_wizard(_('Error !'), _('No employee defined for your user !'))
- ts = pool.get('hr_timesheet_sheet.sheet')
- ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))])
+class hr_timesheet_current_open(osv.osv_memory):
+ _name = 'hr.timesheet.current.open'
+ _description = 'hr.timesheet.current.open'
+
+ def open_timesheet(self, cr, uid, ids, context=None):
+ ts = self.pool.get('hr_timesheet_sheet.sheet')
view_type = 'form,tree'
+
+ user_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)])
+ if not len(user_ids):
+ raise osv.except_osv(_('Error !'), _('No employee defined for your user !'))
+ ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))])
+
if len(ids) > 1:
view_type = 'tree,form'
domain = "[('id','in',["+','.join(map(str, ids))+"]),('user_id', '=', uid)]"
@@ -46,7 +46,7 @@ class wiz_timesheet_open(wizard.interface):
domain = "[('user_id', '=', uid)]"
value = {
'domain': domain,
- 'name': 'Open timesheet',
+ 'name': 'Open Timesheet',
'view_type': 'form',
'view_mode': view_type,
'res_model': 'hr_timesheet_sheet.sheet',
@@ -57,14 +57,6 @@ class wiz_timesheet_open(wizard.interface):
value['res_id'] = ids[0]
return value
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_timesheet, 'state':'end'}
- }
- }
-wiz_timesheet_open('hr_timesheet_sheet.current.open')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+hr_timesheet_current_open()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet_sheet/wizard/wizard_timesheet_department.py b/addons/hr_timesheet_sheet/wizard/wizard_timesheet_department.py
deleted file mode 100644
index 93aa12045ba..00000000000
--- a/addons/hr_timesheet_sheet/wizard/wizard_timesheet_department.py
+++ /dev/null
@@ -1,114 +0,0 @@
-# -*- 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 wizard
-import netsvc
-import time
-import pooler
-from osv import osv
-
-class wiz_timesheet_open(wizard.interface):
- def _open_timesheet(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- dep_ids = pool.get('hr.department').search(cr, uid, [('manager_id','=',uid)])
- user_ids = {}
- for dep in pool.get('hr.department').browse(cr, uid, dep_ids, context):
- for user in dep.member_ids:
- user_ids[user.id] = 1
- value = {
- 'domain': "[('user_id', 'in', "+str(user_ids.keys())+")]",
- 'name': 'Timesheets',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'hr_timesheet_sheet.sheet',
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
- return value
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_timesheet, 'state':'end'}
- }
- }
-wiz_timesheet_open('hr_timesheet_sheet.department.open')
-
-class wiz_timesheet_confirm_open(wizard.interface):
- def _open_timesheet(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- dep_ids = pool.get('hr.department').search(cr, uid, [('manager_id','=',uid)])
- user_ids = {}
- for dep in pool.get('hr.department').browse(cr, uid, dep_ids, context):
- for user in dep.member_ids:
- user_ids[user.id] = 1
- value = {
- 'domain': "[('user_id', 'in', "+str(user_ids.keys())+"),('state','=','draft')]",
- 'name': 'Timesheets',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'hr_timesheet_sheet.sheet',
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
- return value
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_timesheet, 'state':'end'}
- }
- }
-wiz_timesheet_confirm_open('hr_timesheet_sheet.department.confirm.open')
-
-
-class wiz_timesheet_validate_open(wizard.interface):
- def _open_timesheet(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- dep_ids = pool.get('hr.department').search(cr, uid, [('manager_id','=',uid)])
- user_ids = {}
- for dep in pool.get('hr.department').browse(cr, uid, dep_ids, context):
- for user in dep.member_ids:
- user_ids[user.id] = 1
- value = {
- 'domain': "[('user_id', 'in', "+str(user_ids.keys())+"),('state','=','confirm')]",
- 'name': 'Timesheets',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'hr_timesheet_sheet.sheet',
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
- return value
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_timesheet, 'state':'end'}
- }
- }
-wiz_timesheet_validate_open('hr_timesheet_sheet.department.validate.open')
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 429a3497634..675c4a73bb0 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -162,16 +162,25 @@ class mrp_bom(osv.osv):
"""
result = {}
bom_obj = self.pool.get('mrp.bom')
+ bom_id = context and context.get('active_id', False) or False
+ cr.execute('select id from mrp_bom')
+ if all(bom_id != r[0] for r in cr.fetchall()):
+ ids.sort()
+ bom_id = ids[0]
+ bom_parent = bom_obj.browse(cr, uid, bom_id)
for bom in self.browse(cr, uid, ids, context=context):
- result[bom.id] = map(lambda x: x.id, bom.bom_lines)
+ if (bom_parent and bom_parent.multi_level_bom) or bom.id == bom_id:
+ result[bom.id] = map(lambda x: x.id, bom.bom_lines)
+ else:
+ result[bom.id] = []
if bom.bom_lines:
continue
ok = ((name=='child_complete_ids') and (bom.product_id.supply_method=='produce'))
- if bom.type=='phantom' or ok:
+ if (bom.type=='phantom' or ok) and bom_parent.multi_level_bom:
sids = bom_obj.search(cr, uid, [('bom_id','=',False),('product_id','=',bom.product_id.id)])
if sids:
bom2 = bom_obj.browse(cr, uid, sids[0], context=context)
- result[bom.id] += map(lambda x: x.id, bom2.bom_lines)
+ result[bom.id] += map(lambda x: x.id, bom2.bom_lines)
return result
@@ -267,7 +276,7 @@ class mrp_bom(osv.osv):
v['name'] = prod.name
return {'value': v}
return {}
-
+
def _bom_find(self, cr, uid, product_id, product_uom, properties=[]):
""" Finds BoM for particular product and product uom.
@param product_id: Selected product.
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 6e7a1afb6dc..5b8b7c41084 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -253,13 +253,13 @@
-
+
-
+
@@ -618,7 +618,8 @@
- formtree,form,calendar,graph,gantt
- {"search_default_current":1}
@@ -852,7 +852,7 @@
-
+ mrp.procurementform
- {"search_default_current":1}
@@ -322,7 +322,7 @@
-
+
@@ -337,9 +337,5 @@
id="menu_view_olap_application_field_form"
parent="menu_bi_conf_known_application"/>
-
-
-
-
diff --git a/addons/olap/test/olap_test00.yml b/addons/olap/test/olap_test00.yml
new file mode 100644
index 00000000000..af87950468f
--- /dev/null
+++ b/addons/olap/test/olap_test00.yml
@@ -0,0 +1,111 @@
+-
+ In order to check olap module which is used to configure BI from OpenERP client.I create olap fact database record.
+-
+ !record {model: olap.fact.database, id: olap_fact_database_openerp0}:
+ connection_type: port
+ db_host: localhost
+ db_login: postgres
+ db_name: tiny
+ db_password: '123456'
+ db_port: 5432
+ name: OpenERP
+ type: postgres
+-
+ I will check the connection for successful login. >>>>>>(Problem)
+# !python {model: olap.fact.database}: |
+ # self.test_connection(cr, uid,[ref('olap_fact_database_openerp0')], context)
+-
+ In order to test schema,I create a new schema record.
+-
+ !record {model: olap.schema, id: olap_schema_Partners0}:
+ database_id: olap_fact_database_openerp0
+ name: Partners
+-
+ I press "Connect to Database" and I see that the Schema State is "Database Connected" now
+-
+ !workflow {model: olap.schema, action: dbconnect, ref: olap_schema_Partners0}
+-
+ Now I will load the structure of the database. by structure we mean tables, columns and the relations. This will help in defining cube easily.
+-
+ !record {model: bi.load.db.wizard, id: bi_load_db_wizard_0}:
+ db_name: OpenERP
+ fact_table: Partners
+-
+ I can see two buttons for Configuration one for manually and the other is for Automatically.I press "Configure Automatically".After configuration I can see that the Boolean Configuring Data-structure is True now Schema State is "The Structure is Configured" and there is one button "Mark as Configured"
+-
+ !record {model: bi.auto.configure.wizard, id: bi_auto_configure_wizard_Partners0}:
+ name: Partners
+-
+ Performing a workflow action load on module olap.schema
+-
+ !workflow {model: olap.schema, action: dbload, ref: olap_schema_Partners0}
+-
+ Performing a workflow action configure on module olap.schema
+-
+ !workflow {model: olap.schema, action: dbconfigure, ref: olap_schema_Partners0}
+-
+ Performing a workflow action dbready on module olap.schema
+-
+ !workflow {model: olap.schema, action: dbready, ref: olap_schema_Partners0}
+-
+ In order to create Cube I first define the fact table.Fact table are the key tables in which measures are stored and we can branch to other tables for other parameters.
+-
+ !record {model: olap.database.tables, id: database_table_res_partner}:
+ active: True
+ fact_database_id: fact_database_terp
+ name: res_partner
+ table_db_name: res_partner
+-
+ I create cube table and select ID of as Relational Column.Then I select related record in Joined tables.
+-
+ !record {model: olap.cube.table, id: olap_cube_table_partnercubetable0}:
+ column_link_id: olap.columns_res_partner_id
+ name: Partner cube table
+ available_table_ids:
+ - olap.columns_res_partner_date
+ - olap.columns_res_partner_id
+ - olap.columns_res_partner_credit_limit
+ - olap.columns_res_partner_user_id
+
+-
+ I can configure Cube from BI Cube Designer.I make sure that OpenERP BI web-client is running.From Configuration I click on "Cube Designer" and It will open Cube Designer in my system browser.I can see that the schema "Partners" is visible through Cube Designer.
+-
+ Creating olap cube
+-
+ !record {model: olap.cube, id: olap_cube_partnercube0}:
+ name: Partner cube
+ query_log: true
+ schema_id: olap_schema_Partners0
+ table_id: olap_cube_table_partnercubetable0
+-
+ After cube we can decide upon the dimensions to be used for the cube.In order to analyze Partner I create one dimension.
+-
+ !record {model: olap.dimension, id: olap_dimension_products0}:
+ name: Products
+ cube_id: olap_cube_partnercube0
+-
+ After adding the dimension I create hierarchy.
+-
+ !record {model: olap.hierarchy, id: olap_hierarchy_allproducts0}:
+ dimension_id: olap_dimension_products0
+ name: All Products
+ sequence: 1
+ table_id: olap_cube_table_partnercubetable0
+-
+ After adding the hierarchy I create level.I select Product's default_code as Columns Name that is loaded in Fact columns.
+-
+ !record {model: olap.level, id: olap_level_productscode0}:
+ column_id_name: name
+ column_name: olap.columns_res_user_name
+ hierarchy_id: olap_hierarchy_allproducts0
+ name: Products code
+ sequence: 1
+ table_name: res_users
+ type: normal
+-
+ I will check that columns is loaded in Fact Table.
+-
+ !python {model: olap.load.column}: |
+ ids = self.search(cr, uid, [])
+ self.get_table_data(cr, uid, ids, {'active_ids': [ref('olap_cube_table_partnercubetable0')]})
+
diff --git a/addons/olap/wizard/olap_load_column.py b/addons/olap/wizard/olap_load_column.py
index 422a50abcff..65517626d62 100644
--- a/addons/olap/wizard/olap_load_column.py
+++ b/addons/olap/wizard/olap_load_column.py
@@ -26,7 +26,6 @@ class olap_load_column(osv.osv_memory):
_description = "Olap Load Column"
def get_table_data(self, cr, uid, ids, context={}):
-
"""
This function load column
@param cr: the current row, from the database cursor,
diff --git a/addons/olap_extract/i18n/zh_CN.po b/addons/olap_extract/i18n/zh_CN.po
deleted file mode 100644
index d38f5a530e8..00000000000
--- a/addons/olap_extract/i18n/zh_CN.po
+++ /dev/null
@@ -1,56 +0,0 @@
-# Chinese (Simplified) translation for openobject-addons
-# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
-# This file is distributed under the same license as the openobject-addons package.
-# FIRST AUTHOR , 2010.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: openobject-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-11-26 05:29+0000\n"
-"PO-Revision-Date: 2010-04-08 02:07+0000\n"
-"Last-Translator: Silence \n"
-"Language-Team: Chinese (Simplified) \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
-"X-Generator: Launchpad (build Unknown)\n"
-
-#. module: olap_extract
-#: model:ir.module.module,shortdesc:olap_extract.module_meta_information
-msgid "olap_extract"
-msgstr ""
-
-#. module: olap_extract
-#: wizard_button:olap.extract.schema,init,ok:0
-msgid "OK"
-msgstr "确定"
-
-#. module: olap_extract
-#: model:ir.actions.wizard,name:olap_extract.bi_olap_extract_schema
-msgid "Olap Extract"
-msgstr "Olap提取"
-
-#. module: olap_extract
-#: model:ir.module.module,description:olap_extract.module_meta_information
-msgid ""
-"\n"
-" Extracts the schema structure.\n"
-" "
-msgstr ""
-
-#. module: olap_extract
-#: wizard_field:olap.extract.schema,init,module_name:0
-msgid "Module Name"
-msgstr "模块名称"
-
-#. module: olap_extract
-#: wizard_button:olap.extract.schema,init,end:0
-msgid "Cancel"
-msgstr "取消"
-
-#. module: olap_extract
-#: wizard_view:olap.extract.schema,init:0
-msgid "New Module Name"
-msgstr "新的模块名"
diff --git a/addons/product/partner_view.xml b/addons/product/partner_view.xml
index 61ef58b8941..66e4ba84c37 100644
--- a/addons/product/partner_view.xml
+++ b/addons/product/partner_view.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/addons/product/pricelist_view.xml b/addons/product/pricelist_view.xml
index 0d4685593c3..604c2b75324 100644
--- a/addons/product/pricelist_view.xml
+++ b/addons/product/pricelist_view.xml
@@ -2,10 +2,7 @@
-
+
product.pricelist.version.form
diff --git a/addons/profile_manufacturing/i18n/nl.po b/addons/profile_manufacturing/i18n/nl.po
index 3b07c5da62a..43fc7db315a 100644
--- a/addons/profile_manufacturing/i18n/nl.po
+++ b/addons/profile_manufacturing/i18n/nl.po
@@ -7,24 +7,24 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-04-15 09:57+0000\n"
-"Last-Translator: The Loeki \n"
+"PO-Revision-Date: 2010-04-22 10:54+0000\n"
+"Last-Translator: Jan Verlaan (Veritos) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-21 04:06+0000\n"
+"X-Launchpad-Export-Date: 2010-04-23 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,mrp_operation:0
msgid "Manufacturing Operations"
-msgstr ""
+msgstr "Productie operaties"
#. module: profile_manufacturing
#: model:ir.module.module,description:profile_manufacturing.module_meta_information
msgid "Profile for manufacturing industries"
-msgstr ""
+msgstr "Profiel voor productie industrie"
#. module: profile_manufacturing
#: constraint:ir.model:0
@@ -36,22 +36,22 @@ msgstr ""
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,mrp_jit:0
msgid "Just in Time Scheduling"
-msgstr ""
+msgstr "Just in time planning"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,sale_journal:0
msgid "Manage by Journals"
-msgstr ""
+msgstr "Beheer middels dagboeken"
#. module: profile_manufacturing
#: view:profile.manufacturing.config.install_modules_wizard:0
msgid "Relationship Management"
-msgstr ""
+msgstr "Relatiebeheer"
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,portal:0
msgid "This module allows you to manage a Portal system."
-msgstr ""
+msgstr "Deze module helpt u het portaal-systeem te beheren."
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,board_document:0
@@ -61,6 +61,11 @@ msgid ""
"documents, printed reports, calendar system). It opens an FTP access for the "
"users to easily browse association's document."
msgstr ""
+"Met het documentbeheersysteem van OpenERP kunt u allerlei documenten "
+"(interne documenten, afgedrukte overzichten, agenda's) opslaan, "
+"doorbladeren, automatisch indexeren, zoeken en inzien.\r\n"
+"Het systeem maakt gebruik van FTP toegang zodat gebruikers eenvoudig bij de "
+"documenten kunnen komen."
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,sale_journal:0
@@ -69,17 +74,20 @@ msgid ""
"journals. You can define journals for trucks, salesman, departments, "
"invoicing date delivery period, etc."
msgstr ""
+"Deze module help u uw verkopen, facturatie en materiaal picking the beheren "
+"middels dagboeken. U kunt dagboeken definiëren voor vrachtwagens, verkopers, "
+"afdelingen, factuurdatum aflever periode, enz."
#. module: profile_manufacturing
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Ongeldige modelnaam in de definitie van de actie."
#. module: profile_manufacturing
#: model:ir.actions.act_window,name:profile_manufacturing.action_config_install_module
#: view:profile.manufacturing.config.install_modules_wizard:0
msgid "Manufacturing Profile: Install Extra Modules"
-msgstr ""
+msgstr "Installeer extra modulen"
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,mrp_jit:0
@@ -88,6 +96,11 @@ msgid ""
"and faster for real time stock computation but, in counter-part, it manages "
"less efficiently priorities in procurements."
msgstr ""
+"De JIT (Just in Time) module stelt u in staat een directe mrp-planningsrun "
+"van het actieve product bij wijzigingen te laten uitvoeren. Dit is "
+"makkelijker en sneller in gebruik voor real time voorraad berekening, maar "
+"heeft als nadeel dat het minder efficiënt prioriteiten kan stellen bij "
+"genereren van inkoopaanvragen."
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,mrp_operation:0
@@ -96,16 +109,20 @@ msgid ""
"work order/operation. You will be able to planify, analyse the cost, check "
"times, ... on all operations of each manufacturing order"
msgstr ""
+"Deze module stelt u in staat om niet alleen de productie order te beheren, "
+"maar ook de operaties. U zult in staat zijn om te plannen, haar kosten te "
+"analyseren, tijden te controleren, ... over alle operaties van elke "
+"productieorder."
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,board_document:0
msgid "Document Management"
-msgstr ""
+msgstr "Documentbeheer"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,portal:0
msgid "Portal"
-msgstr ""
+msgstr "Portaal"
#. module: profile_manufacturing
#: view:profile.manufacturing.config.install_modules_wizard:0
@@ -118,6 +135,8 @@ msgid ""
"Allow to manage product repairs. Handle the guarantee limit date and the "
"invoicing of products and services."
msgstr ""
+"Deze module stelt u in staat om productreparaties te beheren. Beheer "
+"garantietermeinen en de facturatie van producten en services."
#. module: profile_manufacturing
#: constraint:ir.ui.view:0
@@ -131,21 +150,27 @@ msgid ""
"manufacturing profile you selected. You will be able to install them based "
"on our requirements."
msgstr ""
+"Installeer meer modules. Enkele modules worden voorgesteld in "
+"overeenstemming met dit productieprofiel dat u heeft geselecteerd. U zult in "
+"staat om deze modules te installeren waarbij OpenERP rekening houd met de "
+"benodigde afhankelijkheden."
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,mrp_subproduct:0
msgid "This module allows you to add sub poducts in mrp bom."
msgstr ""
+"Deze module stelt u in staat om subproducten toe te voegen in de BOM (Bill "
+"of Materials)"
#. module: profile_manufacturing
#: model:ir.module.module,shortdesc:profile_manufacturing.module_meta_information
msgid "Manufacturing industry profile"
-msgstr ""
+msgstr "Productie industrie profiel"
#. module: profile_manufacturing
#: model:ir.model,name:profile_manufacturing.model_profile_manufacturing_config_install_modules_wizard
msgid "profile.manufacturing.config.install_modules_wizard"
-msgstr ""
+msgstr "profile.manufacturing.config.install_modules_wizard"
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,sale_crm:0
@@ -154,6 +179,9 @@ msgid ""
"opportunities tracking, shared calendar, jobs tracking, bug tracker, and so "
"on."
msgstr ""
+"Deze module installeert de Customer Relation Management (CRM) uitbreidingen "
+"als: volgen van leads en kansen, gedeelde agenda's, HRM werving- & "
+"selectieproces, foutenrapportbeheer, enz."
#. module: profile_manufacturing
#: view:profile.manufacturing.config.install_modules_wizard:0
@@ -163,7 +191,7 @@ msgstr "Installeren"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,sale_crm:0
msgid "CRM and Calendars"
-msgstr ""
+msgstr "CRM en calenders"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,mrp_repair:0
@@ -173,7 +201,7 @@ msgstr "Reparatie"
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,sale_margin:0
msgid "Display margins on the sale order form."
-msgstr ""
+msgstr "Toont marges op het verkooporderformulier."
#. module: profile_manufacturing
#: help:profile.manufacturing.config.install_modules_wizard,point_of_sale:0
@@ -183,16 +211,20 @@ msgid ""
"a perfect ergonomy with touchscreen materials and payment processing "
"hardware."
msgstr ""
+"Deze module stelt u in staat om een kassa systeem (POS) te beheren. Het bied "
+"een basis formulier voor kassa operaties. Selecteert u ook onze "
+"gebruikersinterface kassa systeem voor een uitstekende ergonomy met "
+"touchscreen schermen en betaalautomaten hardware."
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,mrp_subproduct:0
msgid "Mrp Sub Product"
-msgstr ""
+msgstr "Mrp sub-product"
#. module: profile_manufacturing
#: view:profile.manufacturing.config.install_modules_wizard:0
msgid "Sales Management"
-msgstr ""
+msgstr "Verkoopbeheer"
#. module: profile_manufacturing
#: field:profile.manufacturing.config.install_modules_wizard,warning:0
@@ -213,6 +245,11 @@ msgid ""
"managing a manufacturing chain, a quality control location, product that you "
"rent, etc."
msgstr ""
+"Stelt u in staat om geavanceerde logistiek te beheren met diverse locaties "
+"en magazijnen. U kunt per product definiëren: standaard locaties voor "
+"verschillende operaties, etc. Deze module wordt vaak gebruikt voor "
+"lokalisatie van producten, beheren van en productieketen, kwaliteitscontrole "
+"lokaties, bij verhuur van producten, enz."
#. module: profile_manufacturing
#: view:profile.manufacturing.config.install_modules_wizard:0
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 86f10e46b97..196b70eceb1 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -30,7 +30,7 @@
-
+
@@ -49,7 +49,7 @@
-
@@ -110,18 +110,22 @@
-
+
-
+
-
+
+
+
+
+
@@ -152,7 +156,6 @@
form[]
- {"search_default_open":1,"search_default_member":1}
@@ -403,25 +406,25 @@
-
+
-
+
-
+
-
-
+
+
@@ -440,8 +443,8 @@
tree,form,calendar,gantt,graph
- {"search_default_current":1,"search_default_my_task":1}
+
@@ -535,25 +538,25 @@
- res.users.project.form1
- res.users
- form
-
-
-
-
-
-
-
+ res.users.project.form1
+ res.users
+ form
+
+
+
+
+
+
+
- view.users.form.project.modif.inherited1
- res.users
-
- form
-
-
+ view.users.form.project.modif.inherited1
+ res.users
+
+ form
+
+
@@ -603,12 +606,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/addons/project/report/__init__.py b/addons/project/report/__init__.py
index 3c104dc54ec..295b8c9674d 100644
--- a/addons/project/report/__init__.py
+++ b/addons/project/report/__init__.py
@@ -19,5 +19,6 @@
#
##############################################################################
import project_report
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/report/project_report.py b/addons/project/report/project_report.py
index 5c28d106c22..e4cd21f0b48 100644
--- a/addons/project/report/project_report.py
+++ b/addons/project/report/project_report.py
@@ -27,25 +27,42 @@ class report_project_task_user(osv.osv):
_description = "Tasks by user and project"
_auto = False
_columns = {
- 'name': fields.char('Year',size=64,required=False, readonly=True),
+ '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', 'User', readonly=True),
- 'date_start': fields.datetime('Starting Date'),
- 'date_end': fields.datetime('Ending Date'),
- 'date_deadline': fields.date('Deadline'),
+ 'date_start': fields.datetime('Starting Date',readonly=True),
+ 'no_of_days': fields.integer('#Days', size=128, readonly=True),
+ 'description': fields.text('Description',readonly=True),
+ 'date_end': fields.datetime('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),
- 'closing_days': fields.char('Avg Closing Delay', size=64, readonly=True),
+# 'closing_days': fields.char('Avg Closing Delay', size=64, readonly=True),
+ 'closing_days': fields.float('Avg Closing Delay', digits=(16,2), readonly=True, group_operator="avg",
+ help="Number of Days to close the task"),
+
'nbr': fields.integer('#Number 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'),
+ '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),
+ 'partner_id': fields.many2one('res.partner', 'Partner',readonly=True),
+ 'type': fields.many2one('project.task.type', 'Stage',readonly=True),
}
_order = 'name desc, project_id'
@@ -55,17 +72,24 @@ class report_project_task_user(osv.osv):
create or replace view report_project_task_user as (
select
min(t.id) as id,
- to_char(date_start, 'YYYY') as name,
+ to_char(date_start, 'YYYY') as year,
to_char(date_start, 'MM') as month,
+ to_char(date_start, 'YYYY-MM-DD') as day,
count(distinct t.id) as nbr,
date_trunc('day',t.date_start) as date_start,
date_trunc('day',t.date_end) as date_end,
- date_trunc('day',t.date_deadline) as date_deadline,
+ to_date(to_char(t.date_deadline, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_deadline,
+ sum(cast(to_char(date_trunc('day',t.date_end) - date_trunc('day',t.date_start),'DD') as int)) as no_of_days,
t.user_id,
t.project_id,
t.state,
+ t.priority,
+ t.name,
+ t.company_id,
+ t.partner_id,
+ t.type,
sum(planned_hours) as hours_planned,
- to_char(avg(date_end::abstime-t.create_date::timestamp), 'DD"d" HH24:MI:SS') as closing_days,
+ avg(extract('epoch' from (t.date_end-t.create_date)))/(3600*24) as closing_days,
sum(w.hours) as hours_effective,
((sum(planned_hours)-sum(w.hours))/count(distinct t.id))::decimal(16,2) as hours_delay
from project_task t
@@ -73,12 +97,119 @@ class report_project_task_user(osv.osv):
group by
to_char(date_start, 'YYYY'),
to_char(date_start, 'MM'),
- t.user_id,t.state,t.date_end,
- t.date_deadline,t.date_start,
- t.project_id
+ t.priority,
+ t.user_id,
+ t.state,
+ date_trunc('day',t.date_end),
+ to_date(to_char(t.date_deadline, 'dd-MM-YYYY'),'dd-MM-YYYY'),
+ date_trunc('day',t.date_start),
+ t.company_id,
+ t.partner_id,
+ t.type,
+ t.name,
+ t.project_id,
+ t.date_start
)
""")
report_project_task_user()
+#This class is generated for project deshboard purpose
+class project_vs_remaining_hours(osv.osv):
+ _name = "project.vs.remaining.hours"
+ _description = " Project vs Remaining hours"
+ _auto = False
+ _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)
+ }
+ _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 (
+ 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,
+ 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
+ UNION All
+ 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,
+ 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
+ )
+ """)
+project_vs_remaining_hours()
+
+class task_by_days(osv.osv):
+ _name = "task.by.days"
+ _description = "Task By Days"
+ _auto = False
+ _columns = {
+ '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')
+ }
+ _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
+ 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
+ project_task as pt
+ group by
+ to_char(pt.create_date, 'YYYY-MM-DD'),pt.state,pt.project_id
+ )
+ """)
+task_by_days()
+
+class task_by_days_vs_planned_hours(osv.osv):
+ _name = "task.by.days.vs.planned.hours"
+ _description = "Task By Days vs Planned Hours"
+ _auto = False
+ _columns = {
+ 'day': fields.char('Day', size=128, required=True),
+ 'planned_hour': fields.float('Planned Hours', readonly=True),
+ 'project_id':fields.many2one('project.project','Project')
+ }
+ _order = 'day desc'
+ def init(self, cr):
+ tools.sql.drop_view_if_exists(cr, 'task_by_days_vs_planned_hours')
+ cr.execute("""
+ create or replace view task_by_days_vs_planned_hours as (
+ select
+ min(pt.id) as id,
+ to_char(pt.create_date, 'YYYY-MM-DD') as day,
+ sum(planned_hours) as planned_hour,
+ pt.project_id
+ from
+ project_task as pt
+ group by
+ to_char(pt.create_date, 'YYYY-MM-DD'),pt.project_id
+ )
+ """)
+task_by_days_vs_planned_hours()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index 09a4374b156..9ee400e6472 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -9,51 +9,128 @@
tree
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.project.task.user.graph
+ report.project.task.user
+ graph
+
+
+
+
+
+
+
+
+
report.project.task.user.searchreport.project.task.usersearch
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
-
+
+
-
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -63,11 +140,117 @@
Tasksreport.project.task.userform
- tree
- {"search_default_my_task":1}
+ tree,graph
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+ project.vs.remaining.hour.tree
+ project.vs.remaining.hours
+ tree
+
+
+
+
+
+
+
+
+
+
+ project.vs.remaining.hour.graph
+ project.vs.remaining.hours
+ graph
+
+
+
+
+
+
+
+
+
+
+ Project and remaining hours
+ project.vs.remaining.hours
+ form
+ graph,tree
+ [('uid','=',uid)]
+
+
+
+
+ task.by.days.tree
+ task.by.days
+ tree
+
+
+
+
+
+
+
+
+
+
+ task.by.days.graph
+ task.by.days
+ graph
+
+
+
+
+
+
+
+
+
+
+
+ Task By Days
+ task.by.days
+ form
+ graph,tree
+ [('day','<=',time.strftime('%Y-%m-%d')),('day','>=', time.strftime('%Y-%m-%d', time.localtime(time.time()-(15*24*3600))))]
+
+
+
+
+
+ task.by.days.vs.planned.hours.tree
+ task.by.days.vs.planned.hours
+ tree
+
+
+
+
+
+
+
+
+
+ task.by.days.vs.planned.hours.graph
+ task.by.days.vs.planned.hours
+ graph
+
+
+
+
+
+
+
+
+
+
+ Task By Days vs Planned Hours
+ task.by.days.vs.planned.hours
+ form
+ graph,tree
+
+
diff --git a/addons/project/security/ir.model.access.csv b/addons/project/security/ir.model.access.csv
index abedc99cfd6..f31c6f0401f 100644
--- a/addons/project/security/ir.model.access.csv
+++ b/addons/project/security/ir.model.access.csv
@@ -14,3 +14,6 @@
"access_project_message","project.message","model_project_message","project.group_project_user",1,0,0,0
"access_project_installer","project.installer","model_project_installer","project.group_project_user",1,0,0,0
"access_report_project_task_user","report.project.task.user","model_report_project_task_user","project.group_project_manager",1,0,0,0
+"access_project_vs_remaining_hours","project.vs.remaining.hours","model_project_vs_remaining_hours","project.group_project_user",1,1,1,1
+"access_task_by_days_vs_planned_hours","task.by.days.vs.planned.hour","model_task_by_days_vs_planned_hours","project.group_project_user",1,1,1,1
+"access_task_by_days","task.by.days","model_task_by_days","project.group_project_user",1,1,1,1
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index 3f35913ae75..74e1b5045bf 100755
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -84,7 +84,7 @@ class project_issue(osv.osv):
resource_id = False
if issue.user_id:
resource_ids = res_obj.search(cr, uid, [('user_id','=',issue.user_id.id)])
- resource_id = len(resource_ids) or resource_ids[0]
+ resource_id = len(resource_ids) and resource_ids[0] or False
duration = float(ans.days)
if issue.section_id.resource_calendar_id:
diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py
index ef1e002ae78..775e4b933f0 100755
--- a/addons/project_issue/report/project_issue_report.py
+++ b/addons/project_issue/report/project_issue_report.py
@@ -7,15 +7,20 @@ class project_issue_report(osv.osv):
_auto = False
_inherit = "crm.case.report"
_columns = {
- 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue.report')]"),
- 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue.report')]"),
- 'nbr': fields.integer('# of Issues', reaadonly=True),
- 'delay_close': fields.char('Delay to close', size=20, readonly=True),
+ 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue')]"),
+ 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue')]"),
+ 'nbr': fields.integer('# of Issues', readonly=True),
+ 'delay_close': fields.float('Avg Closing Delay', digits=(16,2), readonly=True, group_operator="avg",
+ help="Number of Days to close the project issue"),
'company_id' : fields.many2one('res.company', 'Company'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
- 'project_id':fields.many2one('project.project', 'Project'),
- 'type_id': fields.many2one('crm.case.resource.type', 'Bug Type', domain="[('object_id.model', '=', 'project.issue')]"),
+ 'project_id':fields.many2one('project.project', 'Project',readonly=True),
+ 'type_id': fields.many2one('crm.case.resource.type', 'Type', domain="[('object_id.model', '=', 'project.issue')]"),
'date_closed': fields.datetime('Close Date', readonly=True),
+ 'assigned_to' : fields.many2one('res.users', 'Assigned to',readonly=True),
+ 'partner_id': fields.many2one('res.partner','Partner',domain="[('object_id.model', '=', 'project.issue')]"),
+ 'canal_id': fields.many2one('res.partner.canal', 'Channel',readonly=True),
+ 'task_id': fields.many2one('project.task', 'Task',domain="[('object_id.model', '=', 'project.issue')]" )
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'project_issue_report')
@@ -25,6 +30,7 @@ class project_issue_report(osv.osv):
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
+ to_char(c.create_date, 'YYYY-MM-DD') as day,
c.state,
c.user_id,
c.section_id,
@@ -35,18 +41,41 @@ class project_issue_report(osv.osv):
c.priority as priority,
c.project_id as project_id,
c.type_id as type_id,
- count(*) as nbr,
- to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
+ count(*) as nbr,
+ c.assigned_to,
+ c.partner_id,
+ c.canal_id,
+ c.task_id,
+ date_trunc('day',c.create_date) as create_date,
+ avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
project_issue c
left join
res_users u on (c.id = u.id)
- group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id,c.categ_id,c.stage_id
- ,c.date_closed,u.company_id,c.priority,c.project_id,c.type_id
+ group by
+ to_char(c.create_date, 'YYYY'),
+ to_char(c.create_date, 'MM'),
+ to_char(c.create_date, 'YYYY-MM-DD'),
+ c.state,
+ c.user_id,
+ c.section_id,
+ c.categ_id,
+ c.stage_id,
+ c.date_closed,
+ u.company_id,
+ c.priority,
+ c.project_id,
+ c.type_id,
+ date_trunc('day',c.create_date),
+ c.assigned_to,
+ c.partner_id,
+ c.canal_id,
+ c.task_id
)""")
project_issue_report()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index 72d665cdff0..24290530be7 100755
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -7,23 +7,28 @@
project.issue.reporttree
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
+
+
+
+
+
@@ -45,39 +50,34 @@
search
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -85,8 +85,15 @@
-
-
+
+
+
+
+
+
+
+
+
@@ -97,6 +104,7 @@
project.issue.reportformgraph,tree
+ {"search_default_This Month":1,"search_default_User":1,'group_by_no_leaf':1,'group_by':[]}
@@ -117,5 +125,7 @@
+
+
-
+
\ No newline at end of file
diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml
index 0be0f88a576..ae06ebb3b71 100644
--- a/addons/project_long_term/project_long_term_view.xml
+++ b/addons/project_long_term/project_long_term_view.xml
@@ -196,7 +196,7 @@
-
+
@@ -205,7 +205,7 @@
-
+
@@ -225,7 +225,6 @@
project.phaseformtree,form,calendar,gantt
- {"search_default_current":1,"search_default_my_phase":1}
diff --git a/addons/project_timesheet/report/task_report_view.xml b/addons/project_timesheet/report/task_report_view.xml
index 3b10af43026..e44e399b292 100644
--- a/addons/project_timesheet/report/task_report_view.xml
+++ b/addons/project_timesheet/report/task_report_view.xml
@@ -71,7 +71,7 @@
search
-
+
@@ -81,7 +81,7 @@
-
+
@@ -102,7 +102,7 @@
domain="[('priority','=','4')]"/>
-
+
@@ -124,7 +124,6 @@
formtree,graph[]
- {"search_default_my_task":1}
@@ -163,7 +162,7 @@
-
+
@@ -175,7 +174,6 @@
report.timesheet.task.userformtree
- {"search_default_by_user":1}
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 75f1a4d5e8d..c301116db2a 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -17,12 +17,12 @@
-
-
+ name="Incoming Products" parent="menu_procurement_management_inventory" sequence="10"/>
-
+
@@ -161,13 +161,13 @@
-
+
-
-
+
+
@@ -203,7 +203,7 @@
{'search_default_draft': 1}tree,form,graph,calendar
-
@@ -247,12 +247,12 @@
-
+
-
+
@@ -290,7 +290,7 @@
name="Product purchases"
res_model="purchase.order.line"
src_model="product.product"/>
-
-
- Purchase Order Lines
- ir.actions.act_window
- purchase.order.line
- tree,form
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
- Uninvoiced Purchase Order Lines
+ Lines To Invoicesir.actions.act_windowpurchase.order.line[('state','in',('confirmed','done')), ('invoiced','=',False)]
@@ -340,8 +321,8 @@
-
-
+
+
diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py
index f5c0a09b95d..76d018680d2 100644
--- a/addons/purchase/report/purchase_report.py
+++ b/addons/purchase/report/purchase_report.py
@@ -26,13 +26,14 @@
from osv import fields,osv
import tools
-class report_purchase_order(osv.osv):
- _name = "report.purchase.order"
+class purchase_report(osv.osv):
+ _name = "purchase.report"
_description = "Purchases Orders"
_auto = False
_columns = {
'date': fields.date('Date', readonly=True),
'name': fields.char('Year',size=64,required=False, readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True),
'state': fields.selection([
('draft','Quotation'),
('waiting_date','Waiting Schedule'),
@@ -43,54 +44,133 @@ class report_purchase_order(osv.osv):
('done','Done'),
('cancel','Cancel')
], 'Order State', readonly=True),
+ 'invoice_method': fields.selection([
+ ('manual','Manual'),
+ ('order','From Order'),
+ ('picking','From Picking')
+ ],'Invoicing Control', readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', readonly=True),
- 'category_id': fields.many2one('product.category', 'Categories', readonly=True),
- 'partner_id':fields.many2one('res.partner', 'Supplier', readonly=True),
+ 'location_id': fields.many2one('stock.location', 'Destination', readonly=True),
+ 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position',readonly=True),
+ 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
'quantity': fields.float('# of Products', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
'price_average': fields.float('Average Price', readonly=True),
- 'count': fields.integer('# of Lines', readonly=True),
+ 'nbr': fields.integer('# of Lines', 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),
}
_order = 'name desc,price_total desc'
def init(self, cr):
- tools.sql.drop_view_if_exists(cr, 'report_purchase_order')
+ tools.sql.drop_view_if_exists(cr, 'purchase_report')
cr.execute("""
- create or replace view report_purchase_order as (
+ create or replace view purchase_report as (
select
min(l.id) as id,
s.date_order as date,
to_char(s.date_order, 'YYYY') as name,
to_char(s.date_order, 'MM') as month,
+ to_char(s.date_order, 'YYYY-MM-DD') as day,
s.state,
s.warehouse_id as warehouse_id,
s.partner_id as partner_id,
+ s.fiscal_position,
s.create_uid as user_id,
s.company_id as company_id,
+ s.invoice_method,
l.product_id,
- t.categ_id as category_id,
+ s.location_id as location_id,
sum(l.product_qty*u.factor) as quantity,
- count(*),
+ count(*) as nbr,
sum(l.product_qty*l.price_unit) as price_total,
(sum(l.product_qty*l.price_unit)/sum(l.product_qty*u.factor))::decimal(16,2) as price_average
from purchase_order s
left join purchase_order_line l on (s.id=l.order_id)
- left join product_product p on (p.id=l.product_id)
- left join product_template t on (t.id=p.product_tmpl_id)
left join product_uom u on (u.id=l.product_uom)
where l.product_id is not null
- group by s.company_id,s.create_uid,s.partner_id,
- t.categ_id,l.product_id,s.date_order,
- to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state,
- s.warehouse_id
+ group by
+ s.company_id,
+ s.create_uid,
+ s.partner_id,
+ s.location_id,
+ l.product_id,
+ s.date_order,
+ to_char(s.date_order, 'YYYY'),
+ to_char(s.date_order, 'MM'),
+ to_char(s.date_order, 'YYYY-MM-DD'),
+ s.state,
+ s.warehouse_id,
+ s.fiscal_position,
+ s.invoice_method
)
""")
-report_purchase_order()
+purchase_report()
+class purchase_order_qty_amount(osv.osv):
+ _name = "purchase.order.qty.amount"
+ _description = "Quantity and amount per month"
+ _auto = False
+ _columns = {
+ '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),
+ 'total_qty' : fields.float('Total Qty'),
+ 'total_amount' : fields.float('Total Amount'),
+
+ }
+ def init(self, cr):
+ tools.sql.drop_view_if_exists(cr, 'purchase_order_qty_amount')
+ cr.execute("""
+ create or replace view purchase_order_qty_amount as (
+ select
+ min(id) as id,
+ to_char(create_date, 'MM') as month,
+ sum(product_qty) as total_qty,
+ sum(price_unit*product_qty) as total_amount
+ from
+ purchase_order_line
+ where
+ to_char(create_date,'YYYY') = to_char(current_date,'YYYY')
+ group by
+ to_char(create_date, 'MM')
+
+ )
+ """)
+purchase_order_qty_amount()
+
+class purchase_order_by_user(osv.osv):
+ _name = "purchase.order.by.user"
+ _description = "Purchase Order by user per month"
+ _auto = False
+ _columns = {
+ 'name' : fields.char('User',size=64,required=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),
+ 'nbr' : fields.integer('Total Orders'),
+
+ }
+ _order = 'name desc'
+ def init(self, cr):
+ tools.sql.drop_view_if_exists(cr, 'purchase_order_by_user')
+ cr.execute("""
+ create or replace view purchase_order_by_user as (
+ select
+ min(po.id) as id,
+ rs.name as name,
+ count(po.id) as nbr,
+ to_char(po.date_order, 'MM') as month
+ from
+ purchase_order as po,res_users as rs
+ where
+ po.create_uid = rs.id
+ group by
+ rs.name,po.date_order
+
+ )
+ """)
+purchase_order_by_user()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml
index 7946d99ba37..93918160bd1 100644
--- a/addons/purchase/report/purchase_report_view.xml
+++ b/addons/purchase/report/purchase_report_view.xml
@@ -3,7 +3,7 @@
product.month.graph
- report.purchase.order
+ purchase.reportgraph
@@ -15,73 +15,106 @@
- report.purchase.order.tree
- report.purchase.order
+ purchase.order.tree
+ purchase.reporttree
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+ report.purchase.order.search
- report.purchase.order
+ purchase.reportsearch
-
-
-
+
+
+
+
+ string="Quotations"
+ domain="[('state','=','draft')]"/>
+ string="Waiting Schedule"
+ domain="[('state','=','waiting_date')]"/>
+
+
-
+ string="My Purchaes"
+ help = "My Purchaes"
+ domain="[('user_id','=',uid)]" />
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
-
-
-
+
+
+
-
+
+
@@ -90,15 +123,80 @@
Purchase Orders
- report.purchase.order
+ purchase.reportformtree,graph
- {"search_default_this_year":1,"search_default_this_month":1,"search_default_purchase":1,"search_default_by_product":1}
+ {'search_default_month':1,'search_default_Responsible':1,'group_by_no_leaf':1,'group_by':[]}
+
+ purchase.order.qty.amount.graph
+ purchase.order.qty.amount
+ graph
+
+
+
+
+
+
+
+
+
+
+ purchase.order.qty.amount.tree
+ purchase.order.qty.amount
+ tree
+
+
+
+
+
+
+
+
+
+
+ Total Qty and Amount by month
+ purchase.order.qty.amount
+ form
+ graph,tree
+
+
+
+ purchase.order.by.user.graph
+ purchase.order.by.user
+ graph
+
+
+
+
+
+
+
+
+
+
+ purchase.order.by.user.tree
+ purchase.order.by.user
+ tree
+
+
+
+
+
+
+
+
+
+
+ Total Orders by User per month
+ purchase.order.by.user
+ form
+ graph,tree
+
diff --git a/addons/purchase/security/ir.model.access.csv b/addons/purchase/security/ir.model.access.csv
index e1eb2cdf199..7d7b78d0cdb 100644
--- a/addons/purchase/security/ir.model.access.csv
+++ b/addons/purchase/security/ir.model.access.csv
@@ -8,4 +8,4 @@
"access_purchase_order_stock_worker","purchase.order stock_worker","model_purchase_order","stock.group_stock_user",1,0,0,0
"access_purchase_order_line_stock_worker","purchase.order.line stock_worker","model_purchase_order_line","stock.group_stock_user",1,0,0,0
"access_account_tax_purchase_user","account.tax purchase_user","account.model_account_tax","purchase.group_purchase_user",1,0,0,0
-"access_report_purchase_order","report.purchase.order","model_report_purchase_order","purchase.group_purchase_manager",1,0,0,0
+"access_report_purchase_order","purchase.report","model_purchase_report","purchase.group_purchase_manager",1,0,0,0
diff --git a/addons/purchase/wizard/purchase_installer.xml b/addons/purchase/wizard/purchase_installer.xml
index efa8ec19887..77bbef10453 100644
--- a/addons/purchase/wizard/purchase_installer.xml
+++ b/addons/purchase/wizard/purchase_installer.xml
@@ -8,16 +8,21 @@
-
- Purchase Modules Installation
-
-
- This module allows you to manage your Purchase Requisition.
-
-
+
"""
result['arch'] = _moves_arch_lst
- result['fields'] = _moves_fields
+ result['fields'] = _moves_fields
return result
def default_get(self, cr, uid, fields, context=None):
- """
+ """
To get default values for the object.
-
+
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param fields: List of fields for which we want default values
- @param context: A standard dictionary
-
- @return: A dictionary which of fields with values.
-
- """
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
res = super(stock_partial_move, self).default_get(cr, uid, fields, context=context)
- move_obj = self.pool.get('stock.move')
+ move_obj = self.pool.get('stock.move')
if not context:
context={}
moveids = []
if 'date' in fields:
res.update({'date': time.strftime('%Y-%m-%d %H:%M:%S')})
- for m in move_obj.browse(cr, uid, context.get('active_ids', [])):
+ for m in move_obj.browse(cr, uid, context.get('active_ids', [])):
if m.state in ('done', 'cancel'):
continue
if 'move%s_product_id'%(m.id) in fields:
@@ -173,21 +178,23 @@ class stock_partial_move(osv.osv_memory):
currency = False
if hasattr(m.picking_id, 'purchase_id') and m.picking_id.purchase_id:
currency = m.picking_id.purchase_id.pricelist_id.currency_id.id
-
+
if 'move%s_product_price'%(m.id) in fields:
res['move%s_product_price'%(m.id)] = price
if 'move%s_product_currency'%(m.id) in fields:
res['move%s_product_currency'%(m.id)] = currency
- return res
+ return res
- def do_partial(self, cr, uid, ids, context):
- move_obj = self.pool.get('stock.move')
+ def do_partial(self, cr, uid, ids, context):
+ move_obj = self.pool.get('stock.move')
move_ids = context.get('active_ids', False)
partial = self.browse(cr, uid, ids[0], context)
partial_datas = {
- 'delivery_date' : partial.date
+ 'partner_id' : partial.partner_id and partial.partner_id.id or False,
+ 'address_id' : partial.address_id and partial.address_id.id or False,
+ 'delivery_date' : partial.date
}
- for m in move_obj.browse(cr, uid, move_ids):
+ for m in move_obj.browse(cr, uid, move_ids):
if m.state in ('done', 'cancel'):
continue
partial_datas['move%s'%(m.id)] = {
@@ -196,14 +203,15 @@ class stock_partial_move(osv.osv_memory):
'product_uom' : getattr(partial, 'move%s_product_uom'%(m.id)).id
}
- if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
- partial_datas['move%s'%(m.id)].update({
+ if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
+ partial_datas['move%s'%(m.id)].update({
'product_price' : getattr(partial, 'move%s_product_price'%(m.id)),
'product_currency': getattr(partial, 'move%s_product_currency'%(m.id)).id
- })
-
+ })
+
res = move_obj.do_partial(cr, uid, move_ids, partial_datas, context=context)
return {}
-
-stock_partial_move()
+
+stock_partial_move()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/wizard/stock_picking_make.py b/addons/stock/wizard/stock_picking_make.py
deleted file mode 100644
index 9d26595f00e..00000000000
--- a/addons/stock/wizard/stock_picking_make.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# -*- 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 .
-#
-##############################################################################
-
-from osv import fields, osv
-import netsvc
-
-class stock_picking_make(osv.osv_memory):
- _name = 'stock.picking.make'
- _description = "Make Picking"
-
- _columns = {
- 'picking_ids': fields.many2many('stock.picking', 'stock_picking_ids', 'parent_id', 'child_id', 'Pickings'),
- }
-
- def default_get(self, cursor, user, fields, context):
- """
- To get default values for the object.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for which we want default values
- @param context: A standard dictionary
- @return: A dictionary which of fields with values.
- """
- res = super(stock_picking_make, self).default_get(cursor, user, fields, context=context)
- record_ids = context and context.get('active_ids',False) or False
- if record_ids:
- picking_obj = self.pool.get('stock.picking')
- picking_ids = picking_obj.search(cursor, user, [
- ('id', 'in', record_ids),
- ('state', '<>', 'done'),
- ('state', '<>', 'cancel')], context=context)
- res['picking_ids'] = picking_ids
- return res
-
- def make_packing(self, cursor, user, ids, context):
- """
- Make Picking.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for which we want default values
- @param context: A standard dictionary
- @return: A dictionary which of fields with values.
- """
- record_ids = context and context.get('active_ids',False) or False
- wkf_service = netsvc.LocalService('workflow')
- picking_obj = self.pool.get('stock.picking')
- data = self.read(cursor, user, ids[0])
- pick_ids = data['picking_ids']
- picking_obj.force_assign(cursor, user, pick_ids)
- picking_obj.action_move(cursor, user, pick_ids)
- for picking_id in ids:
- wkf_service.trg_validate(user, 'stock.picking', picking_id,
- 'button_done', cursor)
- return {}
-
-stock_picking_make()
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/stock/wizard/stock_picking_make_view.xml b/addons/stock/wizard/stock_picking_make_view.xml
deleted file mode 100644
index fa77042c5d8..00000000000
--- a/addons/stock/wizard/stock_picking_make_view.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
- Make Picking
- stock.picking.make
- form
-
-
-
-
-
-
-
-
-
-
-
- Make Picking
- ir.actions.act_window
- stock.picking.make
- form
- form
- new
-
-
-
diff --git a/addons/stock/wizard/stock_return_picking.py b/addons/stock/wizard/stock_return_picking.py
deleted file mode 100644
index b0f15406ddb..00000000000
--- a/addons/stock/wizard/stock_return_picking.py
+++ /dev/null
@@ -1,221 +0,0 @@
-# -*- 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 netsvc
-import time
-
-from osv import osv,fields
-from tools.translate import _
-
-class stock_return_picking(osv.osv_memory):
- _name = 'stock.return.picking'
- _description = 'Return Picking'
-
- def default_get(self, cr, uid, fields, context):
- """
- To get default values for the object.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for which we want default values
- @param context: A standard dictionary
- @return: A dictionary which of fields with values.
- """
- res = super(stock_return_picking, self).default_get(cr, uid, fields, context=context)
- record_id = context and context.get('active_id', False) or False
- pick_obj = self.pool.get('stock.picking')
- pick = pick_obj.browse(cr, uid, record_id)
- for m in [line for line in pick.move_lines]:
- res['return%s'%(m.id)] = m.product_qty
- if pick.invoice_state=='invoiced':
- res['invoice_state'] = '2binvoiced'
- else:
- res['invoice_state'] = 'none'
- return res
-
- def view_init(self, cr, uid, fields_list, context=None):
- """
- Creates view dynamically and adding fields at runtime.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return: New arch of view with new columns.
- """
- res = super(stock_return_picking, self).view_init(cr, uid, fields_list, context=context)
- record_id = context and context.get('active_id', False) or False
- if record_id:
- pick_obj = self.pool.get('stock.picking')
- try:
- pick = pick_obj.browse(cr, uid, record_id)
- for m in [line for line in pick.move_lines]:
- if 'return%s'%(m.id) not in self._columns:
- self._columns['return%s'%(m.id)] = fields.float(string=m.name, required=True)
- if 'invoice_state' not in self._columns:
- self._columns['invoice_state'] = fields.selection([('2binvoiced', 'To be Invoiced'), ('none', 'None')], string='Invoice State', required=True)
- except Exception, e:
- return res
- return res
-
- def fields_view_get(self, cr, uid, view_id=None, view_type='form',
- context=None, toolbar=False, submenu=False):
- """
- Changes the view dynamically
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return: New arch of view.
- """
- res = super(stock_return_picking, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
- record_id = context and context.get('active_id', False) or False
- assert record_id,'Active ID not found'
- if record_id:
- pick_obj = self.pool.get('stock.picking')
- pick = pick_obj.browse(cr, uid, record_id)
-
- try:
- if pick.state != 'done':
- raise osv.except_osv(_('Warning !'), _("The Picking is not completed yet!\nYou cannot return picking which is not in 'Done' state!"))
-
- return_history = {}
- for m_line in pick.move_lines:
- return_history[m_line.id] = 0
- for rec in m_line.move_stock_return_history:
- return_history[m_line.id] += rec.product_qty
-
- res['fields'].clear()
- arch_lst=['', '
' % _('Return lines'), '' % _('Provide the quantities of the returned products.')]
- for m in [line for line in pick.move_lines]:
- quantity = m.product_qty
- if quantity > return_history[m.id] and (quantity - return_history[m.id])>0:
- arch_lst.append('\n' % (m.id,))
- res['fields']['return%s' % m.id]={'string':m.name, 'type':'float', 'required':True}
- res.setdefault('returns', []).append(m.id)
- if not res.get('returns',False):
- raise osv.except_osv(_('Warning!'),_('There is no product to return!'))
-
- arch_lst.append('\n')
- if pick.invoice_state=='invoiced':
- new_invoice_state='2binvoiced'
- else:
- new_invoice_state=pick.invoice_state
- res['fields']['invoice_state']={'string':_('Invoice state'), 'type':'selection','required':True, 'selection':[('2binvoiced', _('To Be Invoiced')), ('none', _('None'))]}
- arch_lst.append('')
- arch_lst.append('')
- arch_lst.append('')
- arch_lst.append('')
- arch_lst.append('
')
- res['arch'] = '\n'.join(arch_lst)
- except Exception,e:
- return res
- return res
-
- def _create_returns(self, cr, uid, ids, context):
- """
- Creates return picking.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: List of ids selected
- @param context: A standard dictionary
- @return: A dictionary which of fields with values.
- """
- record_id = context and context.get('active_id', False) or False
- move_obj = self.pool.get('stock.move')
- pick_obj = self.pool.get('stock.picking')
- uom_obj = self.pool.get('product.uom')
- wf_service = netsvc.LocalService("workflow")
-
- pick = pick_obj.browse(cr, uid, record_id)
- data = self.read(cr, uid, ids[0])
- new_picking = None
- date_cur = time.strftime('%Y-%m-%d %H:%M:%S')
-
- move_ids = [m.id for m in [line for line in pick.move_lines]]
- set_invoice_state_to_none = True
- for move in move_obj.browse(cr, uid, move_ids):
- if not new_picking:
- if pick.type=='out':
- new_type = 'in'
- elif pick.type=='in':
- new_type = 'out'
- else:
- new_type = 'internal'
- new_picking = pick_obj.copy(cr, uid, pick.id, {'name':'%s (return)' % pick.name,
- 'move_lines':[], 'state':'draft', 'type':new_type,
- 'date':date_cur, 'invoice_state':data['invoice_state'],})
- new_location=move.location_dest_id.id
-
- new_qty = data['return%s' % move.id]
- returned_qty = move.product_qty
-
- for rec in move.move_stock_return_history:
- returned_qty -= rec.product_qty
-
- if returned_qty != new_qty:
- set_invoice_state_to_none = False
-
- new_move=move_obj.copy(cr, uid, move.id, {
- 'product_qty': new_qty,
- 'product_uos_qty': uom_obj._compute_qty(cr, uid, move.product_uom.id,
- new_qty, move.product_uos.id),
- 'picking_id':new_picking, 'state':'draft',
- 'location_id':new_location, 'location_dest_id':move.location_id.id,
- 'date':date_cur, 'date_planned':date_cur,})
- move_obj.write(cr, uid, [move.id], {'move_stock_return_history':[(4,new_move)]})
-
- if set_invoice_state_to_none:
- pick_obj.write(cr, uid, [pick.id], {'invoice_state':'none'})
-
- if new_picking:
- if new_picking:
- wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
- pick_obj.force_assign(cr, uid, [new_picking], context)
- return new_picking
-
- def action_open_window(self, cr, uid, ids, context):
- """
- Opens return picking list.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: List of ids selected
- @param context: A standard dictionary
- @return: A dictionary which of fields with values.
- """
- res = self._create_returns(cr, uid, ids, context)
- if not res:
- return {}
- return {
- 'domain': "[('id', 'in', ["+str(res)+"])]",
- 'name': 'Picking List',
- 'view_type':'form',
- 'view_mode':'tree,form',
- 'res_model':'stock.picking',
- 'view_id':False,
- 'type':'ir.actions.act_window',
- }
-
-stock_return_picking()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/stock/wizard/stock_return_picking_view.xml b/addons/stock/wizard/stock_return_picking_view.xml
deleted file mode 100644
index 005c3a05b07..00000000000
--- a/addons/stock/wizard/stock_return_picking_view.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
- Return Picking
- ir.actions.act_window
- stock.return.picking
- form
- form
- new
-
-
-
-
diff --git a/addons/stock/wizard/stock_split_move.py b/addons/stock/wizard/stock_split_move.py
new file mode 100644
index 00000000000..0092656f83d
--- /dev/null
+++ b/addons/stock/wizard/stock_split_move.py
@@ -0,0 +1,125 @@
+# -*- 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 .
+#
+##############################################################################
+
+from osv import osv, fields
+
+class stock_split_move_line(osv.osv_memory):
+ _name = 'stock.move.line.split'
+ _description = "Split Moves"
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+ @return: A dictionary which of fields with values.
+ """
+ res = super(stock_split_move_line, self).default_get(cr, uid, fields, context=context)
+ record_id = context and context.get('active_id', False) or False
+ pick_obj = self.pool.get('stock.picking')
+ pick = pick_obj.browse(cr, uid, record_id)
+ for m in [line for line in pick.move_lines]:
+ res['move%s'%(m.id)] = m.product_qty
+ return res
+
+ def view_init(self, cr, uid, fields_list, context=None):
+ """
+ Creates view dynamically and adding fields at runtime.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return: New arch of view with new columns.
+ """
+ res = super(stock_split_move_line, self).view_init(cr, uid, fields_list, context=context)
+ record_id = context and context.get('active_id', False) or False
+ if record_id:
+ pick_obj = self.pool.get('stock.picking')
+ try:
+ pick = pick_obj.browse(cr, uid, record_id)
+ for m in [line for line in pick.move_lines]:
+ if 'move%s' % m.id not in self._columns:
+ self._columns['move%s' % m.id] = fields.float(string=m.product_id.name)
+ except:
+ return res
+ return res
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form',
+ context=None, toolbar=False, submenu=False):
+ """
+ Changes the view dynamically
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return: New arch of view.
+ """
+ res = super(stock_split_move_line, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
+ record_id = context and context.get('active_id', False) or False
+ assert record_id,'Active ID not found'
+ pick_obj = self.pool.get('stock.picking')
+ pick = pick_obj.browse(cr, uid, record_id)
+ arch_lst = ['', '
', '']
+ for m in [line for line in pick.move_lines]:
+ quantity = m.product_qty
+ arch_lst.append('\n' % (m.id,))
+ res['fields']['move%s' % m.id] = {'string' : m.product_id.name, 'type' : 'float', 'required' : True}
+ arch_lst.append('')
+ arch_lst.append('')
+ arch_lst.append('')
+ arch_lst.append('')
+ arch_lst.append('
')
+ res['arch'] = '\n'.join(arch_lst)
+ return res
+
+ def split_lines(self, cr, uid, ids, context):
+ """
+ Splits moves in quantity given in the wizard.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of ids selected
+ @param context: A standard dictionary
+ @return: A dictionary which of fields with values.
+ """
+ move_obj = self.pool.get('stock.move')
+ record_id = context and context.get('active_id', False) or False
+ pick_obj = self.pool.get('stock.picking')
+ pick = pick_obj.browse(cr, uid, record_id)
+ data = self.read(cr, uid, ids[0])
+ move_ids = [m.id for m in [line for line in pick.move_lines]]
+ for move in move_obj.browse(cr, uid, move_ids):
+ quantity = data['move%s' % move.id]
+ if 0 < quantity < move.product_qty:
+ new_qty = move.product_qty - quantity
+ new_uos_qty = new_qty / move.product_qty * move.product_uos_qty
+ new_obj = move_obj.copy(cr, uid, move.id, {'product_qty' : new_qty, 'product_uos_qty': new_uos_qty, 'state':move.state})
+ uos_qty = quantity / move.product_qty * move.product_uos_qty
+ move_obj.write(cr, uid, [move.id], {'product_qty' : quantity, 'product_uos_qty': uos_qty})
+ return {}
+
+stock_split_move_line()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/stock/wizard/stock_split_move_view.xml b/addons/stock/wizard/stock_split_move_view.xml
index 30816750035..de89f83cb32 100644
--- a/addons/stock/wizard/stock_split_move_view.xml
+++ b/addons/stock/wizard/stock_split_move_view.xml
@@ -1,6 +1,17 @@
-
-
-
+
+
+
+
+ Split Moves
+ ir.actions.act_window
+ stock.move.line.split
+ form
+ form
+ new
+
+
+
+
diff --git a/addons/stock_invoice_directly/i18n/ru.po b/addons/stock_invoice_directly/i18n/ru.po
index b0015c39163..6e9c05f8114 100644
--- a/addons/stock_invoice_directly/i18n/ru.po
+++ b/addons/stock_invoice_directly/i18n/ru.po
@@ -7,16 +7,16 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-04-10 14:08+0000\n"
-"Last-Translator: <>\n"
+"PO-Revision-Date: 2010-04-25 14:27+0000\n"
+"Last-Translator: Andrey Kulakov \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:20+0000\n"
+"X-Launchpad-Export-Date: 2010-04-26 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: stock_invoice_directly
#: model:ir.module.module,shortdesc:stock_invoice_directly.module_meta_information
msgid "Invoice Picking Directly"
-msgstr ""
+msgstr "Напрямую выставляемый счет"
diff --git a/addons/survey/i18n/zh_CN.po b/addons/survey/i18n/zh_CN.po
deleted file mode 100644
index 11deb3583d9..00000000000
--- a/addons/survey/i18n/zh_CN.po
+++ /dev/null
@@ -1,695 +0,0 @@
-# Chinese (Simplified) translation for openobject-addons
-# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
-# This file is distributed under the same license as the openobject-addons package.
-# FIRST AUTHOR , 2010.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: openobject-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-11-26 06:01+0000\n"
-"PO-Revision-Date: 2010-04-08 01:37+0000\n"
-"Last-Translator: Silence \n"
-"Language-Team: Chinese (Simplified) \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
-"X-Generator: Launchpad (build Unknown)\n"
-
-#. module: survey
-#: model:ir.ui.menu,name:survey.menu_survey_form
-msgid "Surveys"
-msgstr "调查"
-
-#. module: survey
-#: model:ir.actions.report.xml,name:survey.survey
-msgid "Survey Analysis Report"
-msgstr "调查分析报告"
-
-#. module: survey
-#: model:ir.actions.act_window,name:survey.act_survey_page_question
-#: model:ir.ui.menu,name:survey.menu_survey_question_form1
-msgid "Survey Questions"
-msgstr "调查问题"
-
-#. module: survey
-#: view:survey:0
-#: view:survey.response:0
-msgid "Set to draft"
-msgstr "设为草稿"
-
-#. module: survey
-#: constraint:ir.actions.act_window:0
-msgid "Invalid model name in the action definition."
-msgstr "在动作定义使用了无效的模型名称。"
-
-#. module: survey
-#: field:survey.history,date:0
-msgid "Date started"
-msgstr "开始日期"
-
-#. module: survey
-#: field:survey,history:0
-msgid "History Lines"
-msgstr "日志明细"
-
-#. module: survey
-#: wizard_field:wizard.send.invitation,init,mail:0
-msgid "Body"
-msgstr "内容"
-
-#. module: survey
-#: model:ir.actions.act_window,name:survey.action_view_survey_name
-#: model:ir.ui.menu,name:survey.menu_run_survey_form
-msgid "Give Survey Response"
-msgstr "调查回答"
-
-#. module: survey
-#: model:ir.actions.act_window,name:survey.act_survey_question
-msgid "All Questions"
-msgstr "所有问题"
-
-#. module: survey
-#: field:survey,date_open:0
-msgid "Survey Open Date"
-msgstr "调查开展日期"
-
-#. module: survey
-#: model:ir.model,name:survey.model_survey_name_wiz
-msgid "survey.name.wiz"
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-msgid "Users Details"
-msgstr "用户详细信息"
-
-#. module: survey
-#: model:ir.actions.act_window,name:survey.action_view_survey_question_message
-#: model:ir.model,name:survey.model_survey_question
-#: view:survey:0
-#: view:survey.page:0
-#: view:survey.question:0
-msgid "Survey Question"
-msgstr "调查问题"
-
-#. module: survey
-#: help:survey,response_user:0
-msgid "Set to one if you require only one response per user"
-msgstr "如果你只需要每个用户回答,设为1"
-
-#. module: survey
-#: field:survey.page,title:0
-msgid "Page Title"
-msgstr "页面标题"
-
-#. module: survey
-#: model:ir.model,name:survey.model_survey_history
-msgid "Survey History"
-msgstr "调查历史"
-
-#. module: survey
-#: field:survey.response,comment:0
-#: field:survey.response.answer,comment:0
-msgid "Notes"
-msgstr "备注"
-
-#. module: survey
-#: field:survey.question,tot_resp:0
-msgid "Total Response"
-msgstr "回答合计"
-
-#. module: survey
-#: view:survey.question.wiz:0
-msgid "Your Messages"
-msgstr "你的消息"
-
-#. module: survey
-#: selection:survey,state:0
-msgid "Cancelled"
-msgstr "已取消"
-
-#. module: survey
-#: field:survey.question,allow_comment:0
-msgid "Allow Comment Field"
-msgstr "允许注释字段"
-
-#. module: survey
-#: code:addons/survey/survey.py:0
-#, python-format
-msgid "Warning !"
-msgstr "警告!"
-
-#. module: survey
-#: wizard_view:wizard.send.invitation,init:0
-#: wizard_field:wizard.send.invitation,init,send_mail_existing:0
-msgid "Send reminder for existing user"
-msgstr "为现有用户发送提醒"
-
-#. module: survey
-#: model:ir.actions.act_window,name:survey.action_new_survey_question_form
-#: model:ir.ui.menu,name:survey.menu_new_survey_question_form1
-msgid "New Survey Question"
-msgstr "新的调查问题"
-
-#. module: survey
-#: view:survey.response:0
-msgid "Skip"
-msgstr "跳过"
-
-#. module: survey
-#: wizard_field:wizard.send.invitation,init,partner_ids:0
-msgid "Partner"
-msgstr "伙伴"
-
-#. module: survey
-#: wizard_field:wizard.send.invitation,init,mail_subject:0
-#: wizard_field:wizard.send.invitation,init,mail_subject_existing:0
-msgid "Subject"
-msgstr "主题"
-
-#. module: survey
-#: field:survey,max_response_limit:0
-msgid "Maximum Response Limit"
-msgstr ""
-
-#. module: survey
-#: wizard_field:wizard.send.invitation,init,mail_from:0
-msgid "From"
-msgstr "发件人"
-
-#. module: survey
-#: field:survey.response,response_type:0
-msgid "Response Type"
-msgstr ""
-
-#. module: survey
-#: field:survey.name.wiz,transfer:0
-msgid "Page Transfer"
-msgstr ""
-
-#. module: survey
-#: field:survey.answer,question_id:0
-#: field:survey.page,question_ids:0
-#: field:survey.question,question:0
-#: field:survey.response,question_id:0
-msgid "Question"
-msgstr ""
-
-#. module: survey
-#: wizard_button:wizard.send.invitation,init,send:0
-msgid "Send"
-msgstr ""
-
-#. module: survey
-#: field:survey.answer,response:0
-msgid "#Response"
-msgstr ""
-
-#. module: survey
-#: field:survey.response,response_answer_ids:0
-msgid "Response Answer"
-msgstr ""
-
-#. module: survey
-#: rml:survey_analysis_report:0
-msgid "Response Summary"
-msgstr ""
-
-#. module: survey
-#: wizard_view:wizard.send.invitation,init:0
-#: wizard_field:wizard.send.invitation,init,send_mail:0
-msgid "Send mail for new user"
-msgstr ""
-
-#. module: survey
-#: code:addons/survey/survey.py:0
-#, python-format
-msgid "Error !"
-msgstr ""
-
-#. module: survey
-#: rml:survey_analysis_report:0
-msgid "Skipped Question"
-msgstr ""
-
-#. module: survey
-#: wizard_button:wizard.send.invitation,send,end:0
-msgid "_Ok"
-msgstr ""
-
-#. module: survey
-#: selection:survey.response,response_type:0
-msgid "Link"
-msgstr ""
-
-#. module: survey
-#: model:ir.ui.menu,name:survey.menu_survey_config
-msgid "Configuration"
-msgstr ""
-
-#. module: survey
-#: model:ir.model,name:survey.model_survey_question_wiz
-msgid "survey.question.wiz"
-msgstr ""
-
-#. module: survey
-#: constraint:ir.ui.view:0
-msgid "Invalid XML for View Architecture!"
-msgstr ""
-
-#. module: survey
-#: model:ir.model,name:survey.model_survey_response_answer
-#: view:survey.response.answer:0
-msgid "Survey Response Answer"
-msgstr ""
-
-#. module: survey
-#: rml:survey_analysis_report:0
-msgid "Page :-"
-msgstr ""
-
-#. module: survey
-#: field:survey,response_user:0
-msgid "Maximum Response per User"
-msgstr ""
-
-#. module: survey
-#: rml:survey_analysis_report:0
-msgid "Total Started Survey :-"
-msgstr ""
-
-#. module: survey
-#: view:survey.response:0
-msgid "Comment"
-msgstr ""
-
-#. module: survey
-#: field:survey.response,date_modify:0
-msgid "Modify Date"
-msgstr ""
-
-#. module: survey
-#: rml:survey_analysis_report:0
-msgid "Answered Question"
-msgstr ""
-
-#. module: survey
-#: code:addons/survey/survey.py:0
-#, python-format
-msgid "You can not give response for this survey more than %s times"
-msgstr ""
-
-#. module: survey
-#: selection:survey.response,response_type:0
-msgid "Manually"
-msgstr ""
-
-#. module: survey
-#: model:ir.actions.act_window,name:survey.action_survey_form1
-msgid "All Surveys"
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-#: field:survey,users:0
-msgid "Users"
-msgstr ""
-
-#. module: survey
-#: wizard_view:wizard.send.invitation,init:0
-msgid "Message"
-msgstr ""
-
-#. module: survey
-#: field:survey.name.wiz,page_no:0
-msgid "Page Number"
-msgstr ""
-
-#. module: survey
-#: wizard_field:wizard.send.invitation,send,note:0
-msgid "Log"
-msgstr ""
-
-#. module: survey
-#: model:ir.actions.act_window,name:survey.action_survey_question_form
-msgid "All Survey Questions"
-msgstr ""
-
-#. module: survey
-#: field:survey,date_close:0
-msgid "Survey Close Date"
-msgstr ""
-
-#. module: survey
-#: view:survey.name.wiz:0
-msgid "Start"
-msgstr ""
-
-#. module: survey
-#: selection:survey,state:0
-#: selection:survey.response,state:0
-msgid "Draft"
-msgstr ""
-
-#. module: survey
-#: selection:survey,state:0
-msgid "Closed"
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-#: field:survey.answer,answer:0
-#: view:survey.page:0
-#: view:survey.question:0
-#: field:survey.question,answer_choice_ids:0
-#: field:survey.response.answer,answer_id:0
-msgid "Answer"
-msgstr ""
-
-#. module: survey
-#: model:ir.actions.act_window,name:survey.action_survey_page_form
-msgid "All Survey Pages"
-msgstr ""
-
-#. module: survey
-#: field:survey.name.wiz,store_ans:0
-msgid "Store Answer"
-msgstr ""
-
-#. module: survey
-#: field:survey,state:0
-#: field:survey.response,state:0
-msgid "Status"
-msgstr ""
-
-#. module: survey
-#: model:ir.module.module,shortdesc:survey.module_meta_information
-msgid "Survey Module"
-msgstr ""
-
-#. module: survey
-#: model:ir.module.module,description:survey.module_meta_information
-msgid ""
-"\n"
-" This module is used for surveing. It depends on the answers or reviews "
-"of some questions by different users.\n"
-" A survey may have multiple pages. Each page may contain multiple "
-"questions and each question may have multiple answers.\n"
-" Different users may give different answers of question and according to "
-"that survey is done. \n"
-" Partners are also sent mails with user name and password for the "
-"invitation of the survey\n"
-" "
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-#: view:survey.name.wiz:0
-msgid "Survey Details"
-msgstr ""
-
-#. module: survey
-#: field:survey.question,is_require_answer:0
-msgid "Required Answer"
-msgstr ""
-
-#. module: survey
-#: field:survey.history,user_id:0
-#: field:survey.response,response_id:0
-msgid "User"
-msgstr ""
-
-#. module: survey
-#: field:res.users,survey_id:0
-msgid "Groups"
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-#: view:survey.page:0
-#: view:survey.question:0
-#: field:survey.question,response_ids:0
-#: view:survey.response:0
-#: field:survey.response.answer,response_id:0
-msgid "Response"
-msgstr ""
-
-#. module: survey
-#: model:ir.actions.act_window,name:survey.action_new_survey_form1
-#: model:ir.ui.menu,name:survey.menu_new_survey_form
-msgid "New Survey"
-msgstr ""
-
-#. module: survey
-#: model:ir.ui.menu,name:survey.main_menu_survey
-msgid "Survey Management"
-msgstr ""
-
-#. module: survey
-#: selection:survey.response,state:0
-msgid "Skiped"
-msgstr ""
-
-#. module: survey
-#: model:ir.model,name:survey.model_survey_answer
-#: view:survey.answer:0
-msgid "Survey Answer"
-msgstr ""
-
-#. module: survey
-#: code:addons/survey/wizard/wizard_survey.py:0
-#, python-format
-msgid "Attention!"
-msgstr ""
-
-#. module: survey
-#: model:ir.model,name:survey.model_survey
-#: view:res.users:0
-#: view:survey:0
-#: field:survey.history,survey_id:0
-#: view:survey.name.wiz:0
-#: field:survey.name.wiz,survey_id:0
-#: field:survey.page,survey_id:0
-#: field:survey.question,survey:0
-msgid "Survey"
-msgstr ""
-
-#. module: survey
-#: rml:survey_analysis_report:0
-msgid "Total Completed Survey :-"
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-msgid "History"
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-#: view:survey.answer:0
-#: view:survey.page:0
-#: view:survey.question:0
-msgid "Seq"
-msgstr ""
-
-#. module: survey
-#: field:survey,tot_comp_survey:0
-msgid "Total Completed Survey"
-msgstr ""
-
-#. module: survey
-#: rml:survey_analysis_report:0
-msgid "Response Percentage"
-msgstr ""
-
-#. module: survey
-#: field:survey.question.wiz,name:0
-msgid "Number"
-msgstr ""
-
-#. module: survey
-#: rml:survey_analysis_report:0
-msgid "Survey Title :-"
-msgstr ""
-
-#. module: survey
-#: view:survey.response:0
-msgid "Done"
-msgstr ""
-
-#. module: survey
-#: code:addons/survey/survey.py:0
-#, python-format
-msgid "'\" + que_rec[0]['question'] + \"' This question requires an answer."
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-#: view:survey.name.wiz:0
-#: wizard_button:wizard.send.invitation,init,end:0
-msgid "Cancel"
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-msgid "Close"
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-#: selection:survey,state:0
-msgid "Open"
-msgstr ""
-
-#. module: survey
-#: field:survey,tot_start_survey:0
-msgid "Total Started Survey"
-msgstr ""
-
-#. module: survey
-#: constraint:ir.model:0
-msgid ""
-"The Object name must start with x_ and not contain any special character !"
-msgstr ""
-
-#. module: survey
-#: model:ir.model,name:survey.model_survey_response
-#: view:survey.response:0
-msgid "Survey Response"
-msgstr ""
-
-#. module: survey
-#: field:survey.answer,average:0
-msgid "#Avg"
-msgstr ""
-
-#. module: survey
-#: field:survey,responsible_id:0
-msgid "Responsible"
-msgstr ""
-
-#. module: survey
-#: selection:survey.response,state:0
-msgid "Answered"
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-msgid "Other"
-msgstr ""
-
-#. module: survey
-#: model:ir.actions.wizard,name:survey.wizard_send_invitation
-#: wizard_view:wizard.send.invitation,init:0
-msgid "Send Invitation"
-msgstr ""
-
-#. module: survey
-#: field:survey,title:0
-msgid "Survey Title"
-msgstr ""
-
-#. module: survey
-#: rml:survey_analysis_report:0
-msgid "%"
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-#: field:survey,note:0
-#: field:survey.name.wiz,note:0
-#: view:survey.page:0
-#: field:survey.page,note:0
-#: view:survey.response:0
-msgid "Description"
-msgstr ""
-
-#. module: survey
-#: view:survey.name.wiz:0
-msgid "Select Survey"
-msgstr ""
-
-#. module: survey
-#: model:ir.actions.act_window,name:survey.action_new_survey_page_form
-#: model:ir.ui.menu,name:survey.menu_new_survey_page_form1
-msgid "New Survey Page"
-msgstr ""
-
-#. module: survey
-#: view:survey:0
-#: view:survey.page:0
-#: field:survey.question,page_id:0
-msgid "Survey Page"
-msgstr ""
-
-#. module: survey
-#: model:ir.actions.act_window,name:survey.act_survey_answer
-msgid "Survey Answers"
-msgstr ""
-
-#. module: survey
-#: view:survey.page:0
-msgid "#Questions"
-msgstr ""
-
-#. module: survey
-#: rml:survey_analysis_report:0
-msgid "Que:"
-msgstr ""
-
-#. module: survey
-#: field:survey,page_ids:0
-msgid "Page"
-msgstr ""
-
-#. module: survey
-#: wizard_view:wizard.send.invitation,send:0
-msgid "User creation"
-msgstr ""
-
-#. module: survey
-#: field:survey.answer,sequence:0
-#: field:survey.page,sequence:0
-#: field:survey.question,sequence:0
-msgid "Sequence"
-msgstr ""
-
-#. module: survey
-#: wizard_view:wizard.send.invitation,send:0
-msgid "Results :"
-msgstr ""
-
-#. module: survey
-#: code:addons/survey/wizard/wizard_survey.py:0
-#, python-format
-msgid "%sSurvey is not in open state"
-msgstr ""
-
-#. module: survey
-#: wizard_view:wizard.send.invitation,init:0
-msgid "Select Partner"
-msgstr ""
-
-#. module: survey
-#: field:survey.response,date_create:0
-msgid "Create Date"
-msgstr ""
-
-#. module: survey
-#: model:ir.actions.act_window,name:survey.act_survey_pages
-#: model:ir.model,name:survey.model_survey_page
-#: model:ir.ui.menu,name:survey.menu_survey_page_form1
-msgid "Survey Pages"
-msgstr ""
-
-#. module: survey
-#: rml:survey_analysis_report:0
-msgid "Response Count"
-msgstr ""
-
-#. module: survey
-#: field:survey.name.wiz,page:0
-msgid "Page Position"
-msgstr ""
diff --git a/addons/survey/survey.py b/addons/survey/survey.py
index 968590a5d07..c7ceb796bae 100644
--- a/addons/survey/survey.py
+++ b/addons/survey/survey.py
@@ -128,7 +128,7 @@ class survey(osv.osv):
'context' : context
}
else:
-
+
datas['form'] = page_setting
datas['model'] = 'survey.print'
report = {
@@ -139,7 +139,6 @@ class survey(osv.osv):
'context' : context
}
return report
-
survey()
class survey_history(osv.osv):
diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml
index 4f9eff96b84..8a574edc169 100644
--- a/addons/survey/survey_view.xml
+++ b/addons/survey/survey_view.xml
@@ -260,7 +260,7 @@
-
+
@@ -1070,7 +1070,7 @@
-
+
diff --git a/addons/thunderbird/__openerp__.py b/addons/thunderbird/__openerp__.py
index 1b7c752d1b1..2cb470bf886 100644
--- a/addons/thunderbird/__openerp__.py
+++ b/addons/thunderbird/__openerp__.py
@@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved
-# $Id$
+# Copyright (c) 2004 Axelor SPRL. (http://www.axelor.com) All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,54 +19,27 @@
# along with this program. If not, see .
#
##############################################################################
-##############################################################################
-#
-# Copyright (c) 2004 Axelor SPRL. (http://www.axelor.com) All Rights Reserved.
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
{
- "name" : "Thunderbird Interface",
- "version" : "1.0",
- "author" : "Axelor",
- "website" : "http://www.axelor.com/",
- "depends" : ["base","crm"],
- "category" : "Generic Modules/Thunderbird interface",
- "description": '''
- This module is required for the thuderbird plug-in to work
- properly.
+ "name" : "Thunderbird Interface",
+ "version" : "1.0",
+ "author" : "Axelor",
+ "website" : "http://www.axelor.com/",
+ "depends" : ["base","crm"],
+ "category" : "Generic Modules/Thunderbird interface",
+ "description": '''
+ This module is required for the thuderbird plug-in to work
+ properly.
- This allows you to select an object that you’d like to add
- to your email and its attachments. You can select a partner, a task,
- a project, an analytical account, or any other object and attach selected
- mail as .eml file in attachment of selected record.
+ This allows you to select an object that you’d like to add
+ to your email and its attachments. You can select a partner, a task,
+ a project, an analytical account, or any other object and attach selected
+ mail as .eml file in attachment of selected record.
- You can create new case in crm using Create Case button.
- Select a section for which you want to create case.''',
- "init_xml" : [],
- "demo_xml" : [],
- "update_xml" : ['security/ir.model.access.csv'],
- "active": False,
- "installable": True
+ You can create new case in crm using Create Case button.
+ Select a section for which you want to create case.''',
+ "init_xml" : [],
+ "demo_xml" : [],
+ "update_xml" : ['security/ir.model.access.csv'],
+ "active": False,
+ "installable": True
}
diff --git a/addons/thunderbird/i18n/zh_CN.po b/addons/thunderbird/i18n/zh_CN.po
deleted file mode 100644
index f25ba3b39f7..00000000000
--- a/addons/thunderbird/i18n/zh_CN.po
+++ /dev/null
@@ -1,85 +0,0 @@
-# Chinese (Simplified) translation for openobject-addons
-# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
-# This file is distributed under the same license as the openobject-addons package.
-# FIRST AUTHOR , 2010.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: openobject-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-11-26 06:05+0000\n"
-"PO-Revision-Date: 2010-04-08 00:41+0000\n"
-"Last-Translator: Silence \n"
-"Language-Team: Chinese (Simplified) \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
-"X-Generator: Launchpad (build Unknown)\n"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,copy_to:0
-msgid "Copy To"
-msgstr "复制到"
-
-#. module: thunderbird
-#: constraint:ir.model:0
-msgid ""
-"The Object name must start with x_ and not contain any special character !"
-msgstr "对象名必须是以x_开头并且不能含有特殊字符"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,description:0
-msgid "Description"
-msgstr "描述"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,reference:0
-msgid "Reference"
-msgstr "参考"
-
-#. module: thunderbird
-#: model:ir.model,name:thunderbird.model_tinythunderbird_partner
-msgid "Thunderbid mails"
-msgstr ""
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,attachments:0
-msgid "Attached Files"
-msgstr "添加附件"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,res_user_id:0
-msgid "User"
-msgstr "用户"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,receiver:0
-msgid "Receiver"
-msgstr "收件人"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,date:0
-msgid "Date"
-msgstr "日期"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,title:0
-msgid "Subject"
-msgstr "主题"
-
-#. module: thunderbird
-#: code:addons/thunderbird/partner/partner.py:0
-#, python-format
-msgid "Archive"
-msgstr "存档"
-
-#. module: thunderbird
-#: model:ir.module.module,shortdesc:thunderbird.module_meta_information
-msgid "Thunderbird Interface"
-msgstr "Thunderbird接口"
-
-#. module: thunderbird
-#: field:tinythunderbird.partner,sender:0
-msgid "Sender"
-msgstr "发件人"
diff --git a/addons/warning/i18n/nl.po b/addons/warning/i18n/nl.po
index 938f2ac746f..17d9afcefbc 100644
--- a/addons/warning/i18n/nl.po
+++ b/addons/warning/i18n/nl.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-09-16 17:45+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-04-22 09:28+0000\n"
+"Last-Translator: Jan Verlaan (Veritos) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:19+0000\n"
+"X-Launchpad-Export-Date: 2010-04-23 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: warning
@@ -39,7 +39,7 @@ msgstr "Verkooporderregel"
#. module: warning
#: view:product.product:0
msgid "Warning when Purchasing this Product"
-msgstr ""
+msgstr "Waarschuw wanneer dit product gekocht wordt"
#. module: warning
#: view:product.product:0
@@ -54,12 +54,12 @@ msgstr "Waarschuwingen"
#: selection:res.partner,purchase_warn:0
#: selection:res.partner,sale_warn:0
msgid "Blocking Message"
-msgstr ""
+msgstr "Blokkerend bericht"
#. module: warning
#: view:res.partner:0
msgid "Warning on the Invoice"
-msgstr ""
+msgstr "Waarschuwing op de factuur"
#. module: warning
#: selection:product.product,purchase_line_warn:0
@@ -69,12 +69,12 @@ msgstr ""
#: selection:res.partner,purchase_warn:0
#: selection:res.partner,sale_warn:0
msgid "No Message"
-msgstr ""
+msgstr "Geen bericht"
#. module: warning
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr "Ongeldige XML voor overzicht"
+msgstr "Ongeldige XML, kan overzicht niet weergeven!"
#. module: warning
#: field:res.partner,invoice_warn:0
@@ -89,7 +89,7 @@ msgstr ""
#. module: warning
#: view:product.product:0
msgid "Warning when Selling this Product"
-msgstr ""
+msgstr "Waarschuw bij verkopen van dit product"
#. module: warning
#: field:res.partner,sale_warn:0
@@ -128,6 +128,10 @@ msgid ""
"Selecting \"Blocking Message\" will throw an exception with the message and "
"block the flow. The Message has to be written in the next field."
msgstr ""
+"Door de 'Waarschuwingsoptie' te selecteren wordt het bericht naar de "
+"gebruiker gestuurd. Door het 'Blokkerend bericht' te kiezen wordt een fout "
+"gegenereerd met de boodschap en het proces wordt geblokkeerd. Het bericht "
+"moet in het volgende veld worden ingevoerd."
#. module: warning
#: field:res.partner,invoice_warn_msg:0
@@ -142,17 +146,17 @@ msgstr ""
#. module: warning
#: view:res.partner:0
msgid "Warning on the Picking"
-msgstr ""
+msgstr "Waarschuwing op de pickinglijst"
#. module: warning
#: view:res.partner:0
msgid "Warning on the Purchase Order"
-msgstr ""
+msgstr "Waarschuwing op de inkooporder"
#. module: warning
#: view:res.partner:0
msgid "Warning on the Sale Order"
-msgstr ""
+msgstr "Waarschuwing bij de verkooporder."
#. module: warning
#: selection:product.product,purchase_line_warn:0
@@ -162,7 +166,7 @@ msgstr ""
#: selection:res.partner,purchase_warn:0
#: selection:res.partner,sale_warn:0
msgid "Warning"
-msgstr ""
+msgstr "Waarschuwing"
#. module: warning
#: field:res.partner,picking_warn_msg:0
diff --git a/addons/wiki/test/wiki_test00.yml b/addons/wiki/test/wiki_test00.yml
index ef3f490fd85..cdaa28c1829 100755
--- a/addons/wiki/test/wiki_test00.yml
+++ b/addons/wiki/test/wiki_test00.yml
@@ -69,3 +69,4 @@
# ids = self.search(cr, uid, [])
# self.wiki_menu_create(cr, uid, ids, context)
+