diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 28d2f5a06a6..4d4b0a3022f 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -150,7 +150,7 @@
-
+
@@ -259,7 +259,7 @@
-
+
diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml
index 77b49a36b8f..3926e4fd9fb 100644
--- a/addons/account/account_menuitem.xml
+++ b/addons/account/account_menuitem.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 41d413fbbf5..3b459a4e986 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -1114,7 +1114,6 @@ class account_move_line(osv.osv):
self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
move_id = vals.get('move_id', False)
journal = journal_obj.browse(cr, uid, context['journal_id'])
-# is_new_move = False
if not move_id:
if journal.centralisation:
#Check for centralisation
@@ -1133,7 +1132,6 @@ class account_move_line(osv.osv):
vals['move_id'] = move_id
else:
raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.'))
-# is_new_move = True
ok = not (journal.type_control_ids or journal.account_control_ids)
if ('account_id' in vals):
account = account_obj.browse(cr, uid, vals['account_id'])
@@ -1247,4 +1245,4 @@ class account_move_line(osv.osv):
account_move_line()
-# 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/account/invoice.py b/addons/account/invoice.py
index 23978296367..ab9b90d7361 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -464,14 +464,6 @@ class account_invoice(osv.osv):
result['value'].update(to_update['value'])
return result
- def onchange_currency_id(self, cr, uid, ids, curr_id, company_id):
- if curr_id and company_id:
- currency = self.pool.get('res.currency').browse(cr, uid, curr_id)
- if currency.company_id.id != company_id:
- raise osv.except_osv(_('Configuration Error !'),
- _('Can not select currency that is not related to current company.\nPlease select accordingly !.'))
- return {}
-
def onchange_journal_id(self, cr, uid, ids, journal_id=False):
result = {}
if journal_id:
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index cb316408885..954bfe3ff94 100644
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -88,7 +88,7 @@
-
+
diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml
index 24265065b25..347a82e33c2 100644
--- a/addons/account/security/account_security.xml
+++ b/addons/account/security/account_security.xml
@@ -100,14 +100,14 @@
Account fiscal Mapping company rule
- [('company_id','=',user.company_id.id)]
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
Account model company rule
- [('company_id','=',user.company_id.id)]
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml
index 172eb50afd5..26888cc69c1 100644
--- a/addons/account/test/account_report.yml
+++ b/addons/account/test/account_report.yml
@@ -65,23 +65,23 @@
-
!python {model: res.partner}: |
import netsvc, tools, os, time
- import datetime
- from mx.DateTime import *
+ from datetime import datetime
+ from dateutil.relativedelta import relativedelta
import warnings
import md5
import hashlib
warnings.filterwarnings('ignore',".*struct integer overflow masking is deprecated*")
- start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
- start = DateTime(int(start.year), int(start.month), int(start.day))
+ start = datetime.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
+ start = datetime(int(start.year), int(start.month), int(start.day))
res = {}
for i in range(5)[::-1]:
- stop = start - RelativeDateTime(days=30)
+ stop = start - relativedelta(days=30)
res[str(i)] = {
'name': (i!=0 and (str((5-(i+1)) * 30) + '-' + str((5-i) * 30)) or ('+'+str(4 * 30))),
'stop': start.strftime('%Y-%m-%d'),
'start': (i!=0 and stop.strftime('%Y-%m-%d') or False),
}
- start = stop - RelativeDateTime(days=1)
+ start = stop - relativedelta(days=1)
obj_move = self.pool.get('account.move.line')
ctx = {}
fy_id = ref('account.data_fiscalyear')
diff --git a/addons/account_budget/security/account_budget_security.xml b/addons/account_budget/security/account_budget_security.xml
index ec075205f68..1fbcd82e86c 100644
--- a/addons/account_budget/security/account_budget_security.xml
+++ b/addons/account_budget/security/account_budget_security.xml
@@ -1,27 +1,27 @@
-
+
-
- Budget post multi-company
-
-
- ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
-
+
+ Budget post multi-company
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+
-
- Budget multi-company
-
-
- ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
-
+
+ Budget multi-company
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+
-
- Budget lines multi-company
-
-
- ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
-
+
+ Budget lines multi-company
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+
-
+
diff --git a/addons/account_coda/security/account_security.xml b/addons/account_coda/security/account_security.xml
index f1a453da542..b8fdd32ebe6 100644
--- a/addons/account_coda/security/account_security.xml
+++ b/addons/account_coda/security/account_security.xml
@@ -5,7 +5,7 @@
Account Coda model company rule
- [('company_id','=',user.company_id.id)]
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
diff --git a/addons/account_payment/account_invoice.py b/addons/account_payment/account_invoice.py
index 9a45ae29c0b..c05721ce6dc 100644
--- a/addons/account_payment/account_invoice.py
+++ b/addons/account_payment/account_invoice.py
@@ -19,8 +19,7 @@
#
##############################################################################
-from mx import DateTime
-
+from datetime import datetime
from osv import fields, osv
class Invoice(osv.osv):
@@ -36,8 +35,8 @@ class Invoice(osv.osv):
if invoice.move_id:
for line in invoice.move_id.line_id:
if not line.date_maturity or \
- DateTime.strptime(line.date_maturity, '%Y-%m-%d') \
- < DateTime.now():
+ datetime.strptime(line.date_maturity, '%Y-%m-%d') \
+ < datetime.today():
res[invoice.id] += line.amount_to_pay
return res
@@ -50,4 +49,4 @@ class Invoice(osv.osv):
Invoice()
-# 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/account_payment/security/account_payment_security.xml b/addons/account_payment/security/account_payment_security.xml
index 6561373bafb..5977ea36365 100644
--- a/addons/account_payment/security/account_payment_security.xml
+++ b/addons/account_payment/security/account_payment_security.xml
@@ -10,7 +10,7 @@
Payment Mode company rule
- [('company_id','=',user.company_id.id)]
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index c59aa8217be..1760978b8c2 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -792,7 +792,6 @@ class account_voucher_line(osv.osv):
move_line = move_line_pool.browse(cr, user, move_line_id, context=context)
if move_line.credit:
ttype = 'dr'
-# amount = move_line.credit
else:
ttype = 'cr'
account_id = move_line.account_id.id
@@ -917,4 +916,4 @@ class account_bank_statement_line(osv.osv):
account_bank_statement_line()
-# 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/account_voucher/invoice.py b/addons/account_voucher/invoice.py
index f48af5cb28d..5560f57ce81 100644
--- a/addons/account_voucher/invoice.py
+++ b/addons/account_voucher/invoice.py
@@ -36,7 +36,7 @@ class invoice(osv.osv):
'res_model': 'account.voucher',
'type': 'ir.actions.act_window',
'nodestroy': True,
- 'target': 'new',
+ 'target': 'current',
'domain': '[]',
'context': {
'default_partner_id': inv.partner_id.id,
diff --git a/addons/analytic/security/analytic_security.xml b/addons/analytic/security/analytic_security.xml
index 2eeda3aa370..dfa8c840bb6 100644
--- a/addons/analytic/security/analytic_security.xml
+++ b/addons/analytic/security/analytic_security.xml
@@ -5,7 +5,7 @@
Analytic multi company rule
- [('company_id','=',user.company_id.id)]
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
Useability / Analytic Accounting
diff --git a/addons/auction/report/report_auction.py b/addons/auction/report/report_auction.py
index cf1c680c63b..25cdab88e89 100644
--- a/addons/auction/report/report_auction.py
+++ b/addons/auction/report/report_auction.py
@@ -18,7 +18,6 @@
# along with this program. If not, see .
#
##############################################################################
-from mx import DateTime
from osv import fields, osv, orm
from tools import config
from tools.translate import _
diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py
index d602fce3a0f..df5aaa4287d 100644
--- a/addons/base_calendar/base_calendar.py
+++ b/addons/base_calendar/base_calendar.py
@@ -1531,6 +1531,9 @@ true, it will allow you to hide the event alarm information without removing it.
result = []
if fields and 'date' not in fields:
fields.append('date')
+ if fields and 'duration' not in fields:
+ fields.append('duration')
+
for base_calendar_id, real_id in select:
#REVET: Revision ID: olt@tinyerp.com-20100924131709-cqsd1ut234ni6txn
diff --git a/addons/crm/crm_lead_menu.xml b/addons/crm/crm_lead_menu.xml
index a92a36aba33..6c74dccac15 100644
--- a/addons/crm/crm_lead_menu.xml
+++ b/addons/crm/crm_lead_menu.xml
@@ -31,7 +31,7 @@
parent="base.menu_base_partner" sequence="1" />
diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py
index b81819e1171..4327052c36b 100644
--- a/addons/crm/crm_meeting.py
+++ b/addons/crm/crm_meeting.py
@@ -21,10 +21,8 @@
from base_calendar import base_calendar
from crm import crm_case
-from datetime import datetime, timedelta
from osv import fields, osv
from tools.translate import _
-import time
import logging
class crm_lead(crm_case, osv.osv):
@@ -187,7 +185,7 @@ class res_users(osv.osv):
try:
data_id = data_obj._get_id(cr, uid, 'crm', 'ir_ui_view_sc_calendar0')
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
- copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
+ self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
'user_id': user_id}, context=context)
except ValueError:
# Tolerate a missing shortcut. See product/product.py for similar code.
diff --git a/addons/crm/security/crm_security.xml b/addons/crm/security/crm_security.xml
index 78018a4031b..1e25ecb5bdd 100644
--- a/addons/crm/security/crm_security.xml
+++ b/addons/crm/security/crm_security.xml
@@ -34,6 +34,6 @@
-
+
diff --git a/addons/crm_caldav/crm_caldav.py b/addons/crm_caldav/crm_caldav.py
index 1a2deae90be..c2ed193dc23 100644
--- a/addons/crm_caldav/crm_caldav.py
+++ b/addons/crm_caldav/crm_caldav.py
@@ -19,9 +19,8 @@
#
##############################################################################
-from osv import fields, osv
+from osv import osv
from base_calendar import base_calendar
-from crm import crm
from caldav import calendar
from datetime import datetime
import re
diff --git a/addons/fetchmail/fetchmail_data.xml b/addons/fetchmail/fetchmail_data.xml
index 1b60f4ca0a8..ef40a76489f 100644
--- a/addons/fetchmail/fetchmail_data.xml
+++ b/addons/fetchmail/fetchmail_data.xml
@@ -12,15 +12,4 @@
-
-
-
-
- User wise Server
-
-
- [('user_id', '=', user.id)]
-
-
-
diff --git a/addons/hr_attendance/__openerp__.py b/addons/hr_attendance/__openerp__.py
index 8a52d0e2577..d38c0fcebf3 100644
--- a/addons/hr_attendance/__openerp__.py
+++ b/addons/hr_attendance/__openerp__.py
@@ -36,15 +36,16 @@
'hr_attendance_view.xml',
'hr_attendance_report.xml',
'security/ir.model.access.csv',
+ 'security/ir_rule.xml',
'wizard/hr_attendance_bymonth_view.xml',
'wizard/hr_attendance_byweek_view.xml',
'wizard/hr_attendance_error_view.xml',
'wizard/hr_attendance_sign_in_out_view.xml',
- ],
+ ],
'demo_xml': ['hr_attendance_demo.xml'],
'test': ['test/test_hr_attendance.yml',
'test/hr_attendance_report.yml'
- ],
+ ],
'installable': True,
'active': False,
'certificate': '0063495605613',
diff --git a/addons/hr_attendance/hr_attendance_demo.xml b/addons/hr_attendance/hr_attendance_demo.xml
index d2967167ec8..372e9112269 100644
--- a/addons/hr_attendance/hr_attendance_demo.xml
+++ b/addons/hr_attendance/hr_attendance_demo.xml
@@ -121,17 +121,6 @@
sign_out
-
- Employee Attendance
-
- [('employee_id.user_id','=',user.id)]
-
-
-
- Manager Attendance
-
- ['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )]
-
-
+
diff --git a/addons/hr_attendance/security/ir_rule.xml b/addons/hr_attendance/security/ir_rule.xml
new file mode 100644
index 00000000000..914acbb1974
--- /dev/null
+++ b/addons/hr_attendance/security/ir_rule.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Employee Attendance
+
+ [('employee_id.user_id','=',user.id)]
+
+
+
+ Manager Attendance
+
+ [('1','=',1)]
+
+
+
+
+
+
+
diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py
index 20bd8a0b327..a8b2a3e2c69 100644
--- a/addons/hr_evaluation/hr_evaluation.py
+++ b/addons/hr_evaluation/hr_evaluation.py
@@ -20,8 +20,9 @@
##############################################################################
import time
-from mx import DateTime as dt
-
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
+from dateutil import parser
from osv import fields, osv
import tools
from tools.translate import _
@@ -109,8 +110,8 @@ class hr_employee(osv.osv):
context = {}
for id in self.browse(cr, uid, self.search(cr, uid, [], context=context), context=context):
if id.evaluation_plan_id and id.evaluation_date:
- if (dt.ISO.ParseAny(id.evaluation_date) + dt.RelativeDateTime(months = int(id.evaluation_plan_id.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"):
- self.write(cr, uid, id.id, {'evaluation_date' : (dt.ISO.ParseAny(id.evaluation_date) + dt.RelativeDateTime(months =+ int(id.evaluation_plan_id.month_next))).strftime('%Y-%m-%d')}, context=context)
+ if (parser.parse(id.evaluation_date) + relativedelta(months = int(id.evaluation_plan_id.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"):
+ self.write(cr, uid, id.id, {'evaluation_date' : (parser.parse(id.evaluation_date) + relativedelta(months =+ int(id.evaluation_plan_id.month_next))).strftime('%Y-%m-%d')}, context=context)
obj_evaluation.create(cr, uid, {'employee_id' : id.id, 'plan_id': id.evaluation_plan_id}, context=context)
return True
@@ -123,11 +124,11 @@ class hr_employee(osv.osv):
flag = False
evaluation_plan = evaluation_plan_obj.browse(cr, uid, [evaluation_plan_id], context=context)[0]
if not evaluation_date:
- evaluation_date=(dt.ISO.ParseAny(dt.now().strftime('%Y-%m-%d'))+ dt.RelativeDateTime(months=+evaluation_plan.month_first)).strftime('%Y-%m-%d')
+ evaluation_date=(parser.parse(datetime.date.today().strftime('%Y-%m-%d'))+ relativedelta(months=+evaluation_plan.month_first)).strftime('%Y-%m-%d')
flag = True
else:
- if (dt.ISO.ParseAny(evaluation_date) + dt.RelativeDateTime(months = int(evaluation_plan.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"):
- evaluation_date=(dt.ISO.ParseAny(evaluation_date)+ dt.RelativeDateTime(months=+evaluation_plan.month_next)).strftime('%Y-%m-%d')
+ if (parser.parse(evaluation_date) + relativedelta(months = int(evaluation_plan.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"):
+ evaluation_date=(parser.parse(evaluation_date)+ relativedelta(months=+evaluation_plan.month_next)).strftime('%Y-%m-%d')
flag = True
if ids and flag:
obj_evaluation.create(cr, uid, {'employee_id': ids[0], 'plan_id': evaluation_plan_id}, context=context)
@@ -174,7 +175,7 @@ class hr_evaluation(osv.osv):
'progress' : fields.float("Progress"),
}
_defaults = {
- 'date' : lambda *a: (dt.ISO.ParseAny(dt.now().strftime('%Y-%m-%d')) + dt.RelativeDateTime(months =+ 1)).strftime('%Y-%m-%d'),
+ 'date' : lambda *a: (parser.parse(datetime.date.today().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'),
'state' : lambda *a: 'draft',
}
@@ -225,7 +226,7 @@ class hr_evaluation(osv.osv):
int_id = hr_eval_inter_obj.create(cr, uid, {
'evaluation_id': evaluation.id,
'survey_id': phase.survey_id.id,
- 'date_deadline': (dt.ISO.ParseAny(dt.now().strftime('%Y-%m-%d')) + dt.RelativeDateTime(months =+ 1)).strftime('%Y-%m-%d'),
+ 'date_deadline': (parser.parse(datetime.date.today().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'),
'user_id': child.user_id.id,
'user_to_review_id': evaluation.employee_id.id
}, context=context)
diff --git a/addons/hr_evaluation/hr_evaluation_demo.xml b/addons/hr_evaluation/hr_evaluation_demo.xml
index f8513bf63ea..59396717d49 100644
--- a/addons/hr_evaluation/hr_evaluation_demo.xml
+++ b/addons/hr_evaluation/hr_evaluation_demo.xml
@@ -1599,31 +1599,31 @@ Once the form had been filled, the employee send it to his supervisor.
-
-
- Run Employee Evaluation
-
-
- 1
- minutes
- -1
-
-
-
-
+
+
+ Run Employee Evaluation
+
+
+ 1
+ minutes
+ -1
+
+
+
+
Employee Evaluation
[('employee_id.user_id','=',user.id)]
-
+
Manager Evaluation
['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )]
-
+
-
+
diff --git a/addons/hr_expense/__openerp__.py b/addons/hr_expense/__openerp__.py
index c9df8587153..75d79d4bfc6 100644
--- a/addons/hr_expense/__openerp__.py
+++ b/addons/hr_expense/__openerp__.py
@@ -49,10 +49,11 @@
'hr_expense_view.xml',
'hr_expense_report.xml',
'process/hr_expense_process.xml',
+ 'security/ir_rule.xml',
'report/hr_expense_report_view.xml',
'board_hr_expense_view.xml',
'board_hr_expense_manager_view.xml'
- ],
+ ],
'demo_xml': [
'hr_expense_demo.xml',
],
diff --git a/addons/hr_expense/hr_expense_demo.xml b/addons/hr_expense/hr_expense_demo.xml
index cb9e28b5543..4c85bd8384e 100644
--- a/addons/hr_expense/hr_expense_demo.xml
+++ b/addons/hr_expense/hr_expense_demo.xml
@@ -1,8 +1,8 @@
-
+
-
+
1.0
1.0
@@ -38,61 +38,61 @@
-
-
-
-
- May Expenses
-
- 2010-05-03
- draft
-
+
+
+
+
+ May Expenses
+
+ 2010-05-03
+ draft
+
-
- Travel by Air
- 2010-05-03
-
-
-
-
-
-
-
+
+ Travel by Air
+ 2010-05-03
+
+
+
+
+
+
+
-
- Basic PC - Server for Seagate
- 2010-05-03
-
-
-
-
-
-
-
+
+ Basic PC - Server for Seagate
+ 2010-05-03
+
+
+
+
+
+
+
-
+
-
-
-
-
-
- Travel Expenses
-
- 2010-04-20
- draft
-
+
+
+
+
+
+ Travel Expenses
+
+ 2010-04-20
+ draft
+
-
- Hotel Expenses - Thymbra
- 2010-05-03
-
-
-
-
-
-
-
+
+ Hotel Expenses - Thymbra
+ 2010-05-03
+
+
+
+
+
+
+
Bruxelles - Paris
@@ -104,17 +104,5 @@
-
- Employee Expense
-
- [('employee_id.user_id','=',user.id)]
-
-
-
- Manager Expense
-
- ['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )]
-
-
-
+
diff --git a/addons/hr_expense/security/ir_rule.xml b/addons/hr_expense/security/ir_rule.xml
new file mode 100644
index 00000000000..1a3ee41cdcb
--- /dev/null
+++ b/addons/hr_expense/security/ir_rule.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+ Employee Expense
+
+ [('employee_id.user_id','=',user.id)]
+
+
+
+ Manager Expense
+
+ [('1','=',1)]
+
+
+
+
+
diff --git a/addons/hr_holidays/__openerp__.py b/addons/hr_holidays/__openerp__.py
index 308f03ba293..09b312f0834 100644
--- a/addons/hr_holidays/__openerp__.py
+++ b/addons/hr_holidays/__openerp__.py
@@ -54,6 +54,7 @@
'init_xml': [],
'update_xml': [
'security/ir.model.access.csv',
+ 'security/ir_rule.xml',
'hr_holidays_workflow.xml',
'hr_holidays_view.xml',
'hr_holidays_data.xml',
diff --git a/addons/hr_holidays/hr_holidays_demo.xml b/addons/hr_holidays/hr_holidays_demo.xml
index e12d7de16b5..dca01d06b1a 100644
--- a/addons/hr_holidays/hr_holidays_demo.xml
+++ b/addons/hr_holidays/hr_holidays_demo.xml
@@ -33,19 +33,5 @@
-
-
- Employee Holidays
-
- [('employee_id.user_id','=',user.id)]
-
-
-
- Manager Holidays
-
- ['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )]
-
-
-
diff --git a/addons/hr_holidays/security/ir_rule.xml b/addons/hr_holidays/security/ir_rule.xml
new file mode 100644
index 00000000000..12217aaddf2
--- /dev/null
+++ b/addons/hr_holidays/security/ir_rule.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+ Employee Holidays
+
+ [('employee_id.user_id','=',user.id)]
+
+
+
+ Manager Holidays
+
+ [('1','=',1)]
+
+
+
+
+
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
index 44bda56739f..b152e0112eb 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
@@ -23,7 +23,8 @@ import time
import netsvc
from osv import fields, osv
-from mx import DateTime
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
from tools.translate import _
class one2many_mod2(fields.one2many):
@@ -210,9 +211,9 @@ class hr_timesheet_sheet(osv.osv):
if context is None:
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
- if DateTime.now() <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'):
+ if datetime.today() <= datetime.strptime(sheet.date_from, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,}, context=context)
- elif DateTime.now() >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'):
+ elif datetime.now() >= datetime.strptime(sheet.date_to, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,}, context=context)
else:
self.write(cr, uid, [sheet.id], {'date_current': time.strftime('%Y-%m-%d')}, context=context)
@@ -222,11 +223,11 @@ class hr_timesheet_sheet(osv.osv):
if context is None:
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
- if DateTime.strptime(sheet.date_current, '%Y-%m-%d') <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'):
+ if datetime.strptime(sheet.date_current, '%Y-%m-%d') <= datetime.strptime(sheet.date_from, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,}, context=context)
else:
self.write(cr, uid, [sheet.id], {
- 'date_current': (DateTime.strptime(sheet.date_current, '%Y-%m-%d') + DateTime.RelativeDateTime(days=-1)).strftime('%Y-%m-%d'),
+ 'date_current': (datetime.strptime(sheet.date_current, '%Y-%m-%d') + relativedelta(days=-1)).strftime('%Y-%m-%d'),
}, context=context)
return True
@@ -234,11 +235,11 @@ class hr_timesheet_sheet(osv.osv):
if context is None:
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
- if DateTime.strptime(sheet.date_current, '%Y-%m-%d') >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'):
+ if datetime.strptime(sheet.date_current, '%Y-%m-%d') >= datetime.strptime(sheet.date_to, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,}, context=context)
else:
self.write(cr, uid, [sheet.id], {
- 'date_current': (DateTime.strptime(sheet.date_current, '%Y-%m-%d') + DateTime.RelativeDateTime(days=1)).strftime('%Y-%m-%d'),
+ 'date_current': (datetime.strptime(sheet.date_current, '%Y-%m-%d') + relativedelta(days=1)).strftime('%Y-%m-%d'),
}, context=context)
return True
@@ -246,9 +247,9 @@ class hr_timesheet_sheet(osv.osv):
if context is None:
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
- if DateTime.strptime(sheet.date_current, '%Y-%m-%d') <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'):
+ if datetime.strptime(sheet.date_current, '%Y-%m-%d') <= datetime.strptime(sheet.date_from, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,}, context=context)
- elif DateTime.strptime(sheet.date_current, '%Y-%m-%d') >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'):
+ elif datetime.strptime(sheet.date_current, '%Y-%m-%d') >= datetime.strptime(sheet.date_to, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,}, context=context)
return True
@@ -318,7 +319,7 @@ class hr_timesheet_sheet(osv.osv):
if r=='month':
return time.strftime('%Y-%m-01')
elif r=='week':
- return (DateTime.now() + DateTime.RelativeDateTime(weekday=(DateTime.Monday,0))).strftime('%Y-%m-%d')
+ return (datetime.today() + relativedelta(weekday=0)).strftime('%Y-%m-%d')
elif r=='year':
return time.strftime('%Y-01-01')
return time.strftime('%Y-%m-%d')
@@ -327,9 +328,9 @@ class hr_timesheet_sheet(osv.osv):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
r = user.company_id and user.company_id.timesheet_range or 'month'
if r=='month':
- return (DateTime.now() + DateTime.RelativeDateTime(months=+1,day=1,days=-1)).strftime('%Y-%m-%d')
+ return (datetime.today() + relativedelta(months=+1,day=1,days=-1)).strftime('%Y-%m-%d')
elif r=='week':
- return (DateTime.now() + DateTime.RelativeDateTime(weekday=(DateTime.Sunday,0))).strftime('%Y-%m-%d')
+ return (datetime.today() + relativedelta(weekday=6)).strftime('%Y-%m-%d')
elif r=='year':
return time.strftime('%Y-12-31')
return time.strftime('%Y-%m-%d')
diff --git a/addons/hr_timesheet_sheet/security/hr_timesheet_sheet_security.xml b/addons/hr_timesheet_sheet/security/hr_timesheet_sheet_security.xml
index 2ff303cb48f..af6786a2a77 100644
--- a/addons/hr_timesheet_sheet/security/hr_timesheet_sheet_security.xml
+++ b/addons/hr_timesheet_sheet/security/hr_timesheet_sheet_security.xml
@@ -1,13 +1,13 @@
-
+
-
- Timesheet multi-company
-
-
- [('company_id','child_of',[user.company_id.id])]
-
+
+ Timesheet multi-company
+
+
+ [('company_id','child_of',[user.company_id.id])]
+
-
+
diff --git a/addons/l10n_ch/invoice.py b/addons/l10n_ch/invoice.py
index 1057fc379fd..1f836c4466a 100644
--- a/addons/l10n_ch/invoice.py
+++ b/addons/l10n_ch/invoice.py
@@ -30,7 +30,7 @@
#
##############################################################################
-from mx import DateTime
+from datetime import datetime
from osv import fields, osv
from tools import mod10r
@@ -71,8 +71,8 @@ class account_invoice(osv.osv):
if invoice.move_id:
for line in invoice.move_id.line_id:
if not line.date_maturity or \
- DateTime.strptime(line.date_maturity, '%Y-%m-%d') \
- < DateTime.now():
+ datetime.strptime(line.date_maturity, '%Y-%m-%d') \
+ < datetime.today():
res[invoice.id] += line.amount_to_pay
return res
@@ -209,4 +209,4 @@ class account_tax_code(osv.osv):
account_tax_code()
-# 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/mrp/i18n/de.po b/addons/mrp/i18n/de.po
index 2e84ba9f1e2..094b42b8735 100644
--- a/addons/mrp/i18n/de.po
+++ b/addons/mrp/i18n/de.po
@@ -396,8 +396,8 @@ msgid ""
"partner location if you subcontract the manufacturing operations."
msgstr ""
"Leer lassen, wenn die Produktion an jenen Orten erfolgt, an denen die "
-"Fertigprodukte gebraucht werden.\r\n"
-"Setze einen Ort, wenn an fixen Orten produziert wird.\r\n"
+"Fertigprodukte gebraucht werden.\n"
+"Setze einen Ort, wenn an fixen Orten produziert wird.\n"
"Das kann auch ein Partner-Ort sein, wenn Sie Subkontrakte haben."
#. module: mrp
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 50ed21eb298..d0402708f5f 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -81,9 +81,11 @@ class mrp_routing(osv.osv):
"Set a location if you produce at a fixed location. This can be a partner location " \
"if you subcontract the manufacturing operations."
),
+ 'company_id': fields.many2one('res.company', 'Company'),
}
_defaults = {
'active': lambda *a: 1,
+ 'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.routing', context=context)
}
mrp_routing()
@@ -103,7 +105,8 @@ class mrp_routing_workcenter(osv.osv):
'routing_id': fields.many2one('mrp.routing', 'Parent Routing', select=True, ondelete='cascade',
help="Routing indicates all the workcenters used, for how long and/or cycles." \
"If Routing is indicated then,the third tab of a production order (workcenters) will be automatically pre-completed."),
- 'note': fields.text('Description')
+ 'note': fields.text('Description'),
+ 'company_id': fields.related('routing_id', 'company_id', type='many2one', relation='res.company', string='Company'),
}
_defaults = {
'cycle_nbr': lambda *a: 1.0,
@@ -192,7 +195,7 @@ class mrp_bom(osv.osv):
'product_qty': fields.float('Product Qty', required=True),
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True, help="UoM (Unit of Measure) is the unit of measurement for the inventory control"),
'product_rounding': fields.float('Product Rounding', help="Rounding applied on the product quantity."),
- 'product_efficiency': fields.float('Product Efficiency', required=True, help="Material efficiency. A factor of 0.9 means a loss of 10% in the production."),
+ 'product_efficiency': fields.float('Manufacturing Efficiency', required=True, help="A factor of 0.9 means a loss of 10% within the production process."),
'bom_lines': fields.one2many('mrp.bom', 'bom_id', 'BoM Lines'),
'bom_id': fields.many2one('mrp.bom', 'Parent BoM', ondelete='cascade', select=True),
'routing_id': fields.many2one('mrp.routing', 'Routing', help="The list of operations (list of workcenters) to produce the finished product. The routing is mainly used to compute workcenter costs during operations and to plan future loads on workcenters based on production planning."),
@@ -441,7 +444,7 @@ class mrp_production(osv.osv):
'origin': fields.char('Source Document', size=64, help="Reference of the document that generated this production order request."),
'priority': fields.selection([('0','Not urgent'),('1','Normal'),('2','Urgent'),('3','Very Urgent')], 'Priority'),
- 'product_id': fields.many2one('product.product', 'Product', required=True, domain=[('type','<>','service')]),
+ 'product_id': fields.many2one('product.product', 'Product', required=True, ),
'product_qty': fields.float('Product Qty', required=True, states={'draft':[('readonly',False)]}, readonly=True),
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True, states={'draft':[('readonly',False)]}, readonly=True),
'product_uos_qty': fields.float('Product UoS Qty', states={'draft':[('readonly',False)]}, readonly=True),
@@ -951,7 +954,7 @@ class mrp_production_workcenter_line(osv.osv):
'cycle': fields.float('Nbr of cycles', digits=(16,2)),
'hour': fields.float('Nbr of hours', digits=(16,2)),
'sequence': fields.integer('Sequence', required=True, help="Gives the sequence order when displaying a list of work orders."),
- 'production_id': fields.many2one('mrp.production', 'Production Order', select=True, ondelete='cascade'),
+ 'production_id': fields.many2one('mrp.production', 'Production Order', select=True, ondelete='cascade', required=True),
}
_defaults = {
'sequence': lambda *a: 1,
diff --git a/addons/mrp/mrp_demo.xml b/addons/mrp/mrp_demo.xml
index e9c4f9f37b2..cea5c60ee56 100644
--- a/addons/mrp/mrp_demo.xml
+++ b/addons/mrp/mrp_demo.xml
@@ -701,6 +701,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index c946777b219..ca488ac0818 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -129,7 +129,6 @@
-
@@ -145,31 +144,31 @@
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -185,14 +184,14 @@
-
-
-
+
+
+
+
+
-
-
@@ -222,9 +221,11 @@
+
+
@@ -238,9 +239,10 @@
-
+
+
@@ -253,10 +255,13 @@
form
@@ -286,9 +292,16 @@
search
+
+
+
+
+
+
+
@@ -320,11 +333,11 @@
-
-
+
+
-
+
@@ -410,7 +423,7 @@
- Master Bill of Materials
+ Bill of Materials
ir.actions.act_window
mrp.bom
form
@@ -566,8 +579,9 @@
-
+
@@ -578,10 +592,10 @@
-
-
-
-
+
+
+
+
-
+
+
-
+
+
- Manufacturing Orders Planning
+ Manufacturing Orders
ir.actions.act_window
mrp.production
form
- tree,form,calendar,graph
+ calendar,tree,form,graph
[('state','in',('ready','confirmed','in_production'))]
Manufacturing Orders describe the operations that need to be carried out and the raw materials usage for each stage of production. You use specifications (bills of materials or BoM) to work out the raw material requirements and the manufacturing orders needed for the finished products. Once the bills of materials have been defined, OpenERP becomes capable of automatically deciding on the manufacturing route depending on the needs of the company.
@@ -911,13 +923,20 @@
-
-
+
+
+
+
+
+
diff --git a/addons/mrp/procurement.py b/addons/mrp/procurement.py
index 9af65a473a3..67d0cd1c739 100644
--- a/addons/mrp/procurement.py
+++ b/addons/mrp/procurement.py
@@ -19,7 +19,8 @@
#
##############################################################################
-from mx import DateTime
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
from osv import fields
from osv import osv
from tools.translate import _
@@ -81,8 +82,8 @@ class procurement_order(osv.osv):
for procurement in procurement_obj.browse(cr, uid, ids):
res_id = procurement.move_id.id
loc_id = procurement.location_id.id
- newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S') - DateTime.RelativeDateTime(days=procurement.product_id.product_tmpl_id.produce_delay or 0.0)
- newdate = newdate - DateTime.RelativeDateTime(days=company.manufacturing_lead)
+ newdate = datetime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S') - relativedelta(days=procurement.product_id.product_tmpl_id.produce_delay or 0.0)
+ newdate = newdate - relativedelta(days=company.manufacturing_lead)
produce_id = production_obj.create(cr, uid, {
'origin': procurement.origin,
'product_id': procurement.product_id.id,
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
index 61a0c641a24..dd7f592dfb3 100644
--- a/addons/mrp/report/mrp_production_order_view.xml
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -128,7 +128,7 @@
-
+
diff --git a/addons/mrp/report/mrp_report_view.xml b/addons/mrp/report/mrp_report_view.xml
index db628eb5431..71389233391 100644
--- a/addons/mrp/report/mrp_report_view.xml
+++ b/addons/mrp/report/mrp_report_view.xml
@@ -51,9 +51,6 @@
-
@@ -101,10 +98,6 @@
graph,tree
Weekly Stock Value Variation enables you to track the stock value evolution linked to manufacturing activities, receptions of products and delivery orders.
-
-
-
diff --git a/addons/mrp/security/mrp_security.xml b/addons/mrp/security/mrp_security.xml
index 406371a89dd..b105e1cbb8a 100644
--- a/addons/mrp/security/mrp_security.xml
+++ b/addons/mrp/security/mrp_security.xml
@@ -10,28 +10,28 @@
-
-
-
-
+
+
+
+
- mrp_production multi-company
+ mrp_production multi-company
['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
- mrp_workcenter multi-company
+ mrp_workcenter multi-company
['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
- mrp_bom multi-company
+ mrp_bom multi-company
['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py
index 9f149dda6bd..caed38654ac 100644
--- a/addons/mrp/stock.py
+++ b/addons/mrp/stock.py
@@ -19,13 +19,9 @@
#
##############################################################################
-from mx import DateTime
from osv import fields
from osv import osv
-from tools.translate import _
-import ir
import netsvc
-import time
class StockMove(osv.osv):
@@ -132,6 +128,7 @@ class StockMove(osv.osv):
wf_service = netsvc.LocalService("workflow")
for move in self.browse(cr, uid, ids):
new_moves = super(StockMove, self).action_scrap(cr, uid, [move.id], product_qty, location_id, context=context)
+ self.write(cr, uid, [move.id], {'prodlot_id': False, 'tracking_id': False})
production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])])
for prod_id in production_ids:
wf_service.trg_validate(uid, 'mrp.production', prod_id, 'button_produce', cr)
diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py
index f5d62d535c9..0cee5ea60a3 100644
--- a/addons/mrp/wizard/change_production_qty.py
+++ b/addons/mrp/wizard/change_production_qty.py
@@ -19,11 +19,7 @@
#
##############################################################################
-import time
-import ir
-from osv.osv import except_osv
from osv import fields, osv
-import netsvc
from tools.translate import _
class change_production_qty(osv.osv_memory):
@@ -63,7 +59,6 @@ class change_production_qty(osv.osv_memory):
record_id = context and context.get('active_id',False)
assert record_id, _('Active Id is not found')
prod_obj = self.pool.get('mrp.production')
- product_lines_obj = self.pool.get('mrp.production.product.line')
bom_obj = self.pool.get('mrp.bom')
for wiz_qty in self.browse(cr, uid, ids):
prod = prod_obj.browse(cr, uid,record_id)
diff --git a/addons/mrp_operations/__openerp__.py b/addons/mrp_operations/__openerp__.py
index 5170cc4c627..2b75c24229f 100644
--- a/addons/mrp_operations/__openerp__.py
+++ b/addons/mrp_operations/__openerp__.py
@@ -58,6 +58,7 @@
'mrp_operations_workflow.xml',
'mrp_operations_view.xml',
'mrp_operations_report.xml',
+ 'report/mrp_workorder_analysis_view.xml',
'process/mrp_operation_process.xml'
],
'demo_xml': ['mrp_operation_data.xml'],
diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml
index cd208b2d5a6..23a351ed3da 100644
--- a/addons/mrp_operations/mrp_operations_view.xml
+++ b/addons/mrp_operations/mrp_operations_view.xml
@@ -1,9 +1,6 @@
-
mrp.production.form.inherit
@@ -13,6 +10,7 @@
+
@@ -49,14 +47,14 @@
tree
-
+
-
+
@@ -79,7 +77,7 @@
+
+ mrp.production.workcenter.line.resource.gantt
+ mrp.production.workcenter.line
+ gantt
+
+
+
+
+
+
+
+
+
+
+
+ Resources
+ ir.actions.act_window
+ mrp.production.workcenter.line
+ form
+ [('production_state','in',('ready','confirmed','in_production'))]
+ gantt
+
+
+
@@ -249,19 +271,19 @@
-
-
+
diff --git a/addons/mrp_operations/report/__init__.py b/addons/mrp_operations/report/__init__.py
index 36db08542a9..6a2f6499bfe 100644
--- a/addons/mrp_operations/report/__init__.py
+++ b/addons/mrp_operations/report/__init__.py
@@ -21,5 +21,6 @@
import mrp_wc_barcode
import mrp_code_barcode
+import mrp_workorder_analysis
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp_operations/report/mrp_workorder_analysis.py b/addons/mrp_operations/report/mrp_workorder_analysis.py
new file mode 100644
index 00000000000..47fb562e96a
--- /dev/null
+++ b/addons/mrp_operations/report/mrp_workorder_analysis.py
@@ -0,0 +1,75 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import fields,osv
+import tools
+
+class mrp_workorder(osv.osv):
+ _name = "mrp.workorder"
+ _description = "Work Order Report"
+ _auto = False
+ _columns = {
+ 'year': fields.char('Year', size=64, readonly=True),
+ 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
+ ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
+ 'day': fields.char('Day', size=64, readonly=True),
+ 'nbr': fields.integer('# of Lines', readonly=True),
+ 'date': fields.date('Date', readonly=True),
+ 'product_id': fields.many2one('product.product', 'Product', readonly=True),
+ 'product_qty': fields.float('Product Qty', readonly=True),
+ 'state': fields.selection([('draft','Draft'),('startworking', 'In Progress'),('pause','Pause'),('cancel','Cancelled'),('done','Finished')],'State', readonly=True),
+ 'total_hours': fields.float('Total Hours', readonly=True),
+ 'total_cycles': fields.float('Total Cycles', readonly=True),
+ 'delay': fields.float('Delay', readonly=True),
+ 'production_id': fields.many2one('mrp.production', 'Production', readonly=True),
+ 'workcenter_id': fields.many2one('mrp.workcenter', 'Workcenter', readonly=True)
+ }
+
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'mrp_workorder')
+ cr.execute("""
+ create or replace view mrp_workorder as (
+ select
+ to_date(to_char(wl.date_planned, 'MM-dd-YYYY'),'MM-dd-YYYY') as date,
+ to_char(wl.date_planned, 'YYYY') as year,
+ to_char(wl.date_planned, 'MM') as month,
+ to_char(wl.date_planned, 'YYYY-MM-DD') as day,
+ min(wl.id) as id,
+ mp.product_id as product_id,
+ sum(wl.hour) as total_hours,
+ avg(wl.delay) as delay,
+ (w.costs_hour*sum(wl.hour)) as total_cost,
+ wl.production_id as production_id,
+ wl.workcenter_id as workcenter_id,
+ sum(wl.cycle) as total_cycles,
+ count(*) as nbr,
+ sum(mp.product_qty) as product_qty,
+ wl.state as state
+ from mrp_production_workcenter_line wl
+ left join mrp_workcenter w on (w.id = wl.workcenter_id)
+ left join mrp_production mp on (mp.id = wl.production_id)
+ group by
+ w.costs_hour, mp.product_id, mp.name, wl.state, wl.date_planned, wl.production_id, wl.workcenter_id
+ )""")
+
+mrp_workorder()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp_operations/report/mrp_workorder_analysis_view.xml b/addons/mrp_operations/report/mrp_workorder_analysis_view.xml
new file mode 100644
index 00000000000..6052feb1936
--- /dev/null
+++ b/addons/mrp_operations/report/mrp_workorder_analysis_view.xml
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+ mrp.workorder.tree
+ mrp.workorder
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mrp.workorder.graph
+ mrp.workorder
+ graph
+
+
+
+
+
+
+
+
+
+ mrp.workorder.select
+ mrp.workorder
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Work Order
+ mrp.workorder
+ form
+ graph,tree
+
+
+ {'search_default_Workcenter': 1,'search_default_month':1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+
+ tree
+
+
+
+
+
+
+ graph
+
+
+
+
+
+
+
+
diff --git a/addons/mrp_operations/security/ir.model.access.csv b/addons/mrp_operations/security/ir.model.access.csv
index f0ee723292f..c27d8fd66e5 100755
--- a/addons/mrp_operations/security/ir.model.access.csv
+++ b/addons/mrp_operations/security/ir.model.access.csv
@@ -7,3 +7,4 @@
"access_mrp_production_manager","mrp_production_manager","model_mrp_production","mrp.group_mrp_manager",1,0,0,0
"access_mrp_production_workcenter_line","mrp.production.workcenter.line","mrp.model_mrp_production_workcenter_line","mrp.group_mrp_user",1,1,1,1
"access_mrp_production_workcenter_line_manager","mrp.production.workcenter.line.manager","mrp.model_mrp_production_workcenter_line","mrp.group_mrp_manager",1,0,0,0
+"access_mrp_workorder_manager","mrp.workorder.manager","model_mrp_workorder","mrp.group_mrp_manager",1,1,1,1
diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py
index 5848fa7057c..53b10b6eab2 100644
--- a/addons/mrp_repair/mrp_repair.py
+++ b/addons/mrp_repair/mrp_repair.py
@@ -222,7 +222,7 @@ class mrp_repair(osv.osv):
if move_id:
move = self.pool.get('stock.move').browse(cr, uid, move_id)
product = self.pool.get('product.product').browse(cr, uid, prod_id)
- limit = datetime.strptime(move.date_planned, '%Y-%m-%d %H:%M:%S') + relativedelta(months=product.warranty)
+ limit = datetime.strptime(move.date_expected, '%Y-%m-%d %H:%M:%S') + relativedelta(months=product.warranty)
data['value']['guarantee_limit'] = limit.strftime('%Y-%m-%d')
data['value']['location_id'] = move.location_dest_id.id
data['value']['location_dest_id'] = move.location_dest_id.id
diff --git a/addons/mrp_subproduct/mrp_subproduct.py b/addons/mrp_subproduct/mrp_subproduct.py
index 5519bba3a5c..e271e2bfb26 100644
--- a/addons/mrp_subproduct/mrp_subproduct.py
+++ b/addons/mrp_subproduct/mrp_subproduct.py
@@ -95,7 +95,7 @@ class mrp_production(osv.osv):
'state': 'waiting',
'production_id': production.id
}
- sub_prod_ids = self.pool.get('stock.move').create(cr, uid, data)
+ self.pool.get('stock.move').create(cr, uid, data)
return picking_id
mrp_production()
diff --git a/addons/point_of_sale/account_bank_statement.py b/addons/point_of_sale/account_bank_statement.py
index c24dc221596..1d5c833ccbf 100644
--- a/addons/point_of_sale/account_bank_statement.py
+++ b/addons/point_of_sale/account_bank_statement.py
@@ -63,6 +63,30 @@ class account_cash_statement(osv.osv):
return res
+ def _get_cash_open_box_lines(self, cr, uid, context={}):
+ res = super(account_cash_statement,self)._get_cash_open_box_lines(cr, uid, context)
+ curr = [0.01, 0.02, 0.05, 0.10, 0.20, 0.50]
+ for rs in curr:
+ dct = {
+ 'pieces':rs,
+ 'number':0
+ }
+ res.append(dct)
+ res.sort()
+ return res
+
+ def _get_default_cash_close_box_lines(self, cr, uid, context={}):
+ res = super(account_cash_statement,self)._get_default_cash_close_box_lines(cr, uid, context)
+ curr = [0.01, 0.02, 0.05, 0.10, 0.20, 0.50]
+ for rs in curr:
+ dct = {
+ 'pieces':rs,
+ 'number':0
+ }
+ res.append(dct)
+ res.sort()
+ return res
+
account_cash_statement()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py
index a5bdf5ec0f8..6429e21c08d 100644
--- a/addons/point_of_sale/pos.py
+++ b/addons/point_of_sale/pos.py
@@ -22,7 +22,8 @@
import time
import netsvc
from osv import fields, osv
-from mx import DateTime
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
from tools.translate import _
from decimal import Decimal
import decimal_precision as dp
@@ -337,7 +338,7 @@ class pos_order(osv.osv):
'price_type': lambda *a: 'tax_excluded',
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'pos.order'),
'date_order': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
- 'date_validity': lambda *a: (DateTime.now() + DateTime.RelativeDateTime(months=+6)).strftime('%Y-%m-%d'),
+ 'date_validity': lambda *a: (datetime.today() + relativedelta(months=+6)).strftime('%Y-%m-%d'),
'nb_print': lambda *a: 0,
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
'sale_journal': _sale_journal_get,
@@ -1268,8 +1269,8 @@ class product_product(osv.osv):
_columns = {
'income_pdt': fields.boolean('Product for Input'),
'expense_pdt': fields.boolean('Product for expenses'),
- 'am_out': fields.boolean('Controle for Output Operations'),
- 'disc_controle': fields.boolean('Discount Controle '),
+ 'am_out': fields.boolean('Control for Output Operations'),
+ 'disc_controle': fields.boolean('Discount Control'),
}
_defaults = {
'disc_controle': lambda *a: True,
diff --git a/addons/point_of_sale/report/pos_details_summary.py b/addons/point_of_sale/report/pos_details_summary.py
index 30cfdd7063c..4c20649b5bf 100644
--- a/addons/point_of_sale/report/pos_details_summary.py
+++ b/addons/point_of_sale/report/pos_details_summary.py
@@ -20,7 +20,6 @@
##############################################################################
import time
-from datetime import datetime
from report import report_sxw
diff --git a/addons/point_of_sale/report/pos_receipt.py b/addons/point_of_sale/report/pos_receipt.py
index 9be543fb89b..40924003e1c 100644
--- a/addons/point_of_sale/report/pos_receipt.py
+++ b/addons/point_of_sale/report/pos_receipt.py
@@ -24,7 +24,6 @@ from report import report_sxw
import pooler
def titlize(journal_name):
- res = []
words = journal_name.split()
while words.pop() != 'journal':
continue
diff --git a/addons/point_of_sale/security/point_of_sale_security.xml b/addons/point_of_sale/security/point_of_sale_security.xml
index 6163d65a36f..d70fd1caa85 100644
--- a/addons/point_of_sale/security/point_of_sale_security.xml
+++ b/addons/point_of_sale/security/point_of_sale_security.xml
@@ -8,13 +8,6 @@
Point of Sale / User
-
-
- Registers
-
-
- [('user_id','!=',['base.user_root'])]
-
diff --git a/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.py b/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.py
index 93c25d62e96..58f78902a14 100644
--- a/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.py
+++ b/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.py
@@ -22,7 +22,6 @@
import netsvc
from osv import osv,fields
from tools.translate import _
-from mx import DateTime
import time
class all_closed_cashbox_of_the_day(osv.osv_memory):
diff --git a/addons/point_of_sale/wizard/pos_box_out.py b/addons/point_of_sale/wizard/pos_box_out.py
index 92e7dded432..e4aebe2cc1d 100644
--- a/addons/point_of_sale/wizard/pos_box_out.py
+++ b/addons/point_of_sale/wizard/pos_box_out.py
@@ -22,7 +22,8 @@
from osv import osv, fields
import time
from tools.translate import _
-from mx import DateTime
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
import pos_box_entries
@@ -78,8 +79,8 @@ class pos_box_out(osv.osv_memory):
for data in self.read(cr, uid, ids):
curr_company = res_obj.browse(cr, uid, uid).company_id.id
statement_id = statement_obj.search(cr, uid, [('journal_id', '=', data['journal_id']), ('company_id', '=', curr_company), ('user_id', '=', uid), ('state', '=', 'open')])
- monday = (DateTime.now() + DateTime.RelativeDateTime(weekday=(DateTime.Monday, 0))).strftime('%Y-%m-%d')
- sunday = (DateTime.now() + DateTime.RelativeDateTime(weekday=(DateTime.Sunday, 0))).strftime('%Y-%m-%d')
+ monday = (datetime.today() + relativedelta(weekday=0)).strftime('%Y-%m-%d')
+ sunday = (datetime.today() + relativedelta(weekday=6)).strftime('%Y-%m-%d')
done_statmt = statement_obj.search(cr, uid, [('date', '>=', monday+' 00:00:00'), ('date', '<=', sunday+' 23:59:59'), ('journal_id', '=', data['journal_id']), ('company_id', '=', curr_company), ('user_id', '=', uid)])
stat_done = statement_obj.browse(cr, uid, done_statmt)
address_u = res_obj.browse(cr, uid, uid).address_id
diff --git a/addons/procurement/schedulers.py b/addons/procurement/schedulers.py
index 1bfa6e3d851..b3d3c3bb98d 100644
--- a/addons/procurement/schedulers.py
+++ b/addons/procurement/schedulers.py
@@ -20,8 +20,8 @@
##############################################################################
import time
-from mx import DateTime
-
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
from osv import osv
from tools.translate import _
import tools
@@ -59,7 +59,7 @@ class procurement_order(osv.osv):
if use_new_cursor:
cr.commit()
company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id
- maxdate = (DateTime.now() + DateTime.RelativeDateTime(days=company.schedule_range)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
+ maxdate = (datetime.today() + relativedelta(days=company.schedule_range)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
start_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
offset = 0
report = []
@@ -166,7 +166,7 @@ class procurement_order(osv.osv):
if product.virtual_available >= 0.0:
continue
- newdate = DateTime.now()
+ newdate = datetime.today()
if product.supply_method == 'buy':
location_id = warehouse.lot_input_id.id
elif product.supply_method == 'produce':
@@ -228,14 +228,8 @@ class procurement_order(osv.osv):
reste = qty % op.qty_multiple
if reste > 0:
qty += op.qty_multiple - reste
- newdate = DateTime.now() + DateTime.RelativeDateTime(
+ newdate = datetime.today() + relativedelta(
days = int(op.product_id.seller_delay))
- if op.product_id.supply_method == 'buy':
- location_id = op.warehouse_id.lot_input_id
- elif op.product_id.supply_method == 'produce':
- location_id = op.warehouse_id.lot_stock_id
- else:
- continue
if qty <= 0:
continue
if op.product_id.type not in ('consu'):
diff --git a/addons/procurement/security/procurement_security.xml b/addons/procurement/security/procurement_security.xml
index cf32286fd2f..b6b15d565c6 100644
--- a/addons/procurement/security/procurement_security.xml
+++ b/addons/procurement/security/procurement_security.xml
@@ -1,20 +1,20 @@
-
-
-
- procurement multi-company
-
-
- ['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
-
-
-
- stock_warehouse.orderpoint multi-company
-
-
- ['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
-
-
-
-
\ No newline at end of file
+
+
+
+ procurement multi-company
+
+
+ ['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
+
+
+
+ stock_warehouse.orderpoint multi-company
+
+
+ ['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
+
+
+
+
diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py
index 90d55d47251..4831123e07c 100644
--- a/addons/product/pricelist.py
+++ b/addons/product/pricelist.py
@@ -126,161 +126,6 @@ class product_pricelist(osv.osv):
"currency_id": _get_currency
}
- def price_get_multi_old(self, cr, uid, product_map, context=None):
- """multi products 'price_get'
- @param context: {
- 'date': Date of the pricelist (%Y-%m-%d),
- @return: a dict with product_id as key and the product price as value
- }
- """
-
- def _create_parent_category_list(id, lst):
- if not id:
- return []
- parent = product_category_tree.get(id)
- if parent:
- lst.append(parent)
- return _create_parent_category_list(parent, lst)
- else:
- return lst
- # _create_parent_category_list
-
- context = context or {}
-
- # XXX
- date = time.strftime('%Y-%m-%d')
- if 'date' in context:
- date = context['date']
-
- currency_obj = self.pool.get('res.currency')
- product_obj = self.pool.get('product.product')
- product_category_obj = self.pool.get('product.category')
- product_uom_obj = self.pool.get('product.uom')
- supplierinfo_obj = self.pool.get('product.supplierinfo')
- price_type_obj = self.pool.get('product.price.type')
- product_pricelist_version_obj = self.pool.get('product.pricelist.version')
-
- # product.pricelist.version:
- pricelist_version_ids = list(set([k[1] for k in product_map.keys()]))
- plversions_search_args = [
- ('pricelist_id', 'in', pricelist_version_ids),
- '|',
- ('date_start', '=', False),
- ('date_start', '<=', date),
- '|',
- ('date_end', '=', False),
- ('date_end', '>=', date),
- ]
-
- plversion_ids = product_pricelist_version_obj.search(cr, uid, plversions_search_args)
- if len(pricelist_version_ids) != len(plversion_ids):
- msg = "At least one pricelist has no active version !\nPlease create or activate one."
- raise osv.except_osv(_('Warning !'), _(msg))
-
- # product.product:
- product_ids = list(set([k[0] for k in product_map.keys()]))
- products = dict([(item['id'], item) for item in product_obj.read(cr, uid, product_ids, ['categ_id', 'product_tmpl_id', 'uos_id', 'uom_id'])])
-
- # product.category:
- product_category_ids = product_category_obj.search(cr, uid, [])
- product_categories = product_category_obj.read(cr, uid, product_category_ids, ['parent_id'])
- product_category_tree = dict([(item['id'], item['parent_id'][0]) for item in product_categories if item['parent_id']])
-
- results = {}
- for (product_id, pricelist_id), line in product_map.items():
- price = False
-
- partner = line['partner_id']
- qty = line['qty']
- tmpl_id = products[product_id]['product_tmpl_id'] and products[product_id]['product_tmpl_id'][0] or False
-
- categ_id = products[product_id]['categ_id'] and products[product_id]['categ_id'][0] or False
- categ_ids = _create_parent_category_list(categ_id, [categ_id])
- if categ_ids:
- categ_where = '(categ_id IN (' + ','.join(map(str, categ_ids)) + '))'
- else:
- categ_where = '(categ_id IS NULL)'
-
- cr.execute(
- 'SELECT i.*, pl.currency_id '
- 'FROM product_pricelist_item AS i, '
- 'product_pricelist_version AS v, product_pricelist AS pl '
- 'WHERE (product_tmpl_id IS NULL OR product_tmpl_id = %s) '
- 'AND (product_id IS NULL OR product_id = %s) '
- 'AND (' + categ_where + ' OR (categ_id IS NULL)) '
- 'AND price_version_id = %s '
- 'AND (min_quantity IS NULL OR min_quantity <= %s) '
- 'AND i.price_version_id = v.id AND v.pricelist_id = pl.id '
- 'ORDER BY sequence',
- (tmpl_id, product_id, pricelist_id, qty))
- res1 = cr.dictfetchall()
-
- for res in res1:
- if res:
- if res['base'] == -1:
- if not res['base_pricelist_id']:
- price = 0.0
- else:
- price_tmp = self.price_get(cr, uid,
- [res['base_pricelist_id']], product_id,
- qty)[res['base_pricelist_id']]
- ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id
- price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False)
- break
- elif res['base'] == -2:
- # this section could be improved by moving the queries outside the loop:
- where = []
- if partner:
- where = [('name', '=', partner) ]
- sinfo = supplierinfo_obj.search(cr, uid,
- [('product_id', '=', tmpl_id)] + where)
- price = 0.0
- if sinfo:
- cr.execute('SELECT * ' \
- 'FROM pricelist_partnerinfo ' \
- 'WHERE suppinfo_id IN %s' \
- 'AND min_quantity <= %s ' \
- 'ORDER BY min_quantity DESC LIMIT 1', (tuple(sinfo),qty,))
- res2 = cr.dictfetchone()
- if res2:
- price = res2['price']
- break
- else:
- price_type = price_type_obj.browse(cr, uid, int(res['base']))
- price = currency_obj.compute(cr, uid,
- price_type.currency_id.id, res['currency_id'],
- product_obj.price_get(cr, uid, [product_id],
- price_type.field)[product_id], round=False, context=context)
-
- if price:
- price_limit = price
-
- price = price * (1.0+(res['price_discount'] or 0.0))
- price = rounding(price, res['price_round'])
- price += (res['price_surcharge'] or 0.0)
- if res['price_min_margin']:
- price = max(price, price_limit+res['price_min_margin'])
- if res['price_max_margin']:
- price = min(price, price_limit+res['price_max_margin'])
- break
-
- else:
- # False means no valid line found ! But we may not raise an
- # exception here because it breaks the search
- price = False
-
- if price:
- p_uom_id = products[product_id]['uos_id'] and products[product_id]['uos_id'][0] or products[product_id]['uom_id'] and products[product_id]['uom_id'][0] or False
- if p_uom_id:
- price = product_uom_obj._compute_price(cr, uid, p_uom_id, price, context.get('uom', False))
-
- if results.get(product_id):
- results[product_id][pricelist_id] = price
- else:
- results[product_id] = {pricelist_id: price}
-
- return results
-
#def price_get_multi(self, cr, uid, product_ids, context=None):
def price_get_multi(self, cr, uid, pricelist_ids, products_by_qty_by_partner, context=None):
"""multi products 'price_get'.
@@ -392,7 +237,6 @@ class product_pricelist(osv.osv):
qty)[res['base_pricelist_id']]
ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id
price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False)
- break
elif res['base'] == -2:
# this section could be improved by moving the queries outside the loop:
where = []
@@ -410,7 +254,6 @@ class product_pricelist(osv.osv):
res2 = cr.dictfetchone()
if res2:
price = res2['price']
- break
else:
price_type = price_type_obj.browse(cr, uid, int(res['base']))
price = currency_obj.compute(cr, uid,
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index d0107c56ffe..2bd4e95f29d 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -254,7 +254,7 @@
[('parent_id','=',False)]
tree
- Create and manage product categories you want to be maintained in the system. This allows you to classify your products according to your needs.
+ Here is a list of all your products classified by category. You can click on a category to get the list of all products linked to this category or to a child of this category.
['|','|','|',('user_id','=',False),('user_id','=',user.id),('project_id.members','in', [user.id]),('project_id.user_id','=',user.id)]
-
-
-
- Projects According to User
-
-
- [('user_id','=',user.id)]
+
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 57b9a477ac9..91b361c19ee 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -19,16 +19,13 @@
#
##############################################################################
-from mx import DateTime
import time
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
@@ -391,8 +388,6 @@ class purchase_order(osv.osv):
return False
def action_cancel(self, cr, uid, ids, context={}):
- ok = True
- purchase_order_line_obj = self.pool.get('purchase.order.line')
for purchase in self.browse(cr, uid, ids):
for pick in purchase.picking_ids:
if pick.state not in ('draft','cancel'):
@@ -691,7 +686,6 @@ class purchase_order_line(osv.osv):
'product_uom': uom}}
domain = {}
- partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
taxes = self.pool.get('account.tax').browse(cr, uid,map(lambda x: x.id, prod.supplier_taxes_id))
fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False
res['value']['taxes_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)
@@ -764,9 +758,8 @@ class procurement_order(osv.osv):
price = pricelist_obj.price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, False, {'uom': uom_id})[pricelist_id]
- newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S')
- newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead)
- newdate = newdate - seller_delay
+ newdate = datetime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S')
+ newdate = (newdate - relativedelta(days=company.po_lead)) - relativedelta(days=seller_delay)
#Passing partner_id to context for purchase order line integrity of Line name
context.update({'lang': partner.lang, 'partner_id': partner_id})
diff --git a/addons/purchase_requisition/security/purchase_tender.xml b/addons/purchase_requisition/security/purchase_tender.xml
index ebee3d040c2..9ccab8fdbb9 100644
--- a/addons/purchase_requisition/security/purchase_tender.xml
+++ b/addons/purchase_requisition/security/purchase_tender.xml
@@ -10,7 +10,7 @@
- Purchase Requisition multi-company
+ Purchase Requisition multi-company
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
diff --git a/addons/purchase_requisition/wizard/purchase_requisition_partner.py b/addons/purchase_requisition/wizard/purchase_requisition_partner.py
index 297286ce472..2ae3ae795e9 100644
--- a/addons/purchase_requisition/wizard/purchase_requisition_partner.py
+++ b/addons/purchase_requisition/wizard/purchase_requisition_partner.py
@@ -20,8 +20,8 @@
##############################################################################
import time
-from mx import DateTime
-
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
from osv import fields, osv
from osv.orm import browse_record, browse_null
@@ -84,10 +84,10 @@ class purchase_requisition_partner(osv.osv_memory):
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
- newdate = DateTime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S')
- newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead)
+ newdate = datetime.strptime(tender.date_start, '%Y-%m-%d %H:%M:%S')
+ newdate = newdate - relativedelta(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') )
+ 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
price = pricelist_obj.price_get(cr, uid, [pricelist_id], line.product_id.id, line.product_qty, False, {'uom': uom_id})[pricelist_id]
diff --git a/addons/resource/resource.py b/addons/resource/resource.py
index 24efc179c03..5401c052dce 100644
--- a/addons/resource/resource.py
+++ b/addons/resource/resource.py
@@ -20,7 +20,6 @@
##############################################################################
from datetime import datetime, timedelta
-from mx import DateTime
import math
from faces import *
from new import classobj
@@ -113,7 +112,7 @@ class resource_calendar(osv.osv):
results = {}
for d, hours, id in date_and_hours_by_cal:
- dt_from = DateTime.strptime(d, '%Y-%m-%d %H:%M:%S')
+ dt_from = datetime.strptime(d, '%Y-%m-%d %H:%M:%S')
if not id:
td = int(hours)*3
results[(d, hours, id)] = [(dt_from, dt_from + timedelta(hours=td))]
diff --git a/addons/resource/resource_view.xml b/addons/resource/resource_view.xml
index 801e363681f..b8f3d14df56 100644
--- a/addons/resource/resource_view.xml
+++ b/addons/resource/resource_view.xml
@@ -11,6 +11,8 @@
+
+
@@ -168,13 +170,19 @@
form
diff --git a/addons/sale/test/prepaid_order_policy.yml b/addons/sale/test/prepaid_order_policy.yml
index 16b391f3b0e..5df007d1465 100644
--- a/addons/sale/test/prepaid_order_policy.yml
+++ b/addons/sale/test/prepaid_order_policy.yml
@@ -41,8 +41,7 @@
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so1"))
picking_id = self.search(cr, uid, [('origin','=',so.name),('type','=','out')])
- if picking_id:
- assert picking_id,"There is a picking attached to this sale order"
+ assert not picking_id,"As the order policy is prepaid, the sale order shouldn't have already a picking."
-
I open the Invoice for the SO.
-
diff --git a/addons/stock/report/report_stock.py b/addons/stock/report/report_stock.py
index 9f23f325e35..6344fe2c044 100644
--- a/addons/stock/report/report_stock.py
+++ b/addons/stock/report/report_stock.py
@@ -29,7 +29,7 @@ class stock_report_prodlots(osv.osv):
_description = "Stock report by production lots"
_auto = False
_columns = {
- 'name': fields.float('Quantity', readonly=True),
+ 'qty': fields.float('Quantity', readonly=True),
'location_id': fields.many2one('stock.location', 'Location', readonly=True, select=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True, select=True),
'prodlot_id': fields.many2one('stock.production.lot', 'Production lot', readonly=True, select=True),
@@ -43,7 +43,7 @@ class stock_report_prodlots(osv.osv):
location_id,
product_id,
prodlot_id,
- sum(qty) as name
+ sum(qty) as qty
from (
select -max(sm.id) as id,
sm.location_id,
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 831b1dafcb5..101a412329c 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -842,7 +842,6 @@ class stock_picking(osv.osv):
""" Gets payment term from partner.
@return: Payment term
"""
- partner_obj = self.pool.get('res.partner')
partner = picking.address_id.partner_id
return partner.property_payment_term and partner.property_payment_term.id or False
@@ -1308,7 +1307,7 @@ class stock_production_lot(osv.osv):
if locations:
cr.execute('''select
prodlot_id,
- sum(name)
+ sum(qty)
from
stock_report_prodlots
where
@@ -1324,12 +1323,12 @@ class stock_production_lot(osv.osv):
locations = self.pool.get('stock.location').search(cr, uid, [('usage', '=', 'internal')])
cr.execute('''select
prodlot_id,
- sum(name)
+ sum(qty)
from
stock_report_prodlots
where
location_id IN %s group by prodlot_id
- having sum(name) '''+ str(args[0][1]) + str(args[0][2]),(tuple(locations),))
+ having sum(qty) '''+ str(args[0][1]) + str(args[0][2]),(tuple(locations),))
res = cr.fetchall()
ids = [('id', 'in', map(lambda x: x[0], res))]
return ids
@@ -1809,7 +1808,6 @@ class stock_move(osv.osv):
def setlast_tracking(self, cr, uid, ids, context=None):
tracking_obj = self.pool.get('stock.tracking')
- tracking = context.get('tracking', False)
picking = self.browse(cr, uid, ids)[0].picking_id
if picking:
last_track = [line.tracking_id.id for line in picking.move_lines if line.tracking_id]
@@ -2092,8 +2090,8 @@ class stock_move(osv.osv):
'state': move.state,
'scrapped' : True,
'location_dest_id': location_id,
- 'tracking_id':False,
- 'prodlot_id':False
+ 'tracking_id': move.tracking_id.id,
+ 'prodlot_id': move.prodlot_id.id,
}
new_move = self.copy(cr, uid, move.id, default_val)
@@ -2395,7 +2393,6 @@ class stock_inventory(osv.osv):
location_obj = self.pool.get('stock.location')
for inv in self.browse(cr, uid, ids):
move_ids = []
- move_line = []
for line in inv.inventory_line_id:
pid = line.product_id.id
product_context.update(uom=line.product_uom.id)
diff --git a/addons/stock_location/stock_location_view.xml b/addons/stock_location/stock_location_view.xml
index 96d3fd84809..3d08d48034e 100644
--- a/addons/stock_location/stock_location_view.xml
+++ b/addons/stock_location/stock_location_view.xml
@@ -71,24 +71,26 @@
-
+
-
diff --git a/addons/subscription/subscription.py b/addons/subscription/subscription.py
index 307f06c6f91..ef959a5fd67 100644
--- a/addons/subscription/subscription.py
+++ b/addons/subscription/subscription.py
@@ -22,7 +22,6 @@
# TODO:
# Error treatment: exception, request, ... -> send request to user_id
-from mx import DateTime
import time
from osv import fields,osv
from tools.translate import _