[['.....'*(o['level']) ]] [[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]] ( )[[ o['name'] ]] ([[ o['code'] ]])
diff --git a/addons/account_report/security/ir.model.access.csv b/addons/account_report/security/ir.model.access.csv
index a89764ee223..ace4bc06db0 100644
--- a/addons/account_report/security/ir.model.access.csv
+++ b/addons/account_report/security/ir.model.access.csv
@@ -1,5 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_account_report_report","account.report.report","model_account_report_report","account.group_account_manager",1,0,0,0
"access_account_report_history","account.report.history","model_account_report_history","account.group_account_manager",1,0,0,0
-"access_account_report_print_indicators","account.report.print.indicators","model_account_report_print_indicators","account.group_account_manager",1,0,0,0
-"access_account_report_print_indicators_with_pdf","account.report.print.indicators.with.pdf","model_account_report_print_indicators_with_pdf","account.group_account_manager",1,0,0,0
diff --git a/addons/account_report/wizard/account_report_print_indicators_view.xml b/addons/account_report/wizard/account_report_print_indicators_view.xml
index e5a0ec30c76..9add8c9a616 100644
--- a/addons/account_report/wizard/account_report_print_indicators_view.xml
+++ b/addons/account_report/wizard/account_report_print_indicators_view.xml
@@ -8,14 +8,14 @@
form
@@ -31,11 +31,9 @@
new
-
+
account.report.print.indicators.relation.form
@@ -43,10 +41,10 @@
form
-
+
account.voucher.select
account.voucher
search
@@ -101,13 +101,40 @@
-
+
+
+ account.voucher.select
+ account.voucher
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -117,7 +144,7 @@
tree,form
[('journal_id.type','=','sale')]
-
+
@@ -130,7 +157,7 @@
tree,form
[('journal_id.type','=','purchase')]
-
+
@@ -142,134 +169,21 @@
form
tree,form
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ Cheque Register
+ ir.actions.act_window
+ account.voucher
+ form
+ tree,form
+
+
+ [('journal_id.type', '=', 'bank')]
+
+
account.journal.form.inherit
diff --git a/addons/account_voucher_payment/__openerp__.py b/addons/account_voucher_payment/__openerp__.py
index bfe7323d6f1..fc4ce593eac 100755
--- a/addons/account_voucher_payment/__openerp__.py
+++ b/addons/account_voucher_payment/__openerp__.py
@@ -22,9 +22,8 @@
"name" : "Invoice Payment/Receipt by Vouchers.",
"version" : "1.0",
"author" : 'Tiny & Axelor',
- "description": """This module includes :
- * It reconcile the invoice (supplier, customer) while paying through
- Accounting Vouchers
+ "description": """Extension Account Voucher module includes allows to link payment / receipt
+ entries with voucher, also automatically reconcile during the payment and receipt entries
""",
"category" : "Generic Modules/Indian Accounting",
"website" : "http://tinyerpindia.com",
diff --git a/addons/analytic/__init__.py b/addons/analytic/__init__.py
index d0175cf1424..dc48b6f4001 100644
--- a/addons/analytic/__init__.py
+++ b/addons/analytic/__init__.py
@@ -19,7 +19,7 @@
#
##############################################################################
-import analytic
+import project
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/analytic/analytic.py b/addons/analytic/project.py
similarity index 100%
rename from addons/analytic/analytic.py
rename to addons/analytic/project.py
diff --git a/addons/caldav/caldav_view.xml b/addons/caldav/caldav_view.xml
index 4c1003023ae..d1cb79a0e4a 100644
--- a/addons/caldav/caldav_view.xml
+++ b/addons/caldav/caldav_view.xml
@@ -53,11 +53,11 @@
-
-
+ parent="knowledge.menu_document_configuration"/>
-
+
Sales Department
Sales
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index 7e0042f8944..0eb2fbadf6e 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -360,6 +360,7 @@
+
+
diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml
index ab9e5aa0162..e1544d640d1 100644
--- a/addons/crm/crm_view.xml
+++ b/addons/crm/crm_view.xml
@@ -1,10 +1,7 @@
-
-
+
diff --git a/addons/crm/i18n/es.po b/addons/crm/i18n/es.po
index 6069a1860cc..fa1b967cea8 100644
--- a/addons/crm/i18n/es.po
+++ b/addons/crm/i18n/es.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-29 03:37+0000\n"
+"X-Launchpad-Export-Date: 2010-06-30 03:34+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm
diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py
index f9c39c92403..f7cd5bae694 100644
--- a/addons/crm/report/crm_lead_report.py
+++ b/addons/crm/report/crm_lead_report.py
@@ -51,7 +51,7 @@ class crm_lead_report(osv.osv):
for case in self.browse(cr, uid, ids, context):
if field_name != 'avg_answers':
state = field_name[5:]
- cr.execute("select count(*) from crm_opportunity where \
+ cr.execute("select count(id) from crm_opportunity where \
section_id =%s and state='%s'"%(case.section_id.id, state))
state_cases = cr.fetchone()[0]
perc_state = (state_cases / float(case.nbr)) * 100
@@ -64,7 +64,7 @@ class crm_lead_report(osv.osv):
else:
model_name = model_name[1]
- cr.execute("select count(*) from crm_case_log l, ir_model m \
+ cr.execute("select count(id) from crm_case_log l, ir_model m \
where l.model_id=m.id and m.model = '%s'" , model_name)
logs = cr.fetchone()[0]
@@ -90,7 +90,7 @@ class crm_lead_report(osv.osv):
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
- 'email': fields.integer('# of Emails', size=128, readonly=True),
+ 'email': fields.integer('# Emails', size=128, readonly=True),
'delay_open': fields.float('Delay to Open',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
'delay_close': fields.float('Delay to Close',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'delay_expected': fields.float('Overpassed Deadline',digits=(16,2),readonly=True, group_operator="avg"),
@@ -120,60 +120,39 @@ class crm_lead_report(osv.osv):
CRM Lead Report
@param cr: the current row, from the database cursor
"""
-
tools.drop_view_if_exists(cr, 'crm_lead_report')
cr.execute("""
- create or replace view crm_lead_report as (
- select
- min(c.id) as id,
+ CREATE OR REPLACE VIEW crm_lead_report AS (
+ SELECT
+ 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,
to_char(c.create_date, 'YYYY-MM-DD') as creation_date,
to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
- c.state as state,
+ c.state,
c.user_id,
c.probability,
c.stage_id,
- c.type as type,
+ c.type,
c.company_id,
c.priority,
c.section_id,
c.categ_id,
c.partner_id,
c.planned_revenue,
- (select 1) as nbr,
+ 1 as nbr,
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
- (select count(id) from mailgate_message where res_id=c.id and model='crm.lead') as email,
+ (SELECT count(id) FROM mailgate_message WHERE model='crm.lead' AND res_id=c.id) AS email,
date_trunc('day',c.create_date) as create_date,
- avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close,
- avg(extract('epoch' from (c.date_deadline - c.date_closed)))/(3600*24) as delay_expected,
- avg(extract('epoch' from (c.date_open-c.create_date)))/(3600*24) as delay_open
- from
+ extract('epoch' from (c.date_closed-c.create_date))/(3600*24) as delay_close,
+ extract('epoch' from (c.date_deadline - c.date_closed))/(3600*24) as delay_expected,
+ extract('epoch' from (c.date_open-c.create_date))/(3600*24) as delay_open
+ FROM
crm_lead c
- group by
- to_char(c.create_date, 'YYYY'),
- to_char(c.date_open, 'YYYY-MM-DD'),
- to_char(c.date_closed, 'YYYY-mm-dd'),
- to_char(c.create_date, 'MM'),
- c.state,
- c.user_id,
- c.id,
- c.section_id,
- c.stage_id,
- c.probability,
- c.categ_id,
- c.partner_id,
- c.planned_revenue,
- c.company_id,
- c.priority,
- c.type,
- c.create_date,
- to_char(c.create_date, 'YYYY-MM-DD')
-
)""")
crm_lead_report()
diff --git a/addons/crm/report/crm_phonecall_report.py b/addons/crm/report/crm_phonecall_report.py
index c0e666e4eaa..25e62fb2342 100644
--- a/addons/crm/report/crm_phonecall_report.py
+++ b/addons/crm/report/crm_phonecall_report.py
@@ -114,12 +114,11 @@ class crm_phonecall_report(osv.osv):
""" Phone Calls By User And Section
@param cr: the current row, from the database cursor,
"""
-
tools.drop_view_if_exists(cr, 'crm_phonecall_report')
cr.execute("""
create or replace view crm_phonecall_report as (
select
- min(c.id) as id,
+ 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,
@@ -135,33 +134,16 @@ class crm_phonecall_report(osv.osv):
c.duration,
c.company_id,
c.priority,
- (select 1) as nbr,
+ 1 as nbr,
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
date_trunc('day',c.create_date) as create_date,
- avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close,
- avg(extract('epoch' from (c.date_open-c.create_date)))/(3600*24) as delay_open
-
+ extract('epoch' from (c.date_closed-c.create_date))/(3600*24) as delay_close,
+ extract('epoch' from (c.date_open-c.create_date))/(3600*24) as delay_open
from
crm_phonecall c
- where c.categ_id in (select res_id from ir_model_data where (name = 'categ_phone1' or name ='categ_phone2'))
- 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.partner_id,
- c.company_id,
- c.duration,
- c.priority,
- to_char(c.date_open, 'YYYY-MM-DD'),
- to_char(c.date_closed, 'YYYY-mm-dd'),
- c.stage_id,
- to_char(c.create_date, 'YYYY-MM-DD'),
- c.create_date
+ where c.categ_id in (select res_id from ir_model_data where (name = 'categ_phone1' or name ='categ_phone2') and model = 'crm.case.categ')
)""")
crm_phonecall_report()
diff --git a/addons/crm/security/crm_security.xml b/addons/crm/security/crm_security.xml
index 8799dc7aa2c..d72847c44e3 100644
--- a/addons/crm/security/crm_security.xml
+++ b/addons/crm/security/crm_security.xml
@@ -9,14 +9,14 @@
CRM / User
-
-
-
-
-
-
-
+
+
+
diff --git a/addons/crm/wizard/crm_forward_to_partner.py b/addons/crm/wizard/crm_forward_to_partner.py
index f6f43ed7f38..cf0463af66b 100644
--- a/addons/crm/wizard/crm_forward_to_partner.py
+++ b/addons/crm/wizard/crm_forward_to_partner.py
@@ -125,7 +125,6 @@ class crm_lead_forward_to_partner(osv.osv_memory):
msg_val = ''
model_pool = self.pool.get('crm.lead')
- print history_type
if history_type == 'info':
msg_val = self.get_lead_details(cr, uid, res_id, context=context)
@@ -188,7 +187,6 @@ class crm_lead_forward_to_partner(osv.osv_memory):
this = self.browse(cr, uid, ids[0], context=context)
- smtp_pool = self.pool.get('email.smtpclient')
case_pool = self.pool.get(model)
case = case_pool.browse(cr, uid, res_id, context=context)
diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml
index 48cc9055c58..75defcf3d88 100644
--- a/addons/crm_claim/crm_claim_view.xml
+++ b/addons/crm_claim/crm_claim_view.xml
@@ -2,266 +2,265 @@
-
+
-
+
-
- Claim Categories
- crm.case.categ
- form
-
- [('object_id.model', '=', 'crm.claim')]
- {'object_id':'crm.claim'}
-
+
+ Claim Categories
+ crm.case.categ
+ form
+
+ [('object_id.model', '=', 'crm.claim')]
+ {'object_id':'crm.claim'}
+
-
+
-
+
-
- Claim Stages
- crm.case.stage
- form
-
- [('object_id.model', '=', 'crm.claim')]
- {'object_id':'crm.claim'}
-
+
+ Claim Stages
+ crm.case.stage
+ form
+
+ [('object_id.model', '=', 'crm.claim')]
+ {'object_id':'crm.claim'}
+
-
+
-
+
-
- Claim Resource Type
- crm.case.resource.type
- form
-
- [('object_id.model', '=', 'crm.claim')]
- {'object_id':'crm.claim'}
-
+
+ Claim Resource Type
+ crm.case.resource.type
+ form
+
+ [('object_id.model', '=', 'crm.claim')]
+ {'object_id':'crm.claim'}
+
-
+
-
- CRM - Claims Tree
- crm.claim
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ CRM - Claims Tree
+ crm.claim
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- CRM - Claims Form
- crm.claim
- form
-
-
+
+ CRM - Claims Form
+ crm.claim
+ form
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
-
+
+ CRM - Claims Calendar
+ crm.claim
+ calendar
+
+
+
+
+
+
+
+
+
-
- CRM - Claims Calendar
- crm.claim
- calendar
-
-
-
-
-
-
-
-
-
+
-
+
+ CRM -Graph
+ crm.claim
+ graph
+
+
+
+
+
+
+
+
-
- CRM -Graph
- crm.claim
- graph
-
-
-
-
-
-
-
-
+
-
-
-
+
CRM - Claims Search
crm.claim
search
diff --git a/addons/crm_fundraising/crm_fundraising_view.xml b/addons/crm_fundraising/crm_fundraising_view.xml
index 68705d73d8e..b671b15f3dc 100644
--- a/addons/crm_fundraising/crm_fundraising_view.xml
+++ b/addons/crm_fundraising/crm_fundraising_view.xml
@@ -17,7 +17,7 @@
{'object_id':'crm.fundraising'}
-
@@ -154,41 +154,6 @@
type="object" icon="gtk-convert" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -226,6 +191,41 @@
context="{'mail':'new', 'model': 'crm.fundraising'}"
icon="gtk-go-forward" type="action" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/crm_helpdesk/crm_helpdesk_view.xml b/addons/crm_helpdesk/crm_helpdesk_view.xml
index c077c219162..9fb6b673eb2 100644
--- a/addons/crm_helpdesk/crm_helpdesk_view.xml
+++ b/addons/crm_helpdesk/crm_helpdesk_view.xml
@@ -93,41 +93,6 @@
icon="gtk-convert" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -165,6 +130,41 @@
context="{'mail':'new', 'model': 'crm.helpdesk'}"
icon="gtk-go-forward" type="action" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py
index f1fadd81bd4..4b87e4c790e 100644
--- a/addons/delivery/delivery.py
+++ b/addons/delivery/delivery.py
@@ -149,7 +149,7 @@ class delivery_grid_line(osv.osv):
'name': fields.char('Name', size=32, required=True),
'grid_id': fields.many2one('delivery.grid', 'Grid',required=True),
'type': fields.selection([('weight','Weight'),('volume','Volume'),('wv','Weight * Volume'), ('price','Price')], 'Variable', required=True),
- 'operator': fields.selection([('==','='),('<=','<='),('>=','>=')], 'Operator', required=True),
+ 'operator': fields.selection([('=','='),('<=','<='),('>=','>=')], 'Operator', required=True),
'max_value': fields.float('Maximum Value', required=True),
'price_type': fields.selection([('fixed','Fixed'),('variable','Variable')], 'Price Type', required=True),
'variable_factor': fields.selection([('weight','Weight'),('volume','Volume'),('wv','Weight * Volume'), ('price','Price')], 'Variable Factor', required=True),
diff --git a/addons/document/__openerp__.py b/addons/document/__openerp__.py
index e8b8b3969e9..a260a083d74 100644
--- a/addons/document/__openerp__.py
+++ b/addons/document/__openerp__.py
@@ -40,7 +40,7 @@
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
- 'depends': ['base', 'process','board'],
+ 'depends': ['process','board', 'knowledge'],
'init_xml': [],
'update_xml': [
'security/document_security.xml',
diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml
index 5dc1bbcf0f8..e4355987fbb 100644
--- a/addons/document/document_view.xml
+++ b/addons/document/document_view.xml
@@ -1,11 +1,6 @@
-
-
-
-
-
+
document.storage
@@ -323,7 +318,7 @@
Document
form
-
+
\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-09-08 13:25+0000\n"
+"PO-Revision-Date: 2010-06-29 10:10+0000\n"
"Last-Translator: vir (Open ERP) \n"
"Language-Team: Hindi \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-22 04:18+0000\n"
+"X-Launchpad-Export-Date: 2010-06-30 03:34+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: document
@@ -25,12 +25,12 @@ msgstr "तारीख़ को बनाया गया"
#. module: document
#: field:document.directory,ressource_id:0
msgid "Resource ID"
-msgstr ""
+msgstr "संसाधन आईडी"
#. module: document
#: field:document.directory.content,include_name:0
msgid "Include Record Name"
-msgstr ""
+msgstr "रिकार्ड का नाम शामिल करे"
#. module: document
#: constraint:ir.model:0
@@ -41,12 +41,12 @@ msgstr ""
#. module: document
#: field:ir.actions.report.xml,model_id:0
msgid "Model Id"
-msgstr ""
+msgstr "मॉडल आईडी"
#. module: document
#: constraint:document.directory:0
msgid "Error! You can not create recursive Directories."
-msgstr ""
+msgstr "Error! You can not create recursive Directories."
#. module: document
#: model:ir.ui.menu,name:document.menu_document_configuration
@@ -56,12 +56,12 @@ msgstr "दस्तावेज़ विन्यास"
#. module: document
#: view:ir.attachment:0
msgid "Preview"
-msgstr ""
+msgstr "पूर्वावलोकन"
#. module: document
#: field:ir.attachment,store_method:0
msgid "Storing Method"
-msgstr ""
+msgstr "भंडारण विधि"
#. module: document
#: model:ir.actions.act_window,name:document.action_config_auto_directory
diff --git a/addons/document/security/document_security.xml b/addons/document/security/document_security.xml
index 333cc853542..d7b51ec19dc 100644
--- a/addons/document/security/document_security.xml
+++ b/addons/document/security/document_security.xml
@@ -10,7 +10,7 @@
Document / Manager
-
-
-
-
-
-
-
-
+
diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml
index f6add4a07ed..64ac0e27a48 100644
--- a/addons/hr/hr_view.xml
+++ b/addons/hr/hr_view.xml
@@ -9,7 +9,7 @@
diff --git a/addons/hr_evaluation/i18n/es.po b/addons/hr_evaluation/i18n/es.po
new file mode 100644
index 00000000000..5dd4b64fb11
--- /dev/null
+++ b/addons/hr_evaluation/i18n/es.po
@@ -0,0 +1,279 @@
+# Spanish 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-25 12:18+0000\n"
+"PO-Revision-Date: 2010-06-29 22:34+0000\n"
+"Last-Translator: Borja López Soilán (Pexego) \n"
+"Language-Team: Spanish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-06-30 03:34+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.type:0
+#: field:hr_evaluation.type,info:0
+msgid "Information"
+msgstr "Información"
+
+#. module: hr_evaluation
+#: constraint:ir.model:0
+msgid ""
+"The Object name must start with x_ and not contain any special character !"
+msgstr ""
+"¡El nombre del objeto debe empezar con x_ y no puede contener ningún "
+"carácter especial!"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.evaluation:0
+msgid "Schedule next evaluation"
+msgstr "Programar siguiente evaluación"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.evaluation:0
+#: field:hr_evaluation.evaluation,info_bad:0
+msgid "Bad Points"
+msgstr "Puntos malos"
+
+#. module: hr_evaluation
+#: model:ir.actions.act_window,name:hr_evaluation.open_view_employee_evaluation_next_my_list
+msgid "My Next Evaluation"
+msgstr "Mi siguiente evaluación"
+
+#. module: hr_evaluation
+#: field:hr_evaluation.type,value_ids:0
+msgid "Values"
+msgstr "Valores"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.evaluation:0
+#: field:hr_evaluation.evaluation,info_good:0
+msgid "Good Points"
+msgstr "Puntos buenos"
+
+#. module: hr_evaluation
+#: field:hr_evaluation.evaluation,state:0
+msgid "State"
+msgstr "Estado"
+
+#. module: hr_evaluation
+#: field:hr_evaluation.evaluation,score:0
+#: field:hr_evaluation.quote,score:0
+#: field:hr_evaluation.type,score:0
+#: field:hr_evaluation.type.value,score:0
+msgid "Score"
+msgstr "Puntuación"
+
+#. module: hr_evaluation
+#: selection:hr_evaluation.evaluation,state:0
+msgid "Draft"
+msgstr "Borrador"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.evaluation:0
+msgid "Informal Data"
+msgstr "Datos informales"
+
+#. module: hr_evaluation
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr "Nombre de modelo inválido en la definición de acción."
+
+#. module: hr_evaluation
+#: field:hr_evaluation.evaluation,employee_id:0
+msgid "Employee"
+msgstr "Empleado"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.evaluation:0
+#: field:hr_evaluation.evaluation,info_improve:0
+msgid "To Improve"
+msgstr "A mejorar"
+
+#. module: hr_evaluation
+#: field:hr_evaluation.quote,evaluation_id:0
+msgid "Evaluation"
+msgstr "Evaluación"
+
+#. module: hr_evaluation
+#: field:hr_evaluation.type.value,type_id:0
+msgid "Evaluation Type"
+msgstr "Tipo de evaluación"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.evaluation:0
+msgid "Status"
+msgstr "Estado"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.type:0
+msgid "Apply to categories"
+msgstr "Aplicar a categorias"
+
+#. module: hr_evaluation
+#: model:ir.module.module,description:hr_evaluation.module_meta_information
+msgid "Ability to create employees evaluation."
+msgstr "Capacidad de crear evaluaciones de empleados"
+
+#. module: hr_evaluation
+#: field:hr_evaluation.quote,name:0
+msgid "Quote"
+msgstr "Cita"
+
+#. module: hr_evaluation
+#: field:hr_evaluation.type,category_ids:0
+msgid "Appliable Role"
+msgstr ""
+
+#. module: hr_evaluation
+#: field:hr_evaluation.evaluation,user_id:0
+msgid "Evaluation User"
+msgstr "Usuario evaluación"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.type:0
+msgid "Choices Results"
+msgstr "Resultados elecciones"
+
+#. module: hr_evaluation
+#: field:hr_evaluation.evaluation,date:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: hr_evaluation
+#: model:ir.ui.menu,name:hr_evaluation.menu_eval_hr
+#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_form
+msgid "Evaluations"
+msgstr "Evaluaciones"
+
+#. module: hr_evaluation
+#: model:ir.ui.menu,name:hr_evaluation.menu_eval_config
+msgid "Configuration"
+msgstr "Configuración"
+
+#. module: hr_evaluation
+#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_next_list
+msgid "Next Evaluations"
+msgstr "Siguientes evaluaciones"
+
+#. module: hr_evaluation
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "¡XML inválido para la estructura de la vista!"
+
+#. module: hr_evaluation
+#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_evaluation_type_form
+msgid "Evaluation Criterions"
+msgstr "Criterios de evaluación"
+
+#. module: hr_evaluation
+#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_my_old_evaluation_list
+msgid "My Preceeding Evaluations"
+msgstr "Mis evaluaciones previas"
+
+#. module: hr_evaluation
+#: model:ir.ui.menu,name:hr_evaluation.menu_resp_hr
+msgid "HR Responsible"
+msgstr "Responsable RRHH"
+
+#. module: hr_evaluation
+#: field:hr_evaluation.quote,value_id:0
+#: field:hr_evaluation.type.value,name:0
+msgid "Value"
+msgstr "Valor"
+
+#. module: hr_evaluation
+#: field:hr_evaluation.evaluation,name:0
+msgid "Summary"
+msgstr "Resúmen"
+
+#. module: hr_evaluation
+#: field:hr_evaluation.type,active:0
+msgid "Active"
+msgstr "Activo"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.type:0
+msgid "Notes"
+msgstr "Notas"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.evaluation:0
+#: model:ir.model,name:hr_evaluation.model_hr_evaluation_evaluation
+msgid "Employee Evaluation"
+msgstr "Evaluación empleado"
+
+#. module: hr_evaluation
+#: model:ir.model,name:hr_evaluation.model_hr_evaluation_type
+msgid "Employee Evaluation Type"
+msgstr "Tipo evaluación empleado"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.evaluation:0
+msgid "Quotations"
+msgstr "Citas"
+
+#. module: hr_evaluation
+#: model:ir.actions.act_window,name:hr_evaluation.open_view_employee_evaluation_next_list
+msgid "Next Employee Evaluation"
+msgstr "Siguiente evaluación empleado"
+
+#. module: hr_evaluation
+#: field:hr_evaluation.quote,type_id:0
+msgid "Type"
+msgstr "Tipo"
+
+#. module: hr_evaluation
+#: view:hr_evaluation.type:0
+#: field:hr_evaluation.type,name:0
+msgid "Evaluation Criterion"
+msgstr ""
+
+#. module: hr_evaluation
+#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_next_my_list
+msgid "My Next Evaluations"
+msgstr ""
+
+#. module: hr_evaluation
+#: view:hr_evaluation.quote:0
+msgid "Evalution Quote"
+msgstr ""
+
+#. module: hr_evaluation
+#: model:ir.module.module,shortdesc:hr_evaluation.module_meta_information
+msgid "Human Resources Evaluation"
+msgstr ""
+
+#. module: hr_evaluation
+#: field:hr_evaluation.evaluation,quote_ids:0
+msgid "Quotes"
+msgstr ""
+
+#. module: hr_evaluation
+#: view:hr_evaluation.evaluation:0
+#: selection:hr_evaluation.evaluation,state:0
+msgid "Done"
+msgstr ""
+
+#. module: hr_evaluation
+#: model:ir.model,name:hr_evaluation.model_hr_evaluation_quote
+msgid "Employee Evaluation Quote"
+msgstr ""
+
+#. module: hr_evaluation
+#: view:hr_evaluation.evaluation:0
+#: field:hr_evaluation.evaluation,info_employee:0
+msgid "Employee Response"
+msgstr ""
+
+#. module: hr_evaluation
+#: model:ir.model,name:hr_evaluation.model_hr_evaluation_type_value
+msgid "Evaluation Type Value"
+msgstr ""
diff --git a/addons/hr_holidays/hr_holidays_report.xml b/addons/hr_holidays/hr_holidays_report.xml
index 23d1e1a75bf..88670544ebf 100644
--- a/addons/hr_holidays/hr_holidays_report.xml
+++ b/addons/hr_holidays/hr_holidays_report.xml
@@ -1,14 +1,14 @@
-
-
+
+
-
+
diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index 98c8d558f3a..c02984942fb 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -55,11 +55,11 @@
-
+
-
-
-
+
+
+
@@ -70,7 +70,7 @@
-
+
@@ -82,48 +82,48 @@
-
- Allocation Request
- hr.holidays
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ Allocation Request
+ hr.holidays
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
hr.holidays.allocation.tree
@@ -242,7 +242,7 @@
-->
@@ -257,53 +257,51 @@
-
-
- tree
-
-
-
+
+
+ tree
+
+
+
-
-
- form
-
-
-
+
+
+ form
+
+
+
+
-
+
+ Allocation Requests
+ hr.holidays
+ form
+ {'search_default_user_id':uid,'type':'add'}
+ [('type','=','add')]
+
+
+
-
- Allocation Requests
- hr.holidays
- form
- {'search_default_user_id':uid,'type':'add'}
- [('type','=','add')]
-
-
-
+
+
+ tree
+
+
+
-
-
- tree
-
-
-
+
+
+ form
+
+
+
-
-
- form
-
-
-
-
-
-
-
+
resource.calendar.leaves.form.inherit
resource.calendar.leaves
form
-
-
-
+
+
+
-
+
-
-
+
-
-
-
-
diff --git a/addons/hr_payroll/__openerp__.py b/addons/hr_payroll/__openerp__.py
index 1d83902d36e..9f1c59abc4f 100644
--- a/addons/hr_payroll/__openerp__.py
+++ b/addons/hr_payroll/__openerp__.py
@@ -37,10 +37,10 @@
'website':'http://www.openerp.com',
'depends': [
'hr',
+ 'account',
'hr_contract',
'hr_holidays',
- 'hr_expense',
- 'account'
+ 'hr_expense'
],
'init_xml': [
],
@@ -53,7 +53,6 @@
'hr_payroll_wizard.xml'
],
'demo_xml': [
- 'hr_payroll_demo.xml'
],
'installable': True,
'active': False,
diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py
index c8687df870e..108d83a9ee9 100644
--- a/addons/hr_payroll/hr_payroll.py
+++ b/addons/hr_payroll/hr_payroll.py
@@ -213,29 +213,66 @@ class payroll_register(osv.osv):
def compute_sheet(self, cr, uid, ids, context={}):
emp_pool = self.pool.get('hr.employee')
slip_pool = self.pool.get('hr.payslip')
+ func_pool = self.pool.get('hr.payroll.structure')
+ slip_line_pool = self.pool.get('hr.payslip.line')
wf_service = netsvc.LocalService("workflow")
- vals = self.browse(cr, uid, ids)[0]
+ vals = self.read(cr, uid, ids)[0]
emp_ids = emp_pool.search(cr, uid, [])
for emp in emp_pool.browse(cr, uid, emp_ids):
- old_slips = slip_pool.search(cr, uid, [('employee_id','=',emp.id), ('date','=',vals.date)])
+ old_slips = slip_pool.search(cr, uid, [('employee_id','=',emp.id), ('date','=',vals['date'])])
if old_slips:
slip_pool.write(cr, uid, old_slips, {'register_id':ids[0]})
for sid in old_slips:
wf_service.trg_validate(uid, 'hr.payslip', sid, 'compute_sheet', cr)
continue
-
+
+ sql_req= '''
+ SELECT c.wage as wage, struct_id as function
+ FROM hr_contract c
+ LEFT JOIN hr_employee emp on (c.employee_id=emp.id)
+ LEFT JOIN hr_contract_wage_type cwt on (cwt.id = c.wage_type_id)
+ LEFT JOIN hr_contract_wage_type_period p on (cwt.period_id = p.id)
+ WHERE
+ (emp.id=%s) AND
+ (date_start <= %s) AND
+ (date_end IS NULL OR date_end >= %s)
+ LIMIT 1
+ '''
+ cr.execute(sql_req, (emp.id, vals['date'], vals['date']))
+ contract_info = cr.dictfetchone()
+
+ if not contract_info:
+ continue
+
+ function = contract_info['struct_id']
+ lines = []
+ if function:
+ func = func_pool.read(cr, uid, function, ['line_ids'])
+ lines = slip_line_pool.browse(cr, uid, func['line_ids'])
+
res = {
'employee_id':emp.id,
+ 'basic':contract_info['wage'],
'register_id':ids[0],
- 'name':vals.name,
- 'date':vals.date,
- 'journal_id':vals.journal_id.id,
- 'bank_journal_id':vals.bank_journal_id.id
+ 'name':vals['name'],
+ 'date':vals['date'],
+ 'journal_id':vals['journal_id'][0],
+ 'bank_journal_id':vals['bank_journal_id'][0]
}
slip_id = slip_pool.create(cr, uid, res)
+
+ old_slip_id = slip_line_pool.search(cr, uid, [('slip_id','=',slip_id)])
+ slip_line_pool.unlink(cr, uid, old_slip_id)
+
+ for line in lines:
+ slip_line_pool.copy(cr, uid, line.id, {'slip_id':slip_id, 'employee_id':False, 'function_id':False}, {})
+
+ for line in emp.line_ids:
+ slip_line_pool.copy(cr, uid, line.id, {'slip_id':slip_id, 'employee_id':False, 'function_id':False}, {})
+
wf_service.trg_validate(uid, 'hr.payslip', slip_id, 'compute_sheet', cr)
number = self.pool.get('ir.sequence').get(cr, uid, 'salary.register')
@@ -277,17 +314,15 @@ class payroll_register(osv.osv):
for sid in sids:
wf_service.trg_validate(uid, 'hr.payslip', sid, 'final_verify_sheet', cr)
+
for reg in self.browse(cr, uid, ids):
accs = {}
for slip in reg.line_ids:
pid = False
if accs.get(slip.employee_id.property_bank_account.code, False) == False:
- company_name = self.pool.get('res.users').browse(cr, uid, uid).company_id.name
- bank_name = slip.employee_id.property_bank_account.name
- number = self.pool.get('ir.sequence').get(cr, uid, 'payment.advice')
advice = {
- 'name': 'Payment Advice from %s / Bank Account %s' % (company_name, bank_name),
- 'number': number,
+ 'name': 'Payment Advice from %s / Bank Account %s' % (self.pool.get('res.users').browse(cr, uid, uid).company_id.name, slip.employee_id.property_bank_account.name),
+ 'number': self.pool.get('ir.sequence').get(cr, uid, 'payment.advice'),
'register_id':reg.id,
'account_id':slip.employee_id.property_bank_account.id
}
@@ -296,18 +331,16 @@ class payroll_register(osv.osv):
else:
pid = accs[slip.employee_id.property_bank_account.code]
- if not slip.employee_id.bank_account_id:
- raise osv.except_osv(_('Warning'), _("Bank Account not defined for %s !" % (slip.employee_id.name)))
- else:
- pline = {
- 'advice_id':pid,
- 'name':slip.employee_id.bank_account_id.acc_number,
- 'employee_id':slip.employee_id.id,
- 'amount':slip.other_pay + slip.net,
- 'bysal':slip.net
- }
- id = advice_line_pool.create(cr, uid, pline)
+ pline = {
+ 'advice_id':pid,
+ 'name':slip.employee_id.otherid,
+ 'employee_id':slip.employee_id.id,
+ 'amount':slip.other_pay + slip.net,
+ 'bysal':slip.net
+ }
+ id = advice_line_pool.create(cr, uid, pline)
+ #, 'advice_ids':[(6, 0, [pid])]
self.write(cr, uid, ids, {'state':'confirm'})
return True
@@ -496,7 +529,7 @@ class payment_category(osv.osv):
_name = 'hr.allounce.deduction.categoty'
_description = 'Allowance Deduction Heads'
-
+
_columns = {
'name':fields.char('Categoty Name', size=64, required=True, readonly=False),
'code':fields.char('Categoty Code', size=64, required=True, readonly=False),
@@ -505,15 +538,13 @@ class payment_category(osv.osv):
('deduction','Deduction'),
('other','Others'),
],'Type', select=True),
- 'base': fields.text('Based on', required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'),
- #'base':fields.char('Based on', size=64, required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'),
+ 'base':fields.char('Based on', size=64, required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'),
'condition':fields.char('Condition', size=1024, required=True, readonly=False, help='Applied this head for calculation if condition is true'),
'sequence': fields.integer('Sequence', required=True, help='Use to arrange calculation sequence'),
'note': fields.text('Description'),
'user_id':fields.char('User', size=64, required=False, readonly=False),
'state':fields.char('Label', size=64, required=False, readonly=False),
'company_id':fields.many2one('res.company', 'Company', required=False),
- 'contribute_ids':fields.one2many('company.contribution', 'category_id', 'Company Contribution', required=False),
}
_defaults = {
'condition': lambda *a: 'True',
@@ -755,14 +786,17 @@ class hr_payslip(osv.osv):
'other_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Others', digits=(16, 2)),
'total_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Total Payment', digits=(16, 2)),
'line_ids':fields.one2many('hr.payslip.line', 'slip_id', 'Payslip Line', required=False, readonly=True, states={'draft': [('readonly', False)]}),
+ 'move_ids':fields.one2many('hr.payslip.account.move', 'slip_id', 'Accounting vouchers', required=False),
+ 'move_line_ids':fields.many2many('account.move.line', 'payslip_lines_rel', 'slip_id', 'line_id', 'Accounting Lines', readonly=True),
+ 'move_payment_ids':fields.many2many('account.move.line', 'payslip_payment_rel', 'slip_id', 'payment_id', 'Payment Lines', readonly=True),
'company_id':fields.many2one('res.company', 'Company', required=False),
+ 'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."),
'holiday_days': fields.integer('No of Leaves', readonly=True),
'worked_days': fields.integer('Worked Day', readonly=True),
'working_days': fields.integer('Working Days', readonly=True),
'paid':fields.boolean('Paid ? ', required=False),
'note':fields.text('Description'),
'contract_id':fields.many2one('hr.contract', 'Contract', required=False),
-
'igross': fields.float('Calculaton Field', readonly=True, digits=(16, 2), help="Calculation field used for internal calculation, do not place this on form"),
'inet': fields.float('Calculaton Field', readonly=True, digits=(16, 2), help="Calculation field used for internal calculation, do not place this on form"),
}
@@ -789,16 +823,176 @@ class hr_payslip(osv.osv):
res_id = super(hr_payslip, self).copy(cr, uid, id, default, context)
return res_id
+ def create_voucher(self, cr, uid, ids, name, voucher, sequence=5):
+ slip_move = self.pool.get('hr.payslip.account.move')
+ for slip in ids:
+ res = {
+ 'slip_id':slip,
+ 'move_id':voucher,
+ 'sequence':sequence,
+ 'name':name
+ }
+ slip_move.create(cr, uid, res)
+
def set_to_draft(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'draft'})
return True
def cancel_sheet(self, cr, uid, ids, context={}):
+ move_pool = self.pool.get('account.move')
+
+ for slip in self.browse(cr, uid, ids, context):
+ for line in slip.move_ids:
+ if slip.move_id:
+ if slip.move_id.state == 'posted':
+ move_pool.button_cancel(cr, uid [slip.move_id.id], context)
+ move_pool.unlink(cr, uid, [slip.move_id.id])
+
self.write(cr, uid, ids, {'state':'cancel'})
return True
def process_sheet(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'done'})
+ move_pool = self.pool.get('account.move')
+ movel_pool = self.pool.get('account.move.line')
+ invoice_pool = self.pool.get('account.invoice')
+
+ for slip in self.browse(cr,uid,ids):
+ line_ids = []
+ partner = False
+ partner_id = False
+ exp_ids = []
+
+ partner = slip.employee_id.address_home_id.partner_id
+ partner_id = partner.id
+
+ fiscal_year_ids = self.pool.get('account.fiscalyear').search(cr, uid, [])
+ if not fiscal_year_ids:
+ raise osv.except_osv(_('Warning !'), _('Please define fiscal year for perticular contract'))
+ fiscal_year_objs = self.pool.get('account.fiscalyear').read(cr, uid, fiscal_year_ids, ['date_start','date_stop'])
+ year_exist = False
+ for fiscal_year in fiscal_year_objs:
+ if ((fiscal_year['date_start'] <= slip.date) and (fiscal_year['date_stop'] >= slip.date)):
+ year_exist = True
+ if not year_exist:
+ raise osv.except_osv(_('Warning !'), _('Fiscal Year is not defined for slip date %s'%slip.date))
+ search_period = self.pool.get('account.period').search(cr,uid,[('date_start','<=',slip.date),('date_stop','>=',slip.date)])
+ if not search_period:
+ raise osv.except_osv(_('Warning !'), _('Period is not defined for slip date %s'%slip.date))
+ period_id = search_period[0]
+ name = 'Payment of Salary to %s' % (slip.employee_id.name)
+ move = {
+ 'journal_id': slip.bank_journal_id.id,
+ 'period_id': period_id,
+ 'date': slip.date,
+ 'type':'bank_pay_voucher',
+ 'ref':slip.number,
+ 'narration': name
+ }
+ move_id = move_pool.create(cr, uid, move)
+ self.create_voucher(cr, uid, [slip.id], name, move_id)
+
+ name = "To %s account" % (slip.employee_id.name)
+ ded_rec = {
+ 'move_id':move_id,
+ 'name': name,
+ #'partner_id': partner_id,
+ 'date': slip.date,
+ 'account_id': slip.employee_id.property_bank_account.id,
+ 'debit': 0.0,
+ 'credit' : slip.total_pay,
+ 'journal_id' : slip.journal_id.id,
+ 'period_id' :period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, ded_rec)]
+ name = "By %s account" % (slip.employee_id.property_bank_account.name)
+ cre_rec = {
+ 'move_id':move_id,
+ 'name': name,
+ 'partner_id': partner_id,
+ 'date': slip.date,
+ 'account_id': partner.property_account_payable.id,
+ 'debit': slip.total_pay,
+ 'credit' : 0.0,
+ 'journal_id' : slip.journal_id.id,
+ 'period_id' :period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, cre_rec)]
+
+ other_pay = slip.other_pay
+ #Process all Reambuse Entries
+ for line in slip.line_ids:
+ if line.type == 'otherpay' and line.expanse_id.invoice_id:
+ if not line.expanse_id.invoice_id.move_id:
+ raise osv.except_osv(_('Warning !'), _('Please Confirm all Expanse Invoice appear for Reimbursement'))
+ invids = [line.expanse_id.invoice_id.id]
+ amount = line.total
+ acc_id = slip.bank_journal_id.default_credit_account_id and slip.bank_journal_id.default_credit_account_id.id
+ period_id = slip.period_id.id
+ journal_id = slip.bank_journal_id.id
+ name = '[%s]-%s' % (slip.number, line.name)
+ invoice_pool.pay_and_reconcile(cr, uid, invids, amount, acc_id, period_id, journal_id, False, period_id, False, context, name)
+ other_pay -= amount
+ #TODO: link this account entries to the Payment Lines also Expanse Entries to Account Lines
+ l_ids = movel_pool.search(cr, uid, [('name','=',name)])
+ line_ids += l_ids
+
+ l_ids = movel_pool.search(cr, uid, [('invoice','=',line.expanse_id.invoice_id.id)])
+ exp_ids += l_ids
+
+ #Process for Other payment if any
+ other_move_id = False
+ if slip.other_pay > 0:
+ narration = 'Payment of Other Payeble amounts to %s' % (slip.employee_id.name)
+ move = {
+ 'journal_id': slip.bank_journal_id.id,
+ 'period_id': period_id,
+ 'date': slip.date,
+ 'type':'bank_pay_voucher',
+ 'ref':slip.number,
+ 'narration': narration
+ }
+ other_move_id = move_pool.create(cr, uid, move)
+ self.create_voucher(cr, uid, [slip.id], narration, move_id)
+
+ name = "To %s account" % (slip.employee_id.name)
+ ded_rec = {
+ 'move_id':other_move_id,
+ 'name':name,
+ 'date':slip.date,
+ 'account_id':slip.employee_id.property_bank_account.id,
+ 'debit': 0.0,
+ 'credit': other_pay,
+ 'journal_id':slip.journal_id.id,
+ 'period_id':period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, ded_rec)]
+ name = "By %s account" % (slip.employee_id.property_bank_account.name)
+ cre_rec = {
+ 'move_id':other_move_id,
+ 'name':name,
+ 'partner_id':partner_id,
+ 'date':slip.date,
+ 'account_id':partner.property_account_payable.id,
+ 'debit': other_pay,
+ 'credit':0.0,
+ 'journal_id':slip.journal_id.id,
+ 'period_id':period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, cre_rec)]
+
+ rec = {
+ 'state':'done',
+ 'move_payment_ids':[(6, 0, line_ids)],
+ 'paid':True
+ }
+ self.write(cr, uid, [slip.id], rec)
+ for exp_id in exp_ids:
+ self.write(cr, uid, [slip.id], {'move_line_ids':[(4, exp_id)]})
+
return True
def account_check_sheet(self, cr, uid, ids, context={}):
@@ -810,22 +1004,364 @@ class hr_payslip(osv.osv):
return True
def verify_sheet(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state':'confirm'})
+
+ move_pool = self.pool.get('account.move')
+ movel_pool = self.pool.get('account.move.line')
+ exp_pool = self.pool.get('hr.expense.expense')
+
+ for slip in self.browse(cr,uid,ids):
+ total_deduct = 0.0
+
+ line_ids = []
+ partner = False
+ partner_id = False
+
+ if not slip.employee_id.address_home_id:
+ raise osv.except_osv(_('Integrity Error !'), _('Please defined the Employee Home Address Along with Partners !!'))
+
+ if not slip.employee_id.address_home_id.partner_id:
+ raise osv.except_osv(_('Integrity Error !'), _('Please defined the Partner in Home Address !!'))
+
+ partner = slip.employee_id.address_home_id.partner_id
+ partner_id = slip.employee_id.address_home_id.partner_id.id
+
+ period_id = False
+
+ if slip.period_id:
+ period_id = slip.period_id.id
+ else:
+ fiscal_year_ids = self.pool.get('account.fiscalyear').search(cr, uid, [])
+ if not fiscal_year_ids:
+ raise osv.except_osv(_('Warning !'), _('Please define fiscal year for perticular contract'))
+ fiscal_year_objs = self.pool.get('account.fiscalyear').read(cr, uid, fiscal_year_ids, ['date_start','date_stop'])
+ year_exist = False
+ for fiscal_year in fiscal_year_objs:
+ if ((fiscal_year['date_start'] <= slip.date) and (fiscal_year['date_stop'] >= slip.date)):
+ year_exist = True
+ if not year_exist:
+ raise osv.except_osv(_('Warning !'), _('Fiscal Year is not defined for slip date %s'%slip.date))
+ search_period = self.pool.get('account.period').search(cr,uid,[('date_start','<=',slip.date),('date_stop','>=',slip.date)])
+ if not search_period:
+ raise osv.except_osv(_('Warning !'), _('Period is not defined for slip date %s'%slip.date))
+ period_id = search_period[0]
+
+ move = {
+ #'name': slip.name,
+ 'journal_id': slip.journal_id.id,
+ 'period_id': period_id,
+ 'date': slip.date,
+ 'ref':slip.number,
+ 'narration': slip.name
+ }
+ move_id = move_pool.create(cr, uid, move)
+ self.create_voucher(cr, uid, [slip.id], slip.name, move_id)
+
+ line = {
+ 'move_id':move_id,
+ 'name': "By Basic Salary / " + slip.employee_id.name,
+ 'date': slip.date,
+ 'account_id': slip.employee_id.salary_account.id,
+ 'debit': slip.basic,
+ 'credit': 0.0,
+ 'quantity':slip.working_days,
+ 'journal_id': slip.journal_id.id,
+ 'period_id': period_id,
+ 'analytic_account_id': False,
+ 'ref':slip.number
+ }
+
+ #Setting Analysis Account for Basic Salary
+ if slip.employee_id.analytic_account:
+ line['analytic_account_id'] = slip.employee_id.analytic_account.id
+
+ move_line_id = movel_pool.create(cr, uid, line)
+ line_ids += [move_line_id]
+
+ line = {
+ 'move_id':move_id,
+ 'name': "To Basic Paysble Salary / " + slip.employee_id.name,
+ 'partner_id': partner_id,
+ 'date': slip.date,
+ 'account_id': slip.employee_id.employee_account.id,
+ 'debit': 0.0,
+ 'quantity':slip.working_days,
+ 'credit': slip.basic,
+ 'journal_id': slip.journal_id.id,
+ 'period_id': period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, line)]
+
+ for line in slip.line_ids:
+ name = "[%s] - %s / %s" % (line.code, line.name, slip.employee_id.name)
+ amount = line.total
+
+ if line.type == 'leaves':
+ continue
+
+ rec = {
+ 'move_id':move_id,
+ 'name': name,
+ 'date': slip.date,
+ 'account_id': line.account_id.id,
+ 'debit': 0.0,
+ 'credit' : 0.0,
+ 'journal_id' : slip.journal_id.id,
+ 'period_id' :period_id,
+ 'analytic_account_id':False,
+ 'ref':slip.number,
+ 'quantity':1
+ }
+
+ #Setting Analysis Account for Salary Slip Lines
+ if line.analytic_account_id:
+ rec['analytic_account_id'] = line.analytic_account_id.id
+ else:
+ rec['analytic_account_id'] = slip.deg_id.account_id.id
+
+ if line.type == 'allounce' or line.type == 'otherpay':
+ rec['debit'] = amount
+ if not partner.property_account_payable:
+ raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Payable Account!!'))
+ ded_rec = {
+ 'move_id':move_id,
+ 'name': name,
+ 'partner_id': partner_id,
+ 'date': slip.date,
+ 'account_id': partner.property_account_payable.id,
+ 'debit': 0.0,
+ 'quantity':1,
+ 'credit' : amount,
+ 'journal_id' : slip.journal_id.id,
+ 'period_id' :period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, ded_rec)]
+ elif line.type == 'deduction' or line.type == 'otherdeduct':
+ if not partner.property_account_receivable:
+ raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Receivable Account!!'))
+ rec['credit'] = amount
+ total_deduct += amount
+ ded_rec = {
+ 'move_id':move_id,
+ 'name': name,
+ 'partner_id': partner_id,
+ 'date': slip.date,
+ 'quantity':1,
+ 'account_id': partner.property_account_receivable.id,
+ 'debit': amount,
+ 'credit' : 0.0,
+ 'journal_id' : slip.journal_id.id,
+ 'period_id' :period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, ded_rec)]
+
+ line_ids += [movel_pool.create(cr, uid, rec)]
+
+ if line.company_contrib > 0:
+ company_contrib = line.company_contrib
+# if line.category_id.amount_type == 'per':
+# company_contrib = (amount * line.category_id.contribute_per)
+
+ narration = """Company Contribution of %s Encode same as a Company Expanse @ %s""" % (line.name, company_contrib)
+ move = {
+ #'name': slip.name,
+ 'journal_id': slip.journal_id.id,
+ 'period_id': period_id,
+ 'date': slip.date,
+ 'ref':slip.number,
+ 'narration': narration
+ }
+ company_contrib_move_id = move_pool.create(cr, uid, move)
+ name = "[%s] - %s / %s - Company Contribution" % (line.code, line.name, slip.employee_id.name)
+ self.create_voucher(cr, uid, [slip.id], name, company_contrib_move_id)
+
+ ded_deb = {
+ 'move_id':company_contrib_move_id,
+ 'name': name,
+ 'date': slip.date,
+ 'quantity':1,
+ 'account_id': line.category_id.account_id.id,
+ 'debit': company_contrib,
+ 'credit' : 0.0,
+ 'journal_id': slip.journal_id.id,
+ 'period_id': period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, ded_deb)]
+ ded_cre = {
+ 'move_id':company_contrib_move_id,
+ 'name': name,
+ 'date': slip.date,
+ 'quantity':1,
+ 'account_id': line.category_id.register_id.account_id.id,
+ 'debit': 0.0,
+ 'credit' : company_contrib,
+ 'journal_id': slip.journal_id.id,
+ 'period_id': period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, ded_cre)]
+
+ if line.category_id.include_in_salary:
+ narration = """Company Contribution of %s Deducted from Employee %s""" % (line.name, company_contrib)
+ move = {
+ #'name': slip.name,
+ 'journal_id': slip.journal_id.id,
+ 'period_id': period_id,
+ 'date': slip.date,
+ 'ref':slip.number,
+ 'narration': narration
+ }
+ include_in_salary_move_id = move_pool.create(cr, uid, move)
+ self.create_voucher(cr, uid, [slip.id], narration, include_in_salary_move_id)
+
+ total_deduct += company_contrib
+ ded_deb = {
+ 'move_id':include_in_salary_move_id,
+ 'name': name,
+ 'partner_id': partner_id,
+ 'date': slip.date,
+ 'quantity':1,
+ 'account_id': partner.property_account_receivable.id,
+ 'debit': company_contrib,
+ 'credit' : 0.0,
+ 'journal_id': slip.journal_id.id,
+ 'period_id': period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, ded_deb)]
+ ded_cre = {
+ 'move_id':include_in_salary_move_id,
+ 'name': name,
+ 'date': slip.date,
+ 'quantity':1,
+ 'account_id': line.category_id.account_id.id,
+ 'debit': 0.0,
+ 'credit' : company_contrib,
+ 'journal_id': slip.journal_id.id,
+ 'period_id': period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, ded_cre)]
+
+ #make an entry line to contribution register
+ if line.category_id.register_id:
+ ctr = {
+ 'register_id':line.category_id.register_id.id,
+ 'name':line.name,
+ 'code':line.code,
+ 'employee_id':slip.employee_id.id,
+ 'period_id':period_id,
+ 'emp_deduction':amount,
+ }
+ if line.category_id.contribute:
+ ctr['comp_deduction'] = amount
+
+ company = 0.0
+ employee = 0.0
+ if line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'per':
+ new_amount = (amount * (line.category_id.contribute_per / (1+line.category_id.contribute_per)))
+ company = new_amount
+ employee = amount - company
+
+ elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'fix':
+ company = line.category_id.contribute_per
+ employee = amount - company
+
+ elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'func':
+ company = self.pool.get('hr.allounce.deduction.categoty').execute_function(cr, uid, line.category_id.id, line.slip_id.basic, context)
+ employee = amount
+
+ elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'per':
+ company = amount * line.category_id.contribute_per
+ employee = amount
+
+ elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'fix':
+ company = line.category_id.contribute_per
+ employee = amount
+
+ elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'func':
+ company = self.pool.get('hr.allounce.deduction.categoty').execute_function(cr, uid, line.category_id.id, line.slip_id.basic, context)
+ employee = amount
+
+ ctr['emp_deduction'] = employee
+ ctr['comp_deduction'] = company
+
+ self.pool.get('hr.contibution.register.line').create(cr, uid, ctr)
+
+ adj_move_id = False
+ if total_deduct > 0:
+ move = {
+ 'journal_id': slip.journal_id.id,
+ 'period_id': period_id,
+ 'date': slip.date,
+ 'ref':slip.number,
+ 'narration': 'Adjustment : %s' % (slip.name)
+ }
+ adj_move_id = move_pool.create(cr, uid, move)
+ name = "Adjustment Entry - %s" % (slip.employee_id.name)
+ self.create_voucher(cr, uid, [slip.id], name, adj_move_id)
+
+ ded_rec = {
+ 'move_id':adj_move_id,
+ 'name': name,
+ 'partner_id': partner_id,
+ 'date': slip.date,
+ 'account_id': partner.property_account_receivable.id,
+ 'debit': 0.0,
+ 'quantity':1,
+ 'credit' : total_deduct,
+ 'journal_id' : slip.journal_id.id,
+ 'period_id' :period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, ded_rec)]
+ cre_rec = {
+ 'move_id':adj_move_id,
+ 'name': name,
+ 'partner_id': partner_id,
+ 'date': slip.date,
+ 'account_id': partner.property_account_payable.id,
+ 'debit': total_deduct,
+ 'quantity':1,
+ 'credit' : 0.0,
+ 'journal_id' : slip.journal_id.id,
+ 'period_id' :period_id,
+ 'ref':slip.number
+ }
+ line_ids += [movel_pool.create(cr, uid, cre_rec)]
+
+ rec = {
+ 'state':'confirm',
+ 'move_line_ids':[(6, 0,line_ids)],
+ }
+ if not slip.period_id:
+ rec['period_id'] = period_id
+
+ dates = prev_bounds(slip.date)
+ exp_ids = exp_pool.search(cr, uid, [('date_valid','>=',dates[0]), ('date_valid','<=',dates[1]), ('state','=','invoiced')])
+ if exp_ids:
+ acc = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category')
+ for exp in exp_pool.browse(cr, uid, exp_ids):
+ exp_res = {
+ 'name':exp.name,
+ 'amount_type':'fix',
+ 'type':'otherpay',
+ 'category_id':exp.category_id.id,
+ 'amount':exp.amount,
+ 'slip_id':slip.id,
+ 'expanse_id':exp.id,
+ 'account_id':acc
+ }
+ self.pool.get('hr.payslip.line').create(cr, uid, exp_res)
+
+ self.write(cr, uid, [slip.id], rec)
+
return True
def get_contract(self, cr, uid, employee, date, context={}):
- """
- Compute leaves for an employee
-
- @param cr: cursor to database
- @param uid: id of current user
- @param employee: object of the hr.employee model
- @param date: date on which pay slip is creating
- @param context: context arguments, like lang, time zone
-
- @return: return a current contract from the list of contract
- """
-
sql_req= '''
SELECT c.id as id, c.wage as wage, struct_id as function
FROM hr_contract c
@@ -839,7 +1375,9 @@ class hr_payslip(osv.osv):
LIMIT 1
'''
cr.execute(sql_req, (employee.id, date, date))
- contract = cr.dictfetchone()
+ contract = cr.dictfetchone()
+
+ contract = contract and contract or {}
return contract
@@ -852,6 +1390,7 @@ class hr_payslip(osv.osv):
@param slip: object of the hr.payroll.slip model
@param employee: object of the hr.employee model
@param context: context arguments, like lang, time zone
+
@return: return a result
"""
@@ -887,17 +1426,12 @@ class hr_payslip(osv.osv):
if datetime.date(year, month, day).weekday() == calc_day:
count += 1
return count
-
- basic = 0.0
- contract = False
+
for slip in self.browse(cr, uid, ids):
- basic = 0.0
-
contracts = self.get_contract(cr, uid, slip.employee_id, date, context)
- if not contracts or contracts.get('id', False) == False:
+ if contracts.get('id', False) == False:
continue
-
contract = self.pool.get('hr.contract').browse(cr, uid, contracts.get('id'))
sal_type = contract.wage_type_id.type
@@ -974,7 +1508,7 @@ class hr_payslip(osv.osv):
amt = eval(base, obj)
except Exception, e:
raise osv.except_osv(_('Variable Error !'), _('Variable Error : %s ' % (e)))
-
+
if sal_type in ('gross', 'net'):
if line.amount_type == 'per':
percent = line.amount
@@ -986,10 +1520,7 @@ class hr_payslip(osv.osv):
if value > 0:
percent = 0.0
-
- for cline in line.category_id.contribute_ids:
- pass
-
+
elif line.amount_type == 'fix':
value = line.amount
@@ -997,16 +1528,12 @@ class hr_payslip(osv.osv):
value = self.pool.get('hr.payslip.line').execute_function(cr, uid, line.id, amt, context)
line.amount = value
else:
- if line.amount_type == 'func':
+ if line.amount_type in ('fix', 'per'):
+ value = line.amount
+ elif line.amount_type == 'func':
value = self.pool.get('hr.payslip.line').execute_function(cr, uid, line.id, amt, context)
line.amount = value
-
-# for cline in line.category_id.contribute_ids:
-# if cline.amount_type == 'fix':
-# contribute = cline.contribute_per
-# elif cline.amount_type == 'func':
-# contribute = func_pool.execute_function(cr, uid, cline.id, line.amount, context)
-
+
if line.type == 'allowance':
all_per += percent
all_fix += value
@@ -1022,7 +1549,7 @@ class hr_payslip(osv.osv):
'base':base
}
slip_line_pool.copy(cr, uid, line.id, vals, {})
-
+
if sal_type in ('gross', 'net'):
sal = contract.wage
if sal_type == 'net':
@@ -1054,80 +1581,97 @@ class hr_payslip(osv.osv):
})
self.write(cr, uid, [slip.id], update)
- if contract:
- for slip in self.browse(cr, uid, ids):
- basic_before_leaves = basic
+ for slip in self.browse(cr, uid, ids):
- working_day = 0
- off_days = 0
- dates = prev_bounds(slip.date)
-
- days_arr = [0, 1, 2, 3, 4, 5, 6]
- for dy in range(contract.working_days_per_week, 7):
- off_days += get_days(1, dates[1].day, dates[1].month, dates[1].year, days_arr[dy])
+ if not slip.contract_id :
+ continue
- total_off = off_days
- working_day = dates[1].day - total_off
- perday = slip.net / working_day
-
- total = 0.0
- leave = 0.0
-
- leave_ids = self._get_leaves(cr, uid, slip, slip.employee_id, context)
-
- total_leave = 0.0
- paid_leave = 0.0
- for hday in holiday_pool.browse(cr, uid, leave_ids):
- res = {
- 'slip_id':slip.id,
- 'name':hday.holiday_status_id.name + '-%s' % (hday.number_of_days),
- 'code':hday.holiday_status_id.code,
- 'amount_type':'fix',
- 'category_id':hday.holiday_status_id.head_id.id,
- 'account_id':hday.holiday_status_id.account_id.id,
- 'analytic_account_id':hday.holiday_status_id.analytic_account_id.id
- }
-
- days = hday.number_of_days
- if hday.number_of_days < 0:
- days = hday.number_of_days * -1
-
- total_leave += days
- if hday.holiday_status_id.type == 'paid':
- paid_leave += days
- continue
-
- elif hday.holiday_status_id.type == 'halfpaid':
- paid_leave += (days / 2)
- res['name'] = hday.holiday_status_id.name + '-%s/2' % (days)
- res['amount'] = perday * (days/2)
- total += perday * (days/2)
- leave += days / 2
- res['type'] = 'deduction'
- else:
- res['name'] = hday.holiday_status_id.name + '-%s' % (days)
- res['amount'] = perday * days
- res['type'] = 'deduction'
- leave += days
- total += perday * days
-
- slip_line_pool.create(cr, uid, res)
- basic = basic - total
- leaves = total
+ basic_before_leaves = slip.basic
- update.update({
- 'basic_before_leaves': round(basic_before_leaves),
- 'leaves':total,
- 'holiday_days':leave,
- 'worked_days':working_day - leave,
- 'working_days':working_day,
- })
- self.write(cr, uid, [slip.id], update)
+ working_day = 0
+ off_days = 0
+ dates = prev_bounds(slip.date)
+
+ days_arr = [0, 1, 2, 3, 4, 5, 6]
+ for dy in range(contract.working_days_per_week, 7):
+ off_days += get_days(1, dates[1].day, dates[1].month, dates[1].year, days_arr[dy])
+
+ total_off = off_days
+ working_day = dates[1].day - total_off
+ perday = slip.net / working_day
+
+ total = 0.0
+ leave = 0.0
+
+ leave_ids = self._get_leaves(cr, uid, slip, slip.employee_id, context)
+
+ total_leave = 0.0
+ paid_leave = 0.0
+ for hday in holiday_pool.browse(cr, uid, leave_ids):
+ res = {
+ 'slip_id':slip.id,
+ 'name':hday.holiday_status_id.name + '-%s' % (hday.number_of_days),
+ 'code':hday.holiday_status_id.code,
+ 'amount_type':'fix',
+ 'category_id':hday.holiday_status_id.head_id.id,
+ 'account_id':hday.holiday_status_id.account_id.id,
+ 'analytic_account_id':hday.holiday_status_id.analytic_account_id.id
+ }
+ days = hday.number_of_days
+ if hday.number_of_days < 0:
+ days = hday.number_of_days * -1
+
+ total_leave += days
+ if hday.holiday_status_id.type == 'paid':
+ paid_leave += days
+ continue
+
+ elif hday.holiday_status_id.type == 'halfpaid':
+ paid_leave += (days / 2)
+ res['name'] = hday.holiday_status_id.name + '-%s/2' % (days)
+ res['amount'] = perday * (days/2)
+ total += perday * (days/2)
+ leave += days / 2
+ res['type'] = 'deduction'
+ else:
+ res['name'] = hday.holiday_status_id.name + '-%s' % (days)
+ res['amount'] = perday * days
+ res['type'] = 'deduction'
+ leave += days
+ total += perday * days
+
+ slip_line_pool.create(cr, uid, res)
+ basic = basic - total
+ leaves = total
+
+ update.update({
+ 'basic_before_leaves': round(basic_before_leaves),
+ 'leaves':total,
+ 'holiday_days':leave,
+ 'worked_days':working_day - leave,
+ 'working_days':working_day,
+ })
+ self.write(cr, uid, [slip.id], update)
+
return True
hr_payslip()
+class account_move_link_slip(osv.osv):
+ '''
+ Account Move Link to Pay Slip
+ '''
+ _name = 'hr.payslip.account.move'
+ _description = 'Account Move Link to Pay Slip'
+ _columns = {
+ 'name':fields.char('Name', size=256, required=True, readonly=False),
+ 'move_id':fields.many2one('account.move', 'Expanse Entries', required=False, readonly=True),
+ 'slip_id':fields.many2one('hr.payslip', 'Pay Slip', required=False),
+ 'sequence': fields.integer('Sequence'),
+ }
+account_move_link_slip()
+
class line_condition(osv.osv):
'''
Line Condition
@@ -1153,6 +1697,27 @@ class hr_payslip_line(osv.osv):
_name = 'hr.payslip.line'
_description = 'Payslip Line'
+# def _calculate(self, cr, uid, ids, field_names, arg, context):
+# res = {}
+# obj = {}
+# for line in self.browse(cr, uid, ids, context):
+# obj['basic'] = line.slip_id.basic
+# amount = 0.0
+#
+# if line.amount_type == 'per' and line.base:
+# print 'XXXXXXXXXXXXXXXX : ', obj
+# amount = line.amount * eval(line.base, obj)
+# elif line.amount_type in ('fix', 'func'):
+# amount = line.amount
+
+# cd = line.category_id.code.lower()
+# obj[cd] = amount
+# print 'XXXXXXXXXXXXXXXXXX : ', cd
+#
+# res[line.id] = amount
+# print 'XXXXXXXXXXXX : ', obj
+# return res
+
def onchange_category(self, cr, uid, ids, category_id):
seq = 0
res = {
@@ -1264,7 +1829,7 @@ class hr_employee(osv.osv):
'esi_account':fields.char('ESI Account', size=64, required=False, readonly=False),
'hospital_id':fields.many2one('res.partner.address', 'ESI Hospital', required=False),
'passport_id':fields.many2one('hr.passport', 'Passport', required=False),
- 'bank_account_id':fields.many2one('res.partner.bank', 'Bank Account', required=False),
+ 'otherid':fields.char('Other Id', size=64, required=False),
'line_ids':fields.one2many('hr.payslip.line', 'employee_id', 'Salary Structure', required=False),
'slip_ids':fields.one2many('hr.payslip', 'employee_id', 'Payslips', required=False, readonly=True),
'property_bank_account': fields.property(
@@ -1277,7 +1842,7 @@ class hr_employee(osv.osv):
help="Select Bank Account from where Salary Expanse will be Paid",
required=True),
'salary_account':fields.property(
- 'account.account',
+ 'account.account',
type='many2one',
relation='account.account',
string="Salary Account",
diff --git a/addons/hr_payroll/hr_payroll_data.xml b/addons/hr_payroll/hr_payroll_data.xml
index 0a6e0f1afbb..80a66722efc 100644
--- a/addons/hr_payroll/hr_payroll_data.xml
+++ b/addons/hr_payroll/hr_payroll_data.xml
@@ -1,16 +1,7 @@
-
-
- Monthly Basic Wage
-
- basic
- 1.80
-
-
-
-
+
HRA
allowance
House Rant Allowance
@@ -117,6 +108,5 @@
allowance
Other Taxable Allowance
-
diff --git a/addons/hr_payroll/hr_payroll_view.xml b/addons/hr_payroll/hr_payroll_view.xml
index dcc6087ace5..46d15839b3c 100644
--- a/addons/hr_payroll/hr_payroll_view.xml
+++ b/addons/hr_payroll/hr_payroll_view.xml
@@ -131,7 +131,7 @@
-
+
@@ -458,8 +458,23 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -469,26 +484,59 @@
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ hr.payslip.select
+ hr.payslip
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Employee Payslip
hr.payslip
form
+
@@ -505,22 +553,14 @@
-
-
-
-
-
-
-
+
+
+
-
-
-
-
diff --git a/addons/hr_payroll/hr_payroll_wizard.xml b/addons/hr_payroll/hr_payroll_wizard.xml
index acc1646a8b5..fe0264257e3 100644
--- a/addons/hr_payroll/hr_payroll_wizard.xml
+++ b/addons/hr_payroll/hr_payroll_wizard.xml
@@ -1,40 +1,40 @@
-
+
+ string="Salary Register"/>
+ string="Employee Salary Statement"/>
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/hr_payroll/hr_payroll_workflow.xml b/addons/hr_payroll/hr_payroll_workflow.xml
index f494975a1b1..0e5ccfe091f 100644
--- a/addons/hr_payroll/hr_payroll_workflow.xml
+++ b/addons/hr_payroll/hr_payroll_workflow.xml
@@ -28,6 +28,13 @@
function
+
+
+ account_check
+ account_check_sheet()
+ function
+
+
confirm
@@ -59,13 +66,27 @@
+ basic>=10000
+ verify_sheet
+
+
+
+
+
+ verify_twice_sheet
+
+
+
+
+
+ basic<10000
verify_sheet
-
+
- verify_twice_sheet
+ final_verify_sheet
@@ -86,6 +107,12 @@
cancel_sheet
+
+
+
+ cancel_sheet
+
+
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
index cf23ae129cd..bab9e1ff8e5 100644
--- 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
@@ -30,7 +30,7 @@
new
-
+
\ No newline at end of file
diff --git a/addons/knowledge/__openerp__.py b/addons/knowledge/__openerp__.py
index f26f7ea2560..05b1119c4a4 100644
--- a/addons/knowledge/__openerp__.py
+++ b/addons/knowledge/__openerp__.py
@@ -32,6 +32,7 @@
'update_xml': [
'security/ir.model.access.csv',
'knowledge_installer.xml',
+ 'knowledge_view.xml',
],
'demo_xml': [],
'installable': True,
diff --git a/addons/knowledge/knowledge_view.xml b/addons/knowledge/knowledge_view.xml
new file mode 100644
index 00000000000..9739450006f
--- /dev/null
+++ b/addons/knowledge/knowledge_view.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
diff --git a/addons/l10n_be/wizard/l10_be_partner_vat_listing.py b/addons/l10n_be/wizard/l10_be_partner_vat_listing.py
index 51267636403..415db0ba067 100644
--- a/addons/l10n_be/wizard/l10_be_partner_vat_listing.py
+++ b/addons/l10n_be/wizard/l10_be_partner_vat_listing.py
@@ -62,7 +62,6 @@ class partner_vat(osv.osv_memory):
obj_vat_lclient = self.pool.get('vat.listing.clients')
obj_model_data = self.pool.get('ir.model.data')
data = self.read(cursor, user, ids)[0]
- context['test_xml'] = data['test_xml']
period = obj_period.search(cursor, user, [('fiscalyear_id', '=', data['fyear'])], context=context)
p_id_list = obj_partner.search(cursor, user, [('vat_subjected', '!=', False)], context=context)
if not p_id_list:
@@ -197,7 +196,7 @@ class partner_vat_list(osv.osv_memory):
data_file = '\n'
data_file += '\n\n\t\n\t\t'+str(company_vat)+' \n\t\t'+tools.ustr(obj_cmpny.name)+' \n\t\t'+ tools.ustr(street) +' \n\t\t'+ tools.ustr(zip_city) +' '
@@ -226,7 +225,7 @@ class partner_vat_list(osv.osv_memory):
seq +=1
sum_tax +=line['amount']
sum_turnover +=line['turnover']
- data_clientinfo +='\n\n\t\n\t\t'+str(line['vat']) +' \n\t\t'+tools.ustr(line['country']) +' \n\t \n\t'+str(int(line['amount'] * 100)) +' \n\t'+str(int(line['turnover'] * 100)) +' \n '
+ data_clientinfo +='\n\n\t\n\t\t'+line['vat'] +' \n\t\t'+tools.ustr(line['country']) +' \n\t \n\t'+str(int(line['amount'] * 100)) +' \n\t'+str(int(line['turnover'] * 100)) +' \n '
data_decl ='\n '
data_file += tools.ustr(data_decl) + tools.ustr(data_comp) + tools.ustr(data_period) + tools.ustr(data_clientinfo) + '\n '
diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py
index 15744987ec8..cdd1c61ee67 100644
--- a/addons/mail_gateway/mail_gateway.py
+++ b/addons/mail_gateway/mail_gateway.py
@@ -127,7 +127,7 @@ class mailgate_thread(osv.osv):
'message_id': message_id,
'attachment_ids': [(6, 0, attachments)]
}
- res = obj.create(cr, uid, data, context)
+ obj.create(cr, uid, data, context)
return True
mailgate_thread()
@@ -139,25 +139,33 @@ class mailgate_message(osv.osv):
_description = 'Mailgateway Message'
_order = 'id desc'
_columns = {
- 'name':fields.char('Subject', size=128),
- 'model': fields.char('Object Name', size=128),
- 'res_id': fields.integer('Resource ID'),
+ 'name':fields.char('Subject', size=128),
+ 'model': fields.char('Object Name', size=128, select=1),
+ 'res_id': fields.integer('Resource ID', select=1),
'ref_id': fields.char('Reference Id', size=256, readonly=True, help="Message Id in Email Server.", select=True),
- 'date': fields.datetime('Date'),
+ 'date': fields.datetime('Date'),
'history': fields.boolean('Is History?'),
- 'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
- 'message': fields.text('Description'),
- 'email_from': fields.char('Email From', size=84),
- 'email_to': fields.char('Email To', size=84),
- 'email_cc': fields.char('Email CC', size=84),
- 'email_bcc': fields.char('Email BCC', size=84),
+ 'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
+ 'message': fields.text('Description'),
+ 'email_from': fields.char('Email From', size=84),
+ 'email_to': fields.char('Email To', size=84),
+ 'email_cc': fields.char('Email CC', size=84),
+ 'email_bcc': fields.char('Email BCC', size=84),
'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email.", select=True),
'references': fields.text('References', readonly=True, help="Referencess emails."),
- 'description': fields.text('Description'),
- 'partner_id': fields.many2one('res.partner', 'Partner', required=False),
- 'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
+ 'description': fields.text('Description'),
+ 'partner_id': fields.many2one('res.partner', 'Partner', required=False),
+ 'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
}
+ def init(self, cr):
+ cr.execute("""SELECT indexname
+ FROM pg_indexes
+ WHERE indexname = 'mailgate_message_res_id_model_idx'""")
+ if not cr.fetchone():
+ cr.execute("""CREATE INDEX mailgate_message_res_id_model_idx
+ ON mailgate_message (model, res_id)""")
+
mailgate_message()
class mailgate_tool(osv.osv_memory):
@@ -214,7 +222,7 @@ class mailgate_tool(osv.osv_memory):
'user_id': uid,
'attachment_ids': [(6, 0, attach)]
}
- msg_id = msg_pool.create(cr, uid, msg_data, context=context)
+ msg_pool.create(cr, uid, msg_data, context=context)
return True
def email_forward(self, cr, uid, model, res_ids, msg, email_error=False, context=None):
@@ -262,6 +270,7 @@ class mailgate_tool(osv.osv_memory):
res_id = False
# Create New Record into particular model
def create_record(msg):
+ att_ids = []
if hasattr(model_pool, 'message_new'):
res_id = model_pool.message_new(cr, uid, msg, context)
else:
@@ -276,7 +285,6 @@ class mailgate_tool(osv.osv_memory):
data.update(self.get_partner(cr, uid, msg.get('from'), context=context))
res_id = model_pool.create(cr, uid, data, context=context)
- att_ids = []
if attach:
for attachment in msg.get('attachments', []):
data_attach = {
@@ -289,7 +297,7 @@ class mailgate_tool(osv.osv_memory):
}
att_ids.append(self.pool.get('ir.attachment').create(cr, uid, data_attach))
- return res_id
+ return res_id, att_ids
# Warning: message_from_string doesn't always work correctly on unicode,
# we must use utf-8 strings here :-(
@@ -346,7 +354,6 @@ class mailgate_tool(osv.osv_memory):
attachments = {}
if msg_txt.is_multipart() or 'multipart/alternative' in msg.get('content-type', ''):
body = ""
- counter = 1
for part in msg_txt.walk():
if part.get_content_maintype() == 'multipart':
continue
@@ -362,22 +369,23 @@ class mailgate_tool(osv.osv_memory):
if encoding:
content = unicode(content, encoding)
if part.get_content_subtype() == 'html':
- body = tools.html2plaintext(content)
+ body = tools.ustr(tools.html2plaintext(content))
elif part.get_content_subtype() == 'plain':
- body = content
- elif part.get_content_maintype()=='application' or part.get_content_maintype()=='image' or part.get_content_maintype()=='text':
+ body = tools.ustr(content)
+ elif part.get_content_maintype() in ('application', 'image', 'text'):
filename = part.get_filename();
if filename :
attachments[filename] = part.get_payload(decode=True)
else:
res = part.get_payload(decode=True)
if encoding:
- res = tools.ustr(res)
+ res = tools.ustr(res, encoding)
body += res
msg['body'] = body
msg['attachments'] = attachments
res_ids = []
+ attachment_ids = []
new_res_id = False
if msg.get('references'):
references = msg.get('references')
@@ -404,7 +412,7 @@ class mailgate_tool(osv.osv_memory):
model_pool.message_update(cr, uid, [res_id], vals, msg, context=context)
if not len(res_ids):
- new_res_id = create_record(msg)
+ new_res_id, attachment_ids = create_record(msg)
res_ids = [new_res_id]
# Store messages
context.update({'model' : model})
@@ -416,10 +424,10 @@ class mailgate_tool(osv.osv_memory):
email_from = msg.get('from'),
message_id = msg.get('message-id'),
references = msg.get('references', False),
- attach = msg.get('attachments', {}).items(),
+ attach = attachments.items(),
context = context)
else:
- self.history(cr, uid, model, res_ids, msg, att_ids, context=context)
+ self.history(cr, uid, model, res_ids, msg, attachment_ids, context=context)
self.email_forward(cr, uid, model, res_ids, msg_txt)
return new_res_id
diff --git a/addons/partner_geo_assign/partner_geo_assign.py b/addons/partner_geo_assign/partner_geo_assign.py
index 2407268fbcf..97bca0b1073 100644
--- a/addons/partner_geo_assign/partner_geo_assign.py
+++ b/addons/partner_geo_assign/partner_geo_assign.py
@@ -26,16 +26,20 @@ import random, time
from tools.translate import _
def geo_find(addr):
- import urllib,re
- regex = '([+-]?[0-9\.]+),([+-]?[0-9\.]+),([+-]?[0-9\.]+) '
- url = 'http://maps.google.com/maps/geo?q=' + urllib.quote(addr) + '&output=xml&oe=utf8&sensor=false'
- xml = urllib.urlopen(url).read()
- if '' in xml:
- return None
- result = re.search(regex, xml, re.M|re.I)
- if not result:
- return None
- return float(result.group(1)),float(result.group(2))
+ try:
+ regex = '([+-]?[0-9\.]+),([+-]?[0-9\.]+),([+-]?[0-9\.]+) '
+ url = 'http://maps.google.com/maps/geo?q=' + urllib.quote(addr) + '&output=xml&oe=utf8&sensor=false'
+ xml = urllib.urlopen(url).read()
+ if '' in xml:
+ return None
+ result = re.search(regex, xml, re.M|re.I)
+ if not result:
+ return None
+ return float(result.group(1)),float(result.group(2))
+ except Exception, e:
+ raise osv.except_osv(_('Network error'),
+ _('Could not contact geolocation servers, please make sure you have a working internet connection (%s)') % e)
+
class res_partner(osv.osv):
_inherit = "res.partner"
@@ -50,7 +54,6 @@ class res_partner(osv.osv):
'partner_weight': lambda *args: 0
}
def geo_localize(self, cr, uid, ids, context=None):
- regex = '([+-]?[0-9\.]+),([+-]?[0-9\.]+),([+-]?[0-9\.]+) '
for partner in self.browse(cr, uid, ids, context=context):
if not partner.address:
continue
@@ -84,12 +87,16 @@ class crm_lead(osv.osv):
email = lead.partner_assigned_id.address[0].email
if not email:
raise osv.except_osv(_('Error !'), _('No email on the partner assigned to this opportunity'))
- forward = fobj.create(cr, uid, {
- 'name': 'email',
+
+ values = fobj.default_get(cr, uid, ['name', 'email_from'], context=context)
+ if not values.get('email_from'):
+ raise osv.except_osv(_('Error !'), _('Please set an email address in your user preferences'))
+ values.update({
'history': 'whole',
'email_to': email,
- 'message': fobj._get_case_history(cr, uid, 'whole', lead.id, context) or False
- }, context)
+ 'message': fobj._get_case_history(cr, uid, 'whole', lead.id, context) or False,
+ })
+ forward = fobj.create(cr, uid, values, context)
fobj.action_forward(cr, uid, [forward], context)
else:
raise osv.except_osv(_('Error !'), _('No partner assigned to this opportunity'))
diff --git a/addons/partner_geo_assign/res_partner_view.xml b/addons/partner_geo_assign/res_partner_view.xml
index b8faedab0aa..26322f23495 100644
--- a/addons/partner_geo_assign/res_partner_view.xml
+++ b/addons/partner_geo_assign/res_partner_view.xml
@@ -1,7 +1,6 @@
-
crm.lead.geo_assign.inherit
crm.lead
@@ -9,7 +8,7 @@
-
+
@@ -36,7 +35,7 @@
-
+
-
-
+
+
@@ -95,8 +95,8 @@
-
-
+
+
diff --git a/addons/point_of_sale/report/pos_invoice.py b/addons/point_of_sale/report/pos_invoice.py
index eb59548758c..ee905ed74bf 100644
--- a/addons/point_of_sale/report/pos_invoice.py
+++ b/addons/point_of_sale/report/pos_invoice.py
@@ -35,19 +35,19 @@ class pos_invoice(report_sxw.rml_parse):
})
- def set_context(self, order, data, ids, report_type=None):
- super(pos_invoice, self).set_context(order, data, ids, report_type)
+ def set_context(self, objects, data, ids, report_type=None):
+ super(pos_invoice, self).set_context(objects, data, ids, report_type)
iids = []
nids = []
+ for order in objects:
+ order.write({'nb_print': order.nb_print + 1})
- order.write({'nb_print': order.nb_print + 1})
-
- if order.invoice_id and order.invoice_id not in iids:
- if not order.invoice_id:
- raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.'))
- iids.append(order.invoice_id)
- nids.append(order.invoice_id.id)
+ if order.invoice_id and order.invoice_id not in iids:
+ if not order.invoice_id:
+ raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.'))
+ iids.append(order.invoice_id)
+ nids.append(order.invoice_id.id)
self.cr.commit()
data['ids'] = nids
self.datas = data
diff --git a/addons/point_of_sale/statement_view.xml b/addons/point_of_sale/statement_view.xml
index cb9a7a9ce03..65b5fb419d6 100644
--- a/addons/point_of_sale/statement_view.xml
+++ b/addons/point_of_sale/statement_view.xml
@@ -34,7 +34,7 @@
-
+
@@ -109,10 +109,10 @@
-
-
-
-
+
+
+
+
@@ -172,10 +172,10 @@
-
-
-
-
+
+
+
+
@@ -301,11 +301,10 @@
-
-
-
-
-
+
+
+
+
diff --git a/addons/procurement/company.py b/addons/procurement/company.py
index f6d1e69d122..ce39ca9a684 100644
--- a/addons/procurement/company.py
+++ b/addons/procurement/company.py
@@ -28,11 +28,11 @@ class company(osv.osv):
help="This is the time frame analysed by the scheduler when "\
"computing procurements. All procurements that are not between "\
"today and today+range are skipped for futur computation."),
- }
+ }
_defaults = {
- 'schedule_range': 80.0,
- }
-
+ 'schedule_range': lambda *a: 80.0,
+ }
company()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index 45db8854e0d..d10cc89234c 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -464,7 +464,7 @@ class stock_warehouse_orderpoint(osv.osv):
"""
_name = "stock.warehouse.orderpoint"
_description = "Minimum Inventory Rule"
-
+
_columns = {
'name': fields.char('Name', size=32, required=True),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the orderpoint without removing it."),
@@ -485,17 +485,17 @@ class stock_warehouse_orderpoint(osv.osv):
'company_id': fields.many2one('res.company','Company',required=True),
}
_defaults = {
- 'active': 1,
- 'logic': 'max',
- 'qty_multiple': 1,
+ 'active': lambda *a: 1,
+ 'logic': lambda *a: 'max',
+ 'qty_multiple': lambda *a: 1,
'name': lambda x,y,z,c: x.pool.get('ir.sequence').get(y,z,'stock.orderpoint') or '',
'product_uom': lambda sel, cr, uid, context: context.get('product_uom', False),
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.warehouse.orderpoint', context=c)
}
_sql_constraints = [
('qty_multiple_check', 'CHECK( qty_multiple > 0 )', _('Qty Multiple must be greater than zero.')),
- ]
-
+ ]
+
def onchange_warehouse_id(self, cr, uid, ids, warehouse_id, context={}):
""" Finds location id for changed warehouse.
@param warehouse_id: Changed id of warehouse.
@@ -506,7 +506,7 @@ class stock_warehouse_orderpoint(osv.osv):
v = {'location_id': w.lot_stock_id.id}
return {'value': v}
return {}
-
+
def onchange_product_id(self, cr, uid, ids, product_id, context={}):
""" Finds UoM for changed product.
@param product_id: Changed id of product.
@@ -517,7 +517,7 @@ class stock_warehouse_orderpoint(osv.osv):
v = {'product_uom': prod.uom_id.id}
return {'value': v}
return {}
-
+
def copy(self, cr, uid, id, default=None,context={}):
if not default:
default = {}
@@ -525,6 +525,6 @@ class stock_warehouse_orderpoint(osv.osv):
'name': self.pool.get('ir.sequence').get(cr, uid, 'stock.orderpoint') or '',
})
return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context)
-
+
stock_warehouse_orderpoint()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index 66725547aec..e517f289809 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -58,7 +58,7 @@
-
+
diff --git a/addons/procurement/schedulers.py b/addons/procurement/schedulers.py
index dc66d9e3e8b..bdc37c1b660 100644
--- a/addons/procurement/schedulers.py
+++ b/addons/procurement/schedulers.py
@@ -19,12 +19,12 @@
#
##############################################################################
-import time
-from mx import DateTime
-
from osv import osv
import netsvc
import pooler
+from mx import DateTime
+import time
+
class procurement_order(osv.osv):
_inherit = 'procurement.order'
@@ -37,7 +37,9 @@ class procurement_order(osv.osv):
context = {}
if use_new_cursor:
+ print 'Cursor New', cr,
cr = pooler.get_db(use_new_cursor).cursor()
+ print cr
wf_service = netsvc.LocalService("workflow")
procurement_obj = self.pool.get('procurement.order')
@@ -122,6 +124,7 @@ class procurement_order(osv.osv):
})
if use_new_cursor:
cr.commit()
+ print 'Cursor Close', cr
cr.close()
return {}
@@ -172,7 +175,9 @@ class procurement_order(osv.osv):
if not context:
context = {}
if use_new_cursor:
+ print 'Cursor New', cr,
cr = pooler.get_db(use_new_cursor).cursor()
+ print cr
orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
location_obj = self.pool.get('stock.location')
procurement_obj = self.pool.get('procurement.order')
@@ -196,7 +201,7 @@ class procurement_order(osv.osv):
qty = max(op.product_min_qty, op.product_max_qty)-prods
reste = qty % op.qty_multiple
if reste > 0:
- qty += op.qty_multiple - reste
+ qty += op.qty_multiple - reste
newdate = DateTime.now() + DateTime.RelativeDateTime(
days = int(op.product_id.seller_delay))
if op.product_id.supply_method == 'buy':
@@ -236,9 +241,9 @@ class procurement_order(osv.osv):
})
if use_new_cursor:
cr.commit()
+ print 'Cursor Close', cr
cr.close()
return {}
-
procurement_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/procurement/security/ir.model.access.csv b/addons/procurement/security/ir.model.access.csv
index d86612dc33f..8eeaefb3bd6 100644
--- a/addons/procurement/security/ir.model.access.csv
+++ b/addons/procurement/security/ir.model.access.csv
@@ -1,12 +1,7 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_mrp_property_group","mrp.property.group","model_mrp_property_group","stock.group_stock_manager",1,1,1,1
-"access_mrp_property","mrp.property","model_mrp_property","stock.group_stock_manager",1,1,1,1
+"access_mrp_property_group","mrp.property.group","model_mrp_property_group",stock.group_stock_manager,1,1,1,1
+"access_mrp_property","mrp.property","model_mrp_property",stock.group_stock_manager,1,1,1,1
"access_mrp_property_group","mrp.property.group","model_mrp_property_group",,1,0,0,0
-"access_mrp_property","mrp.property","model_mrp_property","base.group_user",1,0,0,0
-"access_procurement","procurement.order","model_procurement_order","base.group_user",1,0,0,0
-"access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint","stock.group_stock_manager",1,1,1,1
-"access_procurement_compute_all","procurement.order.compute.all","model_procurement_order_compute_all","stock.group_stock_manager",1,1,1,1
-"access_procurement_orderpoint_compute","procurement.orderpoint.compute","model_procurement_orderpoint_compute","stock.group_stock_manager",1,1,1,1
-"access_mrp_make_procurement","make.procurement","model_make_procurement","stock.group_stock_manager",1,1,1,1
-"access_mrp_make_procurement","procurement.order.compute","model_procurement_order_compute","stock.group_stock_manager",1,1,1,1
-"access_make_procurement","make.procurement","model_make_procurement","stock.group_stock_manager",1,1,1,1
+"access_mrp_property","mrp.property","model_mrp_property",base.group_user,1,0,0,0
+"access_procurement","procurement.order","model_procurement_order",base.group_user,1,0,0,0
+"access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint",stock.group_stock_manager,1,1,1,1
diff --git a/addons/procurement/wizard/orderpoint_procurement.py b/addons/procurement/wizard/orderpoint_procurement.py
index cec7d13554d..ee3207833d3 100644
--- a/addons/procurement/wizard/orderpoint_procurement.py
+++ b/addons/procurement/wizard/orderpoint_procurement.py
@@ -30,36 +30,36 @@ from osv import fields,osv
class procurement_compute(osv.osv_memory):
_name = 'procurement.orderpoint.compute'
_description = 'Automatic Order Point'
-
+
_columns = {
- 'automatic': fields.boolean('Automatic Orderpoint', help='If the stock of a product is under 0, it will act like an orderpoint'),
+ 'automatic': fields.boolean('Automatic Orderpoint', help='If the stock of a product is under 0, it will act like an orderpoint'),
}
_defaults = {
- 'automatic': False,
+ 'automatic' : lambda *a: False,
}
-
+
def _procure_calculation_orderpoint(self, cr, uid, ids, context):
- """
+ """
@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
- """
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+ """
proc_obj = self.pool.get('procurement.order')
for proc in self.browse(cr, uid, ids):
proc_obj._procure_orderpoint_confirm(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname, context=context)
-
+
return {}
-
+
def procure_calculation(self, cr, uid, ids, context):
- """
+ """
@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
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
"""
threaded_calculation = threading.Thread(target=self._procure_calculation_orderpoint, args=(cr, uid, ids, context))
threaded_calculation.start()
diff --git a/addons/procurement/wizard/schedulers_all.py b/addons/procurement/wizard/schedulers_all.py
index 9b2ac6d59b8..73efc77d017 100644
--- a/addons/procurement/wizard/schedulers_all.py
+++ b/addons/procurement/wizard/schedulers_all.py
@@ -26,41 +26,45 @@ from osv import osv, fields
class procurement_compute_all(osv.osv_memory):
_name = 'procurement.order.compute.all'
_description = 'Compute all schedulers'
-
+
_columns = {
'automatic': fields.boolean('Automatic orderpoint',help='Triggers an automatic procurement for all products that have a virtual stock under 0. You should probably not use this option, we suggest using a MTO configuration on products.'),
}
-
+
_defaults ={
'automatic': lambda *a: False,
}
-
+
def _procure_calculation_all(self, cr, uid, ids, context):
- """
+ """
@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
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
"""
proc_obj = self.pool.get('procurement.order')
for proc in self.browse(cr, uid, ids):
+ print 'Cursor', cr
proc_obj.run_scheduler(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname,\
context=context)
+ print 'Cursor', cr
return {}
def procure_calculation(self, cr, uid, ids, context):
- """
+ """
@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
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
"""
threaded_calculation = threading.Thread(target=self._procure_calculation_all, args=(cr, uid, ids, context))
threaded_calculation.start()
return {}
-
+
procurement_compute_all()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/product/security/ir.model.access.csv b/addons/product/security/ir.model.access.csv
index 1c66711a122..f1c24509ac9 100644
--- a/addons/product/security/ir.model.access.csv
+++ b/addons/product/security/ir.model.access.csv
@@ -28,5 +28,4 @@
"access_product_pricelist_item_user","product.pricelist.item.user","model_product_pricelist_item","base.group_user",1,0,0,0
"access_product_pricelist_type_partner_manager","product.pricelist.type partner manager","model_product_pricelist_type","base.group_partner_manager",1,0,0,0
"access_product_pricelist_partner_manager","product.pricelist partner manager","model_product_pricelist","base.group_partner_manager",1,0,0,0
-"access_ir_property_group_product_manager","ir_property group_product_manager","base.model_ir_property","product.group_product_manager",1,1,1,1
-"access_product_price_list","product.price_list","model_product_price_list","base.group_user",1,0,0,0
+"access_ir_property_group_product_manager","ir_property group_product_manager","base.model_ir_property",product.group_product_manager,1,1,1,1
diff --git a/addons/product_margin/__openerp__.py b/addons/product_margin/__openerp__.py
index e80f14ae490..7607c499add 100644
--- a/addons/product_margin/__openerp__.py
+++ b/addons/product_margin/__openerp__.py
@@ -31,10 +31,7 @@ the report has several options to help you get the data you need.
""",
'author': 'Tiny',
'depends': ['base', 'product', 'account'],
- 'update_xml': [
- 'security/ir.model.access.csv',
- 'wizard/product_margin_view.xml',
- 'product_margin_view.xml'],
+ 'update_xml': ['wizard/product_margin_view.xml','product_margin_view.xml'],
'demo_xml': [],
'installable': True,
'active': False,
diff --git a/addons/product_margin/product_margin.py b/addons/product_margin/product_margin.py
index b5421d3798c..b70733ee992 100644
--- a/addons/product_margin/product_margin.py
+++ b/addons/product_margin/product_margin.py
@@ -42,7 +42,7 @@ class product_product(osv.osv):
invoice_types=()
states=()
if invoice_state=='paid':
- states=('paid',)
+ states=('paid')
elif invoice_state=='open_paid':
states=('open','paid')
elif invoice_state=='draft_open_paid':
diff --git a/addons/product_visible_discount/product.py b/addons/product_visible_discount/product.py
index 53c6446c57e..e81dac8668e 100644
--- a/addons/product_visible_discount/product.py
+++ b/addons/product_visible_discount/product.py
@@ -46,25 +46,6 @@ class sale_order_line(osv.osv):
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
lang=False, update_tax=True,date_order=False,packaging=False,fiscal_position=False, flag=False):
- def get_real_price(res_dict, product_id, pricelist):
- item_obj = self.pool.get('product.pricelist.item')
- price_type_obj = self.pool.get('product.price.type')
- product_obj = self.pool.get('product.product')
- template_obj = self.pool.get('product.template')
- field_name = 'list_price'
-
- if res_dict.get('item_id',False) and res_dict['item_id'].get(pricelist,False):
- item = res_dict['item_id'].get(pricelist,False)
- item_base = item_obj.read(cr, uid, [item], ['base'])[0]['base']
- if item_base > 0:
- field_name = price_type_obj.browse(cr, uid, item_base).field
-
- product_tmpl_id = product_obj.browse(cr, uid, product_id, context).product_tmpl_id.id
-
- product_read = template_obj.read(cr, uid, product_tmpl_id, [field_name], context)
- return product_read[field_name]
-
-
res=super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty,
uom, qty_uos, uos, name, partner_id,
lang, update_tax,date_order,fiscal_position=fiscal_position,flag=flag)
@@ -87,16 +68,15 @@ class sale_order_line(osv.osv):
# product_read = self.pool.get('product.template').read(cr, uid, product_tmpl_id, [field_name], context)
# list_price = product_read[field_name]
list_price = pricelist_obj.price_get(cr, uid, [pricelist],
- product.id, qty or 1.0, partner_id, {'uom': uom,'date': date_order })
+ product.id, qty or 1.0, partner_id, {'uom': uom,'date': date_order })[pricelist]
- pricelists = pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
+ pricelists=pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
old_uom = product.uos_id or product.uom_id
-# new_list_price = product_uom_obj._compute_price(cr,
-# uid, old_uom.id, list_price, uom)
- new_list_price = get_real_price(list_price, product.id, pricelist)
- if(len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price[pricelist] != 0):
- discount = (new_list_price - price) / new_list_price * 100
+ new_list_price = product_uom_obj._compute_price(cr,
+ uid, old_uom.id, list_price, uom)
+ if(len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price != 0):
+ discount=(new_list_price-price) / new_list_price * 100
result['price_unit'] = new_list_price
result['discount'] = discount
else:
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 7b299cdcccc..3147e392f0d 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -518,7 +518,7 @@
-
+
-
+
+
diff --git a/addons/purchase/company.py b/addons/purchase/company.py
index 012bb2142c0..2a01605782c 100644
--- a/addons/purchase/company.py
+++ b/addons/purchase/company.py
@@ -28,9 +28,9 @@ class company(osv.osv):
help="This is the leads/security time for each purchase order."),
}
_defaults = {
- 'po_lead': 1.0,
+ 'po_lead': lambda *a: 1.0,
}
-
company()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase/partner.py b/addons/purchase/partner.py
index afd13f6829e..48d006f2c15 100644
--- a/addons/purchase/partner.py
+++ b/addons/purchase/partner.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# 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 .
#
##############################################################################
@@ -27,14 +27,17 @@ class res_partner(osv.osv):
_columns = {
'property_product_pricelist_purchase': fields.property(
'product.pricelist',
- type='many2one',
- relation='product.pricelist',
+ type='many2one',
+ relation='product.pricelist',
domain=[('type','=','purchase')],
- string="Purchase Pricelist",
+ string="Purchase Pricelist",
method=True,
view_load=True,
help="This pricelist will be used, instead of the default one, for purchases from the current partner"),
}
res_partner()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/purchase/process/purchase_process.xml b/addons/purchase/process/purchase_process.xml
index 64abc11976b..59d48d13b43 100644
--- a/addons/purchase/process/purchase_process.xml
+++ b/addons/purchase/process/purchase_process.xml
@@ -141,7 +141,7 @@
-
+
@@ -152,20 +152,7 @@
Process Transition
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -174,7 +161,6 @@
-
@@ -184,7 +170,6 @@
-
@@ -193,7 +178,6 @@
-
@@ -202,7 +186,6 @@
-
@@ -212,7 +195,6 @@
-
@@ -221,7 +203,6 @@
-
@@ -230,7 +211,6 @@
-
@@ -239,7 +219,6 @@
-
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 535c8dffe83..139082d6d75 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -20,16 +20,18 @@
##############################################################################
from mx import DateTime
+from osv import fields
+from osv import osv
import time
+import netsvc
+
+import ir
from datetime import datetime
from dateutil.relativedelta import relativedelta
-
-from osv import osv, fields
-import netsvc
-import ir
import pooler
from tools import config
from tools.translate import _
+
import decimal_precision as dp
from osv.orm import browse_record, browse_null
@@ -65,7 +67,7 @@ class purchase_order(osv.osv):
res[order.id]['amount_total']=res[order.id]['amount_untaxed'] + res[order.id]['amount_tax']
return res
- def _set_minimum_planned_date(self, cr, uid, ids, name, value, arg, context=None):
+ def _set_minimum_planned_date(self, cr, uid, ids, name, value, arg, context):
if not value: return False
if type(ids)!=type([]):
ids=[ids]
@@ -77,7 +79,7 @@ class purchase_order(osv.osv):
(date_planned=%s or date_planned<%s)""", (value,po.id,po.minimum_planned_date,value))
return True
- def _minimum_planned_date(self, cr, uid, ids, field_name, arg, context=None):
+ def _minimum_planned_date(self, cr, uid, ids, field_name, arg, context):
res={}
purchase_obj=self.browse(cr, uid, ids, context=context)
for purchase in purchase_obj:
@@ -130,7 +132,7 @@ class purchase_order(osv.osv):
res[r] = 100.0 * res[r][0] / res[r][1]
return res
- def _get_order(self, cr, uid, ids, context=None):
+ def _get_order(self, cr, uid, ids, context={}):
result = {}
for line in self.pool.get('purchase.order.line').browse(cr, uid, ids, context=context):
result[line.order_id.id] = True
@@ -146,13 +148,13 @@ class purchase_order(osv.osv):
return res
_columns = {
- 'name': fields.char('Order Reference', size=64, required=True, select=True, help="unique number of the purchase order,computed automatically when the purchase order is created"),
- 'origin': fields.char('Source Document', size=64,
+ 'name': fields.char('Order Reference', size=64, required=True, select=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}),
+ 'origin': fields.char('Source Document', size=64, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]},
help="Reference of the document that generated this purchase order request."
),
'partner_ref': fields.char('Supplier Reference', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, size=64),
'date_order':fields.date('Date Ordered', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}, help="Date on which this document has been created."),
- 'date_approve':fields.date('Date Approved', readonly=1, help="Date on which purchase order has been approved"),
+ 'date_approve':fields.date('Date Approved', readonly=1),
'partner_id':fields.many2one('res.partner', 'Supplier', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, change_default=True),
'partner_address_id':fields.many2one('res.partner.address', 'Address', required=True,
states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}),
@@ -168,11 +170,11 @@ class purchase_order(osv.osv):
'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines', states={'approved':[('readonly',True)],'done':[('readonly',True)]}),
'validator' : fields.many2one('res.users', 'Validated by', readonly=True),
'notes': fields.text('Notes'),
- 'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True, help="An invoice generated for a purchase order"),
+ 'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True),
'picking_ids': fields.one2many('stock.picking', 'purchase_id', 'Picking List', readonly=True, help="This is the list of picking list that have been generated for this purchase"),
- 'shipped':fields.boolean('Received', readonly=True, select=True, help="It indicates that a picking has been done"),
+ 'shipped':fields.boolean('Received', readonly=True, select=True),
'shipped_rate': fields.function(_shipped_rate, method=True, string='Received', type='float'),
- 'invoiced': fields.function(_invoiced, method=True, string='Invoiced & Paid', type='boolean', help="It indicates that an invoice has been paid"),
+ 'invoiced': fields.function(_invoiced, method=True, string='Invoiced & Paid', type='boolean'),
'invoiced_rate': fields.function(_invoiced_rate, method=True, string='Invoiced', type='float'),
'invoice_method': fields.selection([('manual','Manual'),('order','From Order'),('picking','From Picking')], 'Invoicing Control', required=True,
help="From Order: a draft invoice will be pre-generated based on the purchase order. The accountant " \
@@ -184,27 +186,27 @@ class purchase_order(osv.osv):
'amount_untaxed': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Purchase Price'), string='Untaxed Amount',
store={
'purchase.order.line': (_get_order, None, 10),
- }, multi="sums", help="The amount without tax"),
+ }, multi="sums"),
'amount_tax': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Purchase Price'), string='Taxes',
store={
'purchase.order.line': (_get_order, None, 10),
- }, multi="sums", help="The tax amount"),
+ }, multi="sums"),
'amount_total': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Purchase Price'), string='Total',
store={
'purchase.order.line': (_get_order, None, 10),
- }, multi="sums",help="The total amount"),
+ }, multi="sums"),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'),
'product_id': fields.related('order_line','product_id', type='many2one', relation='product.product', string='Product'),
'create_uid': fields.many2one('res.users', 'Responsible'),
'company_id': fields.many2one('res.company','Company',required=True,select=1),
}
_defaults = {
- 'date_order': time.strftime('%Y-%m-%d'),
- 'state': 'draft',
+ 'date_order': lambda *a: time.strftime('%Y-%m-%d'),
+ 'state': lambda *a: 'draft',
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'purchase.order'),
- 'shipped': 0,
- 'invoice_method': 'order',
- 'invoiced': 0,
+ 'shipped': lambda *a: 0,
+ 'invoice_method': lambda *a: 'order',
+ 'invoiced': lambda *a: 0,
'partner_address_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['default'])['default'],
'pricelist_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').browse(cr, uid, context['partner_id']).property_product_pricelist_purchase.id,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'purchase.order', context=c),
@@ -627,7 +629,6 @@ class purchase_order_line(osv.osv):
_table = 'purchase_order_line'
_name = 'purchase.order.line'
_description = 'Purchase Order Line'
-
def copy_data(self, cr, uid, id, default=None,context={}):
if not default:
default = {}
@@ -707,14 +708,12 @@ class purchase_order_line(osv.osv):
if not uom:
res['value']['price_unit'] = 0.0
return res
-
def action_confirm(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state': 'confirmed'}, context)
for (id,name) in self.name_get(cr, uid, ids):
message = _('Purchase order line') + " '" + name + "' "+ _("is confirmed")
self.log(cr, uid, id, message)
return True
-
purchase_order_line()
class procurement_order(osv.osv):
@@ -797,7 +796,7 @@ class procurement_order(osv.osv):
res[procurement.id] = purchase_id
self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': purchase_id})
return res
-
procurement_order()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 79ef45424d2..4e5bdc8a4ab 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -5,7 +5,7 @@
groups="group_purchase_user" sequence="3"/>
-
+
Addresses
@@ -169,12 +169,11 @@
-
-
-
-
+
+
-
+
+
@@ -220,7 +219,7 @@
ir.actions.act_window
purchase.order
form
- {'search_default_draft': 1,'search_default_create_uid':uid}
+ {'search_default_draft': 1,'search_create_uid':uid}
tree,form,graph,calendar
@@ -232,7 +231,7 @@
ir.actions.act_window
purchase.order
tree,form,graph,calendar
- {'search_default_approved': 1,'search_default_create_uid':uid}
+ {'search_default_approved': 1,'search_create_uid':uid}
@@ -303,15 +302,14 @@
search
-
+
-
-
+
diff --git a/addons/purchase/purchase_wizard.xml b/addons/purchase/purchase_wizard.xml
new file mode 100644
index 00000000000..d76ce1e3819
--- /dev/null
+++ b/addons/purchase/purchase_wizard.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
diff --git a/addons/purchase/security/ir.model.access.csv b/addons/purchase/security/ir.model.access.csv
index 1d5b71242ae..674b01f66e7 100644
--- a/addons/purchase/security/ir.model.access.csv
+++ b/addons/purchase/security/ir.model.access.csv
@@ -19,13 +19,10 @@
"access_product_product_purchase_user","product.product.purchase.user","product.model_product_product","group_purchase_user",1,0,0,0
"access_account_invoice_purchase","account_invoice purchase","account.model_account_invoice","group_purchase_user",1,1,1,1
"access_account_invoice_line_purchase","account_invoice.line purchase","account.model_account_invoice_line","group_purchase_user",1,1,1,1
+"access_account_invoice_tax_purchase","account_invoice.tax purchase","account.model_account_invoice_tax","group_purchase_user",1,1,1,1
"access_account_fiscal_position_purchase_user","account.fiscal.position purchase","account.model_account_fiscal_position","group_purchase_user",1,0,0,0
"access_account_sequence_fiscalyear_purchase_user","account.sequence.fiscalyear purchase","account.model_account_sequence_fiscalyear","group_purchase_user",1,1,1,1
"access_res_partner_purchase_user","res.partner purchase","base.model_res_partner","group_purchase_user",1,0,0,0
"access_res_partner_address_purchase_user","res.partner.address purchase","base.model_res_partner_address","group_purchase_user",1,0,0,0
"access_account_journal","account.journal","account.model_account_journal","purchase.group_purchase_user",1,1,1,0
"access_account_journal_manager","account.journal","account.model_account_journal","purchase.group_purchase_manager",1,1,1,1
-"access_purchase_order_line_invoice_user","purchase.order.line_invoice","model_purchase_order_line_invoice","group_purchase_user",1,0,0,0
-"access_purchase_order_line_invoice_manager","purchase.order.line_invoice","model_purchase_order_line_invoice","group_purchase_manager",1,1,1,1
-"access_purchase_installer_user","purchase.installer","model_purchase_installer","group_purchase_user",1,0,0,0
-"access_purchase_installer_manager","purchase.installer","model_purchase_installer","group_purchase_manager",1,1,1,1
diff --git a/addons/purchase/security/purchase_security.xml b/addons/purchase/security/purchase_security.xml
index 320b5d4609d..1848e9a7c61 100644
--- a/addons/purchase/security/purchase_security.xml
+++ b/addons/purchase/security/purchase_security.xml
@@ -11,14 +11,14 @@
- Purchase Order multi-company
+ Purchase Order multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
- Purchase Order Line multi-company
+ Purchase Order Line multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py
index 245da72cad8..087c9d6ddc8 100644
--- a/addons/purchase/stock.py
+++ b/addons/purchase/stock.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# 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 .
#
##############################################################################
@@ -29,7 +29,7 @@ class stock_move(osv.osv):
readonly=True),
}
_defaults = {
- 'purchase_line_id': False
+ 'purchase_line_id': lambda *a:False
}
stock_move()
diff --git a/addons/purchase/wizard/purchase_order_group.py b/addons/purchase/wizard/purchase_order_group.py
index d9778dceb47..8c4e0784a7b 100644
--- a/addons/purchase/wizard/purchase_order_group.py
+++ b/addons/purchase/wizard/purchase_order_group.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,39 +15,46 @@
# 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 time
from osv import fields, osv
+from service import web_services
import netsvc
import pooler
+import time
+import wizard
from osv.orm import browse_record, browse_null
class purchase_order_group(osv.osv_memory):
_name = "purchase.order.group"
- _description = "Purchase Order Merge"
+ _description = "Purchase Wizard"
+ _columns = {
+
+ }
def merge_orders(self, cr, uid, ids, context):
- """
+ """
To merge similar type of purchase orders.
-
+
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs
- @param context: A standard dictionary
-
+ @param ids: the ID or list of IDs
+ @param context: A standard dictionary
+
@return: purchase order view
-
- """
+
+ """
order_obj = self.pool.get('purchase.order')
mod_obj =self.pool.get('ir.model.data')
result = mod_obj._get_id(cr, uid, 'purchase', 'view_purchase_order_filter')
id = mod_obj.read(cr, uid, result, ['res_id'])
+
allorders = order_obj.do_merge(cr, uid, context.get('active_ids',[]), context)
+
return {
'domain': "[('id','in', [" + ','.join(map(str, allorders)) + "])]",
@@ -59,7 +66,5 @@ class purchase_order_group(osv.osv_memory):
'type': 'ir.actions.act_window',
'search_view_id': id['res_id']
}
-
purchase_order_group()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/purchase_analytic_plans/purchase_analytic_plans.py b/addons/purchase_analytic_plans/purchase_analytic_plans.py
index 0af2f90ba47..757868f13ed 100644
--- a/addons/purchase_analytic_plans/purchase_analytic_plans.py
+++ b/addons/purchase_analytic_plans/purchase_analytic_plans.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,15 +15,17 @@
# 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 time
-from mx import DateTime
-from osv import fields, osv
+from osv import fields
+from osv import osv
+import time
import netsvc
+
import ir
+from mx import DateTime
import pooler
from tools import config
@@ -32,7 +34,7 @@ class purchase_order_line(osv.osv):
_inherit='purchase.order.line'
_columns = {
'analytics_id':fields.many2one('account.analytic.plan.instance','Analytic Distribution'),
- }
+ }
purchase_order_line()
@@ -46,5 +48,5 @@ class purchase_order(osv.osv):
return res
purchase_order()
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/purchase_requisition/purchase_requisition.py b/addons/purchase_requisition/purchase_requisition.py
index 64ca0b312be..4a85390e6a8 100644
--- a/addons/purchase_requisition/purchase_requisition.py
+++ b/addons/purchase_requisition/purchase_requisition.py
@@ -20,11 +20,10 @@
#
##############################################################################
-import time
-
from osv import fields,osv
from osv import orm
import netsvc
+import time
from tools.translate import _
class purchase_requisition(osv.osv):
@@ -36,24 +35,24 @@ class purchase_requisition(osv.osv):
'date_start': fields.datetime('Requisition Date'),
'date_end': fields.datetime('Requisition Deadline'),
'user_id': fields.many2one('res.users', 'Responsible'),
- 'exclusive': fields.selection([('exclusive','Purchase Tender (exclusive)'),('multiple','Multiple Requisitions')],'Requisition Type', required=True, help="Purchase Tender (exclusive):On the confirmation of a purchase order, it cancels the remaining purchase order.Multiple Requisitions:It allows to have multiple purchase orders.On confirmation of a purchase order it does not cancel the remaining orders"""),
+ 'exclusive': fields.selection([('exclusive','Purchase Tender (exclusive)'),('multiple','Multiple Requisitions')],'Requisition Type', help="If the requisition is exclusive, it will cancel all purchase orders when you confirm one of them", required=True),
'description': fields.text('Description'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'purchase_ids' : fields.one2many('purchase.order','requisition_id','Purchase Orders'),
- 'line_ids' : fields.one2many('purchase.requisition.line','requisition_id','Products to Purchase',states={'done': [('readonly', True)]}),
+ 'line_ids' : fields.one2many('purchase.requisition.line','requisition_id','Products to Purchase'),
'state': fields.selection([('draft','Draft'),('in_progress','In Progress'),('cancel','Cancelled'),('done','Done')], 'State', required=True)
}
_defaults = {
- 'date_start': time.strftime('%Y-%m-%d %H:%M:%S'),
- 'state': 'draft',
- 'exclusive': 'multiple',
+ 'date_start': lambda *args: time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'state': lambda *args: 'draft',
+ 'exclusive': lambda *args: 'multiple',
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
'user_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).id ,
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'purchase.order.requisition'),
}
- def tender_cancel(self, cr, uid, ids, context=None):
+ def tender_cancel(self, cr, uid, ids, context={}):
purchase_order_obj = self.pool.get('purchase.order')
for purchase in self.browse(cr, uid, ids):
for purchase_id in purchase.purchase_ids:
@@ -62,30 +61,29 @@ class purchase_requisition(osv.osv):
self.write(cr, uid, ids, {'state': 'cancel'})
for (id,name) in self.name_get(cr, uid, ids):
message = _('Tender') + " '" + name + "' "+ _("is cancelled")
- self.log(cr, uid, id, message)
+ self.log(cr, uid, id, message)
return True
- def tender_in_progress(self, cr, uid, ids, context=None):
- for quotations in self.browse(cr, uid, ids):
- if not quotations.purchase_ids:
- raise osv.except_osv(_('Purchase order required'),('You should have atleast one purchase order line defined for this tender'))
+ def tender_in_progress(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'in_progress'} ,context=context)
for (id,name) in self.name_get(cr, uid, ids):
message = _('Tender') + " '" + name + "' "+ _(" is In Progress")
- self.log(cr, uid, id, message)
+ self.log(cr, uid, id, message)
return True
- def tender_reset(self, cr, uid, ids, context=None):
+ def tender_reset(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state': 'draft'})
for (id,name) in self.name_get(cr, uid, ids):
message = _('Tender') + " '" + name + "' "+ _("is in draft state")
- self.log(cr, uid, id, message)
+ self.log(cr, uid, id, message)
return True
- def tender_done(self, cr, uid, ids, context=None):
+ def tender_done(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
for (id,name) in self.name_get(cr, uid, ids):
message = _('Tender') + " '" + name + "' "+ _("is done")
- self.log(cr, uid, id, message)
+ self.log(cr, uid, id, message)
return True
+
+
purchase_requisition()
class purchase_requisition_line(osv.osv):
@@ -101,7 +99,7 @@ class purchase_requisition_line(osv.osv):
'requisition_id' : fields.many2one('purchase.requisition','Purchase Requisition', ondelete='cascade')
}
- def onchange_product_id(self, cr, uid, ids, product_id,product_uom_id, context=None):
+ def onchange_product_id(self, cr, uid, ids, product_id,product_uom_id, context={}):
""" Changes UoM and name if product_id changes.
@param name: Name of the field
@@ -111,7 +109,7 @@ class purchase_requisition_line(osv.osv):
value = {'product_uom_id': ''}
if product_id:
prod = self.pool.get('product.product').browse(cr, uid, [product_id])[0]
- value = {'product_uom_id': prod.uom_id.id,'product_qty':1.0}
+ value = {'product_uom_id': prod.uom_id.id}
return {'value': value}
_defaults = {
@@ -146,7 +144,7 @@ class product_product(osv.osv):
'purchase_requisition': fields.boolean('Purchase Requisition', help="Check this box so that requisitions generates purchase requisitions instead of directly requests for quotations.")
}
_defaults = {
- 'purchase_requisition': False
+ 'purchase_requisition': lambda *args: False
}
product_product()
@@ -173,5 +171,3 @@ class procurement_order(osv.osv):
})
return res
procurement_order()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/purchase_requisition/purchase_requisition_view.xml b/addons/purchase_requisition/purchase_requisition_view.xml
index 5700cc71b75..172be8c06e8 100644
--- a/addons/purchase_requisition/purchase_requisition_view.xml
+++ b/addons/purchase_requisition/purchase_requisition_view.xml
@@ -78,7 +78,7 @@
-
+
diff --git a/addons/purchase_requisition/security/ir.model.access.csv b/addons/purchase_requisition/security/ir.model.access.csv
index f2acb10d525..8ba518cea7d 100644
--- a/addons/purchase_requisition/security/ir.model.access.csv
+++ b/addons/purchase_requisition/security/ir.model.access.csv
@@ -1,4 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_purchase_requisition","purchase.requisition","model_purchase_requisition","purchase.group_purchase_user",1,0,0,0
-"access_purchase_requisition_line","purchase.requisition.line","model_purchase_requisition_line","purchase.group_purchase_user",1,0,0,0
-"access_purchase_requisition_partner","purchase.requisition.partner","model_purchase_requisition_partner","purchase.group_purchase_user",1,0,0,0
+"access_purchase_requisition","purchase.requisition","model_purchase_requisition","purchase.group_purchase_user",1,1,1,1
+"access_purchase_requisition_line","purchase.requisition.line","model_purchase_requisition_line","purchase.group_purchase_user",1,1,1,1
diff --git a/addons/purchase_requisition/wizard/purchase_requisition_partner.py b/addons/purchase_requisition/wizard/purchase_requisition_partner.py
index 9473fe11889..0327434bc55 100644
--- a/addons/purchase_requisition/wizard/purchase_requisition_partner.py
+++ b/addons/purchase_requisition/wizard/purchase_requisition_partner.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,17 +15,16 @@
# 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 time
-from mx import DateTime
-
from osv import fields, osv
from service import web_services
import netsvc
import pooler
+import time
+from mx import DateTime
from osv.orm import browse_record, browse_null
class purchase_requisition_partner(osv.osv_memory):
@@ -34,37 +33,40 @@ class purchase_requisition_partner(osv.osv_memory):
_columns = {
'partner_id': fields.many2one('res.partner', 'Partner', required=True,domain=[('supplier', '=', True)]),
'partner_address_id':fields.many2one('res.partner.address', 'Address', required=True),
- }
+ }
+
def view_init(self, cr, uid, fields_list, context=None):
res = super(purchase_requisition_partner, self).view_init(cr, uid, fields_list, context=context)
- record_id = context and context.get('active_id', False) or False
+ record_id = context and context.get('active_id', False) or False
tender = self.pool.get('purchase.requisition').browse(cr, uid, record_id)
if not tender.line_ids:
- raise osv.except_osv('Error!','No Product in Tender')
+ raise osv.except_osv('Error!','No Product in Tender')
True
def onchange_partner_id(self, cr, uid, ids, partner_id):
+ if not partner_id:
+ return {}
addr = self.pool.get('res.partner').address_get(cr, uid, [partner_id], ['default'])
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
return {'value':{'partner_address_id': addr['default']}}
-
+
def create_order(self, cr, uid, ids, context):
- """
+ """
To Create a purchase orders .
-
+
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs
- @param context: A standard dictionary
+ @param ids: the ID or list of IDs
+ @param context: A standard dictionary
@return: {}
-
- """
+
+ """
record_ids = context and context.get('active_ids', False)
if record_ids:
data = self.read(cr, uid, ids)
- company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
+ company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
order_obj = self.pool.get('purchase.order')
order_line_obj = self.pool.get('purchase.order.line')
partner_obj = self.pool.get('res.partner')
@@ -72,29 +74,29 @@ class purchase_requisition_partner(osv.osv_memory):
pricelist_obj = self.pool.get('product.pricelist')
prod_obj = self.pool.get('product.product')
tender_obj = self.pool.get('purchase.requisition')
- acc_pos_obj = self.pool.get('account.fiscal.position')
+ acc_pos_obj = self.pool.get('account.fiscal.position')
partner_id = data[0]['partner_id']
-
+
supplier_data = partner_obj.browse(cr, uid,[ partner_id])[0]
address_id = partner_obj.address_get(cr, uid, [partner_id], ['delivery'])['delivery']
list_line=[]
purchase_order_line={}
for tender in tender_obj.browse(cr, uid, record_ids):
- for line in tender.line_ids:
+ for line in tender.line_ids:
partner_list = sorted([(partner.sequence, partner) for partner in line.product_id.seller_ids if partner])
partner_rec = partner_list and partner_list[0] and partner_list[0][1] or False
- uom_id = line.product_id.uom_po_id and line.product_id.uom_po_id.id or False
+ uom_id = line.product_id.uom_po_id and line.product_id.uom_po_id.id or False
newdate = DateTime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S')
newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead)
delay = partner_rec and partner_rec.delay or False
newdate = newdate -(delay or DateTime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S') )
partner = partner_rec and partner_rec.name or supplier_data
- pricelist_id = partner.property_product_pricelist_purchase and partner.property_product_pricelist_purchase.id or False
+ pricelist_id = partner.property_product_pricelist_purchase and partner.property_product_pricelist_purchase.id or False
price = pricelist_obj.price_get(cr, uid, [pricelist_id], line.product_id.id, line.product_qty, False, {'uom': uom_id})[pricelist_id]
product = prod_obj.browse(cr, uid, line.product_id.id, context=context)
-
-
+
+
purchase_order_line= {
'name': product.partner_ref,
'product_qty': line.product_qty,
@@ -108,14 +110,14 @@ class purchase_requisition_partner(osv.osv_memory):
taxes = acc_pos_obj.map_tax(cr, uid, partner.property_account_position, taxes_ids)
purchase_order_line.update({
'taxes_id': [(6,0,taxes)]
- })
+ })
list_line.append(purchase_order_line)
purchase_id = order_obj.create(cr, uid, {
'origin': tender.purchase_ids and tender.purchase_ids[0].origin or tender.name,
'partner_id': partner_id,
'partner_address_id': address_id,
'pricelist_id': pricelist_id,
- 'location_id': tender.purchase_ids and tender.purchase_ids[0].location_id.id or line.product_id.product_tmpl_id.property_stock_production.id,
+ 'location_id': tender.purchase_ids and tender.purchase_ids[0].location_id.id or line.product_id.product_tmpl_id.property_stock_production.id,
'company_id': tender.company_id.id,
'fiscal_position': partner.property_account_position and partner.property_account_position.id or False,
'requisition_id':tender.id,
@@ -124,11 +126,9 @@ class purchase_requisition_partner(osv.osv_memory):
for order_line in list_line:
order_line.update({
'order_id': purchase_id
- })
+ })
order_line_obj.create(cr,uid,order_line)
- return {}
+ return {}
purchase_requisition_partner()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale/company.py b/addons/sale/company.py
index a4262cbfec6..401a1a9c1d8 100644
--- a/addons/sale/company.py
+++ b/addons/sale/company.py
@@ -33,4 +33,5 @@ class company(osv.osv):
}
company()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 2cef2799fae..26cb92d3f66 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -20,11 +20,10 @@
##############################################################################
import time
-from datetime import datetime
-from dateutil.relativedelta import relativedelta
-
import netsvc
from osv import fields, osv
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
from tools import config
from tools.translate import _
@@ -42,9 +41,9 @@ class sale_shop(osv.osv):
'project_id': fields.many2one('account.analytic.account', 'Analytic Account'),
'company_id': fields.many2one('res.company', 'Company'),
}
-
sale_shop()
+
def _incoterm_get(self, cr, uid, context=None):
if context is None:
context = {}
@@ -78,11 +77,11 @@ class sale_order(osv.osv):
return val
def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
- cur_obj = self.pool.get('res.currency')
if context is None:
context = {}
res = {}
- for order in self.browse(cr, uid, ids, context=context):
+ cur_obj = self.pool.get('res.currency')
+ for order in self.browse(cr, uid, ids, context):
res[order.id] = {
'amount_untaxed': 0.0,
'amount_tax': 0.0,
@@ -223,15 +222,15 @@ class sale_order(osv.osv):
('cancel', 'Cancelled')
], 'Order State', readonly=True, help="Gives the state of the quotation or sale order. The exception state is automatically set when a cancel operation occurs in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception). The 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the date 'Ordered Date'.", select=True),
'date_order': fields.date('Ordered Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
- 'create_date': fields.date('Creation Date', readonly=True, help="Date on which sale order is created"),
- 'date_confirm': fields.date('Confirmation Date', readonly=True, help="Date on which sale order is confirmed"),
+ 'create_date': fields.date('Creation Date', readonly=True),
+ 'date_confirm': fields.date('Confirmation Date', readonly=True),
'user_id': fields.many2one('res.users', 'Salesman', states={'draft': [('readonly', False)]}, select=True),
'partner_id': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)]}, required=True, change_default=True, select=True),
- 'partner_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="Invoice address for current sale order"),
+ 'partner_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)]}),
'partner_order_id': fields.many2one('res.partner.address', 'Ordering Contact', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="The name and address of the contact who requested the order or quotation."),
'partner_shipping_id': fields.many2one('res.partner.address', 'Shipping Address', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="Shipping address for current sale order"),
- 'incoterm': fields.selection(_incoterm_get, 'Incoterm', size=3, help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction"),
+ 'incoterm': fields.selection(_incoterm_get, 'Incoterm', size=3),
'picking_policy': fields.selection([('direct', 'Partial Delivery'), ('one', 'Complete Delivery')],
'Picking Policy', required=True, help="""If you don't have enough stock available to deliver all at once, do you accept partial shipments or not?"""),
'order_policy': fields.selection([
@@ -246,16 +245,16 @@ class sale_order(osv.osv):
- The 'Invoice on Order After Delivery' choice will generate the draft invoice based on sale order after all picking lists have been finished.
- The 'Invoice from the picking' choice is used to create an invoice during the picking process."""),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Pricelist version for current sale order"),
- 'project_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True, states={'draft': [('readonly', False)]}, help="The analytic account related to a sale order"),
+ 'project_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True, states={'draft': [('readonly', False)]}),
'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)]}),
'invoice_ids': fields.many2many('account.invoice', 'sale_order_invoice_rel', 'order_id', 'invoice_id', 'Invoices', help="This is the list of invoices that have been generated for this sale order. The same sale order may have been invoiced in several times (by line for example)."),
'picking_ids': fields.one2many('stock.picking', 'sale_id', 'Related Picking', readonly=True, help="This is the list of picking list that have been generated for this invoice"),
- 'shipped': fields.boolean('Picked', readonly=True, help="It indicates that a picking has been done.It will set to True if the ordered quantities are available and the picking is done.If the ordered quantities are not available it generates a Purchase/Manufacturing order.Unless its Picking and Purchase/Manufacturing order are not in the done state it wont be set to True"),
+ 'shipped': fields.boolean('Picked', readonly=True),
'picked_rate': fields.function(_picked_rate, method=True, string='Picked', type='float'),
'invoiced_rate': fields.function(_invoiced_rate, method=True, string='Invoiced', type='float'),
'invoiced': fields.function(_invoiced, method=True, string='Paid',
- fnct_search=_invoiced_search, type='boolean', help="It indicates that an invoice has been paid"),
+ fnct_search=_invoiced_search, type='boolean'),
'note': fields.text('Notes'),
'amount_untaxed': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Untaxed Amount',
@@ -263,19 +262,19 @@ class sale_order(osv.osv):
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
},
- multi='sums', help="The amount without tax"),
+ multi='sums'),
'amount_tax': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Taxes',
store = {
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
},
- multi='sums', help="The tax amount"),
+ multi='sums'),
'amount_total': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Total',
store = {
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
},
- multi='sums', help="The total amount"),
+ multi='sums'),
'invoice_quantity': fields.selection([('order', 'Ordered Quantities'), ('procurement', 'Shipped Quantities')], 'Invoice on', help="The sale order will automatically create the invoice proposition (draft invoice). Ordered and delivered quantities may not be the same. You have to choose if you invoice based on ordered or shipped quantities. If the product is a service, shipped quantities means hours spent on the associated tasks.", required=True),
'payment_term': fields.many2one('account.payment.term', 'Payment Term'),
@@ -284,13 +283,13 @@ class sale_order(osv.osv):
}
_defaults = {
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'sale.order', context=c),
- 'picking_policy': 'direct',
- 'date_order': time.strftime('%Y-%m-%d'),
- 'order_policy': 'manual',
- 'state': 'draft',
+ 'picking_policy': lambda *a: 'direct',
+ 'date_order': lambda *a: time.strftime('%Y-%m-%d'),
+ 'order_policy': lambda *a: 'manual',
+ 'state': lambda *a: 'draft',
'user_id': lambda obj, cr, uid, context: uid,
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'sale.order'),
- 'invoice_quantity': 'order',
+ 'invoice_quantity': lambda *a: 'order',
'partner_invoice_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['invoice'])['invoice'],
'partner_order_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['contact'])['contact'],
'partner_shipping_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['delivery'])['delivery'],
@@ -336,7 +335,7 @@ class sale_order(osv.osv):
wf_service.trg_create(uid, 'sale.order', inv_id, cr)
for (id,name) in self.name_get(cr, uid, ids):
message = _('Sale order ') + " '" + name + "' "+ _("is in draft state")
- self.log(cr, uid, id, message)
+ self.log(cr, uid, id, message)
return True
def onchange_partner_id(self, cr, uid, ids, part):
@@ -411,16 +410,8 @@ class sale_order(osv.osv):
return {}
def _make_invoice(self, cr, uid, order, lines, context=None):
- journal_obj = self.pool.get('account.journal')
- inv_obj = self.pool.get('account.invoice')
-
if context is None:
context = {}
-
- journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=', order.company_id.id)], limit=1)
- if not journal_ids:
- raise osv.except_osv(_('Error !'),
- _('There is no sale journal defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id))
a = order.partner_id.property_account_receivable.id
if order.payment_term:
pay_term = order.payment_term.id
@@ -431,6 +422,12 @@ class sale_order(osv.osv):
for preline in preinv.invoice_line:
inv_line_id = self.pool.get('account.invoice.line').copy(cr, uid, preline.id, {'invoice_id': False, 'price_unit': -preline.price_unit})
lines.append(inv_line_id)
+ journal_obj = self.pool.get('account.journal')
+ journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=', order.company_id.id)], limit=1)
+ if not journal_ids:
+ raise osv.except_osv(_('Error !'),
+ _('There is no sale journal defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id))
+
inv = {
'name': order.client_order_ref or order.name,
'origin': order.name,
@@ -450,6 +447,7 @@ class sale_order(osv.osv):
'company_id' : order.company_id.id,
'user_id':order.user_id and order.user_id.id or False
}
+ inv_obj = self.pool.get('account.invoice')
inv.update(self._inv_get(cr, uid, order))
inv_id = inv_obj.create(cr, uid, inv, context=context)
data = inv_obj.onchange_payment_term_date_invoice(cr, uid, [inv_id], pay_term, time.strftime('%Y-%m-%d'))
@@ -458,14 +456,12 @@ class sale_order(osv.osv):
inv_obj.button_compute(cr, uid, [inv_id])
return inv_id
- def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None):
+ def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False):
res = False
invoices = {}
invoice_ids = []
- picking_obj = self.pool.get('stock.picking')
- invoice = self.pool.get('account.invoice')
- if context is None:
- context = {}
+
+ context = {}
# If date was specified, use it as date invoiced, usefull when invoices are generated this month and put the
# last day of the last month as invoice date
if date_inv:
@@ -478,22 +474,21 @@ class sale_order(osv.osv):
created_lines = self.pool.get('sale.order.line').invoice_line_create(cr, uid, lines)
if created_lines:
invoices.setdefault(o.partner_id.id, []).append((o, created_lines))
+
if not invoices:
for o in self.browse(cr, uid, ids):
for i in o.invoice_ids:
if i.state == 'draft':
return i.id
+ picking_obj = self.pool.get('stock.picking')
for val in invoices.values():
if grouped:
res = self._make_invoice(cr, uid, val[0][0], reduce(lambda x,y: x + y, [l for o,l in val], []), context=context)
- invoice_ref = ''
for o, l in val:
- invoice_ref += o.name + '|'
self.write(cr, uid, [o.id], {'state': 'progress'})
if o.order_policy == 'picking':
picking_obj.write(cr, uid, map(lambda x: x.id, o.picking_ids), {'invoice_state': 'invoiced'})
cr.execute('insert into sale_order_invoice_rel (order_id,invoice_id) values (%s,%s)', (o.id, res))
- invoice.write(cr, uid, [res], {'origin': invoice_ref, 'name': invoice_ref})
else:
for order, il in val:
res = self._make_invoice(cr, uid, order, il, context=context)
@@ -566,19 +561,19 @@ class sale_order(osv.osv):
def action_wait(self, cr, uid, ids, *args):
product=[]
- product_obj = self.pool.get('product.product')
+ product_obj=self.pool.get('product.product')
for o in self.browse(cr, uid, ids):
if (o.order_policy == 'manual'):
self.write(cr, uid, [o.id], {'state': 'manual', 'date_confirm': time.strftime('%Y-%m-%d')})
else:
self.write(cr, uid, [o.id], {'state': 'progress', 'date_confirm': time.strftime('%Y-%m-%d')})
self.pool.get('sale.order.line').button_confirm(cr, uid, [x.id for x in o.order_line])
- for line in o.order_line:
+ for line in o.order_line:
product.append(line.product_id.default_code)
params = ', '.join(map(lambda x : str(x),product))
message = _('Sale order ') + " '" + o.name + "' "+ _("created on")+" '" +o.create_date + "' "+_("for")+" '" +params + "' "+_("is confirmed")
self.log(cr, uid, id, message)
- return True
+
def procurement_lines_get(self, cr, uid, ids, *args):
res = []
@@ -780,10 +775,10 @@ sale_order()
# - use it in report if there is a uos
class sale_order_line(osv.osv):
def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
- tax_obj = self.pool.get('account.tax')
- cur_obj = self.pool.get('res.currency')
res = {}
context = context or {}
+ tax_obj = self.pool.get('account.tax')
+ cur_obj = self.pool.get('res.currency')
for line in self.browse(cr, uid, ids, context=context):
price = line.price_unit * line.product_uom_qty * (1 - (line.discount or 0.0) / 100.0)
taxes = tax_obj.compute_all(cr, uid, line.tax_id, price, line.product_uom_qty)
@@ -841,15 +836,15 @@ class sale_order_line(osv.osv):
}
_order = 'sequence, id'
_defaults = {
- 'discount': 0.0,
- 'delay': 0.0,
- 'product_uom_qty': 1,
- 'product_uos_qty': 1,
- 'sequence': 10,
- 'invoiced': 0,
- 'state': 'draft',
- 'type': 'make_to_stock',
- 'product_packaging': False
+ 'discount': lambda *a: 0.0,
+ 'delay': lambda *a: 0.0,
+ 'product_uom_qty': lambda *a: 1,
+ 'product_uos_qty': lambda *a: 1,
+ 'sequence': lambda *a: 10,
+ 'invoiced': lambda *a: 0,
+ 'state': lambda *a: 'draft',
+ 'type': lambda *a: 'make_to_stock',
+ 'product_packaging': lambda *a: False
}
def invoice_line_create(self, cr, uid, ids, context=None):
@@ -941,7 +936,7 @@ class sale_order_line(osv.osv):
context = {}
for (id,name) in self.name_get(cr, uid, ids):
message = _('Sale order line') + " '" + name + "' "+ _("is confirmed")
- self.log(cr, uid, id, message)
+ self.log(cr, uid, id, message)
return self.write(cr, uid, ids, {'state': 'confirmed'})
def button_done(self, cr, uid, ids, context=None):
@@ -1198,4 +1193,3 @@ class sale_config_picking_policy(osv.osv_memory):
self.pool.get('stock.location').write(cr, uid, [location_id], {'chained_auto_packing': 'transparent'})
sale_config_picking_policy()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 14aa80659f9..8a618a173d3 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -1,7 +1,6 @@
-
@@ -169,7 +168,7 @@
states="confirmed"
string="Make Invoice"
type="action"
- icon="terp-document-new" />
+ icon="gtk-print" />
@@ -203,7 +202,7 @@
-
+
@@ -213,7 +212,7 @@
-
+
@@ -221,7 +220,7 @@
-
+
@@ -249,7 +248,7 @@
-
+
@@ -400,7 +399,7 @@
name="%(action_view_sale_order_line_make_invoice)d"
string="Make Invoice"
type="action"
- icon="terp-document-new" />
+ icon="gtk-print" />
@@ -163,7 +161,7 @@
-
+
@@ -209,15 +207,13 @@
stock.sale.forecast
tree
-
+
-
-
@@ -241,28 +237,22 @@
stock.sale.forecast
search
-
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
- Sales Forecast
+ Stock and Sales Forecast
stock.sale.forecast
form
tree,form,graph
@@ -271,7 +261,7 @@
@@ -361,7 +351,7 @@
-
+
@@ -372,10 +362,10 @@
-
+
-
+
@@ -392,18 +382,14 @@
search
+
+
-
-
-
-
-
-
-
+
diff --git a/addons/survey/i18n/es.po b/addons/survey/i18n/es.po
new file mode 100644
index 00000000000..76d1e5a66eb
--- /dev/null
+++ b/addons/survey/i18n/es.po
@@ -0,0 +1,695 @@
+# Spanish 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-06-29 22:27+0000\n"
+"Last-Translator: Borja López Soilán (Pexego) \n"
+"Language-Team: Spanish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-06-30 03:34+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: survey
+#: model:ir.ui.menu,name:survey.menu_survey_form
+msgid "Surveys"
+msgstr "Encuestas"
+
+#. module: survey
+#: model:ir.actions.report.xml,name:survey.survey
+msgid "Survey Analysis Report"
+msgstr "Informe de análisis de encuestas"
+
+#. 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 "Preguntas de las encuestas"
+
+#. module: survey
+#: view:survey:0
+#: view:survey.response:0
+msgid "Set to draft"
+msgstr "Cambiar a borrador"
+
+#. module: survey
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr "Nombre de modelo inválido en la definición de acción."
+
+#. module: survey
+#: field:survey.history,date:0
+msgid "Date started"
+msgstr "Fecha de inicio"
+
+#. module: survey
+#: field:survey,history:0
+msgid "History Lines"
+msgstr "Líneas histórico"
+
+#. module: survey
+#: wizard_field:wizard.send.invitation,init,mail:0
+msgid "Body"
+msgstr "Cuerpo"
+
+#. 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 "Responder la encuesta"
+
+#. module: survey
+#: model:ir.actions.act_window,name:survey.act_survey_question
+msgid "All Questions"
+msgstr "Todas las preguntas"
+
+#. module: survey
+#: field:survey,date_open:0
+msgid "Survey Open Date"
+msgstr "Fecha apertura de encuesta"
+
+#. module: survey
+#: model:ir.model,name:survey.model_survey_name_wiz
+msgid "survey.name.wiz"
+msgstr "encuesta.nombre.asist"
+
+#. module: survey
+#: view:survey:0
+msgid "Users Details"
+msgstr "Detalles usuarios"
+
+#. 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 "Pregunta de la encuesta"
+
+#. module: survey
+#: help:survey,response_user:0
+msgid "Set to one if you require only one response per user"
+msgstr "Establecer a uno si sólo necesita una respuesta por usuario"
+
+#. module: survey
+#: field:survey.page,title:0
+msgid "Page Title"
+msgstr "Título de la página"
+
+#. module: survey
+#: model:ir.model,name:survey.model_survey_history
+msgid "Survey History"
+msgstr "Histórico encuestas"
+
+#. module: survey
+#: field:survey.response,comment:0
+#: field:survey.response.answer,comment:0
+msgid "Notes"
+msgstr "Notas"
+
+#. module: survey
+#: field:survey.question,tot_resp:0
+msgid "Total Response"
+msgstr "Respuesta total"
+
+#. module: survey
+#: view:survey.question.wiz:0
+msgid "Your Messages"
+msgstr "Sus mensajes"
+
+#. module: survey
+#: selection:survey,state:0
+msgid "Cancelled"
+msgstr "Cancelada"
+
+#. module: survey
+#: field:survey.question,allow_comment:0
+msgid "Allow Comment Field"
+msgstr "Permitir campo comentario"
+
+#. module: survey
+#: code:addons/survey/survey.py:0
+#, python-format
+msgid "Warning !"
+msgstr "¡ Advertencia !"
+
+#. 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 "Enviar recordatorio para usuario existente"
+
+#. 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 "Nueva pregunta de encuesta"
+
+#. module: survey
+#: view:survey.response:0
+msgid "Skip"
+msgstr "Saltar"
+
+#. module: survey
+#: wizard_field:wizard.send.invitation,init,partner_ids:0
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: survey
+#: wizard_field:wizard.send.invitation,init,mail_subject:0
+#: wizard_field:wizard.send.invitation,init,mail_subject_existing:0
+msgid "Subject"
+msgstr "Asunto"
+
+#. module: survey
+#: field:survey,max_response_limit:0
+msgid "Maximum Response Limit"
+msgstr "Límite respuesta máxima"
+
+#. module: survey
+#: wizard_field:wizard.send.invitation,init,mail_from:0
+msgid "From"
+msgstr "De"
+
+#. 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/wiki/__openerp__.py b/addons/wiki/__openerp__.py
index 8dd7779a290..074c44b0a87 100644
--- a/addons/wiki/__openerp__.py
+++ b/addons/wiki/__openerp__.py
@@ -24,13 +24,13 @@
'version': '1.0',
'category': 'Generic Modules/Others',
'description': """
- The base module to manage documents(wiki)
+The base module to manage documents(wiki)
- keep track for the wiki groups, pages, and history
+keep track for the wiki groups, pages, and history
""",
'author': 'Tiny & Axelor',
'website': 'http://openerp.com',
- 'depends': ['base'],
+ 'depends': ['knowledge'],
'init_xml': [],
'update_xml': [
'wizard/wiki_wiki_page_open_view.xml',
diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml
index 189122ea617..c1baa5cda20 100644
--- a/addons/wiki/wiki_view.xml
+++ b/addons/wiki/wiki_view.xml
@@ -1,18 +1,16 @@
-
+
+ id="knowledge.menu_document_configuration"
+ parent="knowledge.menu_document" sequence="50" />
+ parent="knowledge.menu_document_configuration" sequence="2" />
-
@@ -190,7 +188,7 @@
-