diff --git a/addons/account/account.py b/addons/account/account.py
index a771bed6144..1ced6bd88e8 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1563,65 +1563,64 @@ class account_config_fiscalyear(osv.osv_memory):
account_config_fiscalyear()
-
-class account_config_journal_bank_accounts(osv.osv_memory):
- _name='account.config.journal.bank.account'
- _columns = {
- 'name':fields.char('Journal Name', size=64),
- 'lines_id': fields.one2many('account.config.journal.bank.account.line', 'journal_id', 'Journal Lines'),
- }
-
- def action_cancel(self,cr,uid,ids,conect=None):
- return {
- 'view_type': 'form',
- "view_mode": 'form',
- 'res_model': 'ir.module.module.configuration.wizard',
- 'type': 'ir.actions.act_window',
- 'target':'new',
- }
-
- def action_create(self, cr, uid, ids, context=None):
- config_res=self.read(cr,uid,ids)[0]
- res_obj = self.pool.get('account.journal')
- line_obj=self.pool.get('account.config.journal.bank.account.line')
- if 'lines_id' in config_res and config_res['lines_id']:
- lines=line_obj.read(cr,uid,config_res['lines_id'])
- for res in lines:
- sequence_ids=self.pool.get('ir.sequence').search(cr,uid,[('name','=','Account Journal')])
- if 'name' in res and 'bank_account_id' in res and 'view_id' in res and sequence_ids and len(sequence_ids):
- vals={
- 'name':res['name'],
- 'type':'cash',
- 'view_id':res['view_id'],
- 'default_credit_account_id':res['bank_account_id'],
- 'default_debit_account_id':res['bank_account_id'],
- 'sequence_id':sequence_ids[0]
- }
- res_obj.create(cr, uid, vals, context=context)
- return {
- 'view_type': 'form',
- "view_mode": 'form',
- 'res_model': 'ir.module.module.configuration.wizard',
- 'type': 'ir.actions.act_window',
- 'target':'new',
- }
-
-account_config_journal_bank_accounts()
-
-class account_config_journal_bank_accounts_line(osv.osv_memory):
- _name='account.config.journal.bank.account.line'
- def _journal_view_get(self, cr, uid, context={}):
- journal_obj = self.pool.get('account.journal.view')
- ids = journal_obj.search(cr, uid, [])
- res = journal_obj.read(cr, uid, ids, ['id', 'name'], context)
- return [(r['id'], r['name']) for r in res]
- _columns = {
- 'name':fields.char('Journal Name', size=64,required=True),
- 'bank_account_id':fields.many2one('account.account', 'Bank Account', required=True, domain=[('type','=','cash')]),
- 'view_id':fields.selection(_journal_view_get, 'Journal View', required=True),
- 'journal_id':fields.many2one('account.config.journal.bank.account', 'Journal', required=True),
- }
-account_config_journal_bank_accounts_line()
+#class account_config_journal_bank_accounts(osv.osv_memory):
+# _name='account.config.journal.bank.account'
+# _columns = {
+# 'name':fields.char('Journal Name', size=64),
+# 'lines_id': fields.one2many('account.config.journal.bank.account.line', 'journal_id', 'Journal Lines'),
+# }
+#
+# def action_cancel(self,cr,uid,ids,conect=None):
+# return {
+# 'view_type': 'form',
+# "view_mode": 'form',
+# 'res_model': 'ir.module.module.configuration.wizard',
+# 'type': 'ir.actions.act_window',
+# 'target':'new',
+# }
+#
+# def action_create(self, cr, uid, ids, context=None):
+# config_res=self.read(cr,uid,ids)[0]
+# res_obj = self.pool.get('account.journal')
+# line_obj=self.pool.get('account.config.journal.bank.account.line')
+# if 'lines_id' in config_res and config_res['lines_id']:
+# lines=line_obj.read(cr,uid,config_res['lines_id'])
+# for res in lines:
+# sequence_ids=self.pool.get('ir.sequence').search(cr,uid,[('name','=','Account Journal')])
+# if 'name' in res and 'bank_account_id' in res and 'view_id' in res and sequence_ids and len(sequence_ids):
+# vals={
+# 'name':res['name'],
+# 'type':'cash',
+# 'view_id':res['view_id'],
+# 'default_credit_account_id':res['bank_account_id'],
+# 'default_debit_account_id':res['bank_account_id'],
+# 'sequence_id':sequence_ids[0]
+# }
+# res_obj.create(cr, uid, vals, context=context)
+# return {
+# 'view_type': 'form',
+# "view_mode": 'form',
+# 'res_model': 'ir.module.module.configuration.wizard',
+# 'type': 'ir.actions.act_window',
+# 'target':'new',
+# }
+#
+#account_config_journal_bank_accounts()
+#
+#class account_config_journal_bank_accounts_line(osv.osv_memory):
+# _name='account.config.journal.bank.account.line'
+# def _journal_view_get(self, cr, uid, context={}):
+# journal_obj = self.pool.get('account.journal.view')
+# ids = journal_obj.search(cr, uid, [])
+# res = journal_obj.read(cr, uid, ids, ['id', 'name'], context)
+# return [(r['id'], r['name']) for r in res]
+# _columns = {
+# 'name':fields.char('Journal Name', size=64,required=True),
+# 'bank_account_id':fields.many2one('account.account', 'Bank Account', required=True, domain=[('type','=','cash')]),
+# 'view_id':fields.selection(_journal_view_get, 'Journal View', required=True),
+# 'journal_id':fields.many2one('account.config.journal.bank.account', 'Journal', required=True),
+# }
+#account_config_journal_bank_accounts_line()
# ----------------------------------------------
# Account Templates : Account, Tax and charts.
@@ -1867,6 +1866,9 @@ class wizard_multi_charts_accounts(osv.osv_memory):
obj_journal = self.pool.get('account.journal')
obj_acc_template = self.pool.get('account.account.template')
+ if obj_multi.code_digits<=5:
+ raise osv.except_osv(_('User Error'), _('Account code should be of more than 5 digits.'))
+
# Creating Account
obj_acc_root = obj_multi.chart_template_id.account_root_id
tax_code_root_id = obj_multi.chart_template_id.tax_code_root_id.id
@@ -1889,7 +1891,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'name': (tax_code_root_id == tax_code_template.id) and obj_multi.company_id.name or tax_code_template.name,
'code': tax_code_template.code,
'info': tax_code_template.info,
- 'parent_id': tax_code_template.parent_id and tax_code_template_ref[tax_code_template.parent_id.id] or False,
+ 'parent_id': tax_code_template.parent_id and ((tax_code_template.parent_id.id in tax_code_template_ref) and tax_code_template_ref[tax_code_template.parent_id.id]) or False,
'company_id': company_id,
'sign': tax_code_template.sign,
}
@@ -1907,7 +1909,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'type':tax.type,
'applicable_type': tax.applicable_type,
'domain':tax.domain,
- 'parent_id': tax.parent_id and tax_template_ref[tax.parent_id.id] or False,
+ 'parent_id': tax.parent_id and ((tax.parent_id.id in tax_template_ref) and tax_template_ref[tax.parent_id.id]) or False,
'child_depend': tax.child_depend,
'python_compute': tax.python_compute,
'python_compute_inv': tax.python_compute_inv,
@@ -1933,7 +1935,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
}
tax_template_ref[tax.id] = new_tax
-
#deactivate the parent_store functionnality on account_account for rapidity purpose
self.pool._init = True
children_acc_template = obj_acc_template.search(cr, uid, [('parent_id','child_of',[obj_acc_root.id])])
@@ -1942,17 +1943,22 @@ class wizard_multi_charts_accounts(osv.osv_memory):
for tax in account_template.tax_ids:
tax_ids.append(tax_template_ref[tax.id])
#create the account_account
+ dig=obj_multi.code_digits
+ code_main=len(account_template.code)
+ code_acc=account_template.code
+ if code_main<=dig:
+ code_acc=str(code_acc) + (str('0'*(dig-code_main)))
vals={
'name': (obj_acc_root.id == account_template.id) and obj_multi.company_id.name or account_template.name,
#'sign': account_template.sign,
'currency_id': account_template.currency_id and account_template.currency_id.id or False,
- 'code': account_template.code,
+ 'code': code_acc[:dig],
'type': account_template.type,
'user_type': account_template.user_type or False,
'reconcile': account_template.reconcile,
'shortcut': account_template.shortcut,
'note': account_template.note,
- 'parent_id': account_template.parent_id and acc_template_ref[account_template.parent_id.id] or False,
+ 'parent_id': account_template.parent_id and ((account_template.parent_id.id in acc_template_ref) and acc_template_ref[account_template.parent_id.id]) or False,
'tax_ids': [(6,0,tax_ids)],
'company_id': company_id,
}
@@ -2015,7 +2021,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
#'sign': ref_acc_bank.sign,
'currency_id': line.currency_id and line.currency_id.id or False,
'code': ref_acc_bank.code+str(current_num),
- 'type': 'cash',
+ 'type': 'other',
'user_type': account_template.user_type or False,
'reconcile': True,
'parent_id': acc_template_ref[ref_acc_bank.id] or False,
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 3634535b2d0..36b0f97f31b 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -17,6 +17,17 @@
+
+ account.invoice.graph
+ account.invoice
+ graph
+
+
+
+
+
+
+
account.invoice.line.tree
account.invoice.line
@@ -274,7 +285,7 @@
Invoices
account.invoice
form
- tree,form,calendar
+ tree,form,calendar,graph
{'type':'out_invoice'}
@@ -295,7 +306,7 @@
Customer Invoices
account.invoice
form
- tree,form,calendar
+ tree,form,calendar,graph
[('type','=','out_invoice')]
{'type':'out_invoice'}
@@ -305,7 +316,7 @@
New Customer Invoice
account.invoice
form
- form,tree,calendar
+ form,tree,calendar,graph
[('type','=','out_invoice')]
{'type':'out_invoice'}
@@ -316,7 +327,7 @@
Supplier Invoices
account.invoice
form
- tree,form,calendar
+ tree,form,calendar,graph
[('type','=','in_invoice')]
{'type':'in_invoice'}
@@ -326,7 +337,7 @@
New Supplier Invoice
account.invoice
form
- form,tree,calendar
+ form,tree,calendar,graph
[('type','=','in_invoice')]
{'type':'in_invoice'}
@@ -337,7 +348,7 @@
Customer Refunds
account.invoice
form
- tree,form,calendar
+ tree,form,calendar,graph
[('type','=','out_refund')]
{'type':'out_refund'}
@@ -348,7 +359,7 @@
New Customer Refund
account.invoice
form
- form,tree,calendar
+ form,tree,calendar,graph
[('type','=','out_refund')]
{'type':'out_refund'}
@@ -359,7 +370,7 @@
Supplier Refunds
account.invoice
form
- tree,form,calendar
+ tree,form,calendar,graph
[('type','=','in_refund')]
{'type':'in_refund'}
@@ -370,7 +381,7 @@
New Supplier Refund
account.invoice
form
- form,tree,calendar
+ form,tree,calendar,graph
[('type','=','in_refund')]
{'type':'in_refund'}
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 2fb7c30d4a5..7a44e823b79 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1415,9 +1415,7 @@
new
-
-
-
+
@@ -1463,12 +1461,12 @@
open
-
+
diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml
index dd89db53a7c..c5f6c267574 100644
--- a/addons/account/account_wizard.xml
+++ b/addons/account/account_wizard.xml
@@ -22,7 +22,23 @@
-
+
+
+ Entries by Statements
+ account.move.line
+ form
+ tree,form
+ new
+
+
+
diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml
index 8e523c5bc4d..4a05314daca 100644
--- a/addons/account/partner_view.xml
+++ b/addons/account/partner_view.xml
@@ -13,54 +13,54 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index 68fa798ad38..3f65271a2ae 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -20,8 +20,6 @@ access_account_model_line,account.model.line,model_account_model_line,account.gr
access_account_subscription,account.subscription,model_account_subscription,account.group_account_user,1,1,1,1
access_account_subscription_line,account.subscription.line,model_account_subscription_line,account.group_account_user,1,1,1,1
access_account_config_fiscalyear,account.config.fiscalyear,model_account_config_fiscalyear,account.group_account_manager,1,1,1,1
-access_account_config_journal_bank_account,account.config.journal.bank.account,model_account_config_journal_bank_account,account.group_account_manager,1,1,1,1
-access_account_config_journal_bank_account_line,account.config.journal.bank.account.line,model_account_config_journal_bank_account_line,account.group_account_manager,1,1,1,1
access_account_tax_template,account.tax.template,model_account_tax_template,account.group_account_manager,1,1,1,1
access_account_account_template,account.account.template,model_account_account_template,account.group_account_manager,1,1,1,1
access_account_tax_code_template,account.tax.code.template,model_account_tax_code_template,account.group_account_manager,1,1,1,1
diff --git a/addons/base_module_record/base_module_record.py b/addons/base_module_record/base_module_record.py
index 6c130549f64..1a623b2dbb5 100644
--- a/addons/base_module_record/base_module_record.py
+++ b/addons/base_module_record/base_module_record.py
@@ -209,7 +209,7 @@ def fnct_call(fnct):
pool = pooler.get_pool(args[0])
mod = pool.get('ir.module.record')
if mod and mod.recording:
- if args[4] not in ('default_get','read','fields_view_get','fields_get','search','name_search','name_get','get','request_get', 'get_sc'):
+ if args[4] not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc'):
mod.recording_data.append(('query', args, argv,res))
return res
return execute
diff --git a/addons/base_module_record/wizard/base_module_save.py b/addons/base_module_record/wizard/base_module_save.py
index 1b26c34ea65..458e57404cc 100644
--- a/addons/base_module_record/wizard/base_module_save.py
+++ b/addons/base_module_record/wizard/base_module_save.py
@@ -74,7 +74,7 @@ intro_save_form = '''
-
+
@@ -146,7 +146,6 @@ def _create_module(self, cr, uid, data, context):
info.external_attr = 2175008768
zip.writestr(info, datastr)
zip.close()
- print data['form']
return {
'module_file': base64.encodestring(s.getvalue()),
'module_filename': data['form']['directory_name']+'-'+data['form']['version']+'.zip'
diff --git a/addons/delivery/delivery_demo.xml b/addons/delivery/delivery_demo.xml
index bb9c6a5e89d..cd1a18c3403 100644
--- a/addons/delivery/delivery_demo.xml
+++ b/addons/delivery/delivery_demo.xml
@@ -4,7 +4,7 @@
- Default Transporter
+ The Poste
http://tinyerp.com
@@ -16,7 +16,7 @@
- Default Delivery
+ Delivery by Poste
service
@@ -24,7 +24,7 @@
- Default Delivery
+ The Poste - Express
@@ -32,7 +32,7 @@
- Default Delivery Grid
+ The Poste Express - Pricelist
@@ -61,4 +61,4 @@
-
\ No newline at end of file
+
diff --git a/addons/delivery/delivery_wizard.xml b/addons/delivery/delivery_wizard.xml
index 7298b077142..b7b366e5c06 100644
--- a/addons/delivery/delivery_wizard.xml
+++ b/addons/delivery/delivery_wizard.xml
@@ -2,7 +2,7 @@
-
+
-
\ No newline at end of file
+
diff --git a/addons/mrp/__init__.py b/addons/mrp/__init__.py
index 1f42fa8786f..0cca0e4c805 100644
--- a/addons/mrp/__init__.py
+++ b/addons/mrp/__init__.py
@@ -31,6 +31,5 @@
import mrp
import wizard
import report
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+import company
+import schedulers
diff --git a/addons/mrp/__terp__.py b/addons/mrp/__terp__.py
index f3fe4989e05..0a5220eddaf 100644
--- a/addons/mrp/__terp__.py
+++ b/addons/mrp/__terp__.py
@@ -69,6 +69,7 @@
"mrp_view.xml",
"mrp_wizard.xml",
"mrp_report.xml",
+ "company_view.xml"
],
"active": False,
"installable": True
diff --git a/addons/stock_back_order/stock.py b/addons/mrp/company.py
similarity index 53%
rename from addons/stock_back_order/stock.py
rename to addons/mrp/company.py
index 91d7a109484..c6c20bb45f0 100644
--- a/addons/stock_back_order/stock.py
+++ b/addons/mrp/company.py
@@ -1,8 +1,8 @@
-# -*- encoding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
-# Fabien Pinckaers
+# Copyright (c) 2005-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id:
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
@@ -27,29 +27,29 @@
#
##############################################################################
-from osv import fields,osv
-import tools
-import ir
-import pooler
+from osv import osv,fields
-
-
-class stock_picking(osv.osv):
- _name = "stock.picking"
- _inherit ='stock.picking'
+class company(osv.osv):
+ _inherit = 'res.company'
_columns = {
- 'back_order_id' : fields.many2one('stock.picking', 'Back Order', readonly=True),
- 'backorder':fields.boolean('Backorder',readonly=True),
-
+ 'schedule_range': fields.float('Scheduler Range', required=True,
+ help="This is the time frame analysed by the scheduler when "\
+ "computing procurements. All procurement that are not between "\
+ "today and today+range are skipped for futur computation."),
+ 'po_lead': fields.float('Purchase Lead Time', required=True,
+ help="This is the leads/security time for each purchase order."),
+ 'security_lead': fields.float('Security Days', required=True,
+ help="This is the days added to what you promise to customers "\
+ "for security purpose"),
+ 'manufacturing_lead': fields.float('Manufacturity Lead Time', required=True,
+ help="Security days for each manufacturing operation."),
}
_defaults = {
- 'type':lambda *a: 'internal',
- 'backorder':lambda *a: False,
-
- }
+ 'schedule_range': lambda *a: 80.0,
+ 'po_lead': lambda *a: 1.0,
+ 'security_lead': lambda *a: 5.0,
+ 'manufacturing_lead': lambda *a: 1.0,
+ }
+company()
-stock_picking()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mrp/company_view.xml b/addons/mrp/company_view.xml
new file mode 100644
index 00000000000..0f8989e174f
--- /dev/null
+++ b/addons/mrp/company_view.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+ res.company.mrp.config
+ res.company
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index e9877ce1349..e6365079726 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -868,10 +868,12 @@ class mrp_procurement(osv.osv):
def action_produce_assign_product(self, cr, uid, ids, context={}):
produce_id = False
+ company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
for procurement in self.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') - DateTime.RelativeDateTime(days=procurement.product_id.product_tmpl_id.produce_delay or 0.0)
+ newdate = newdate - DateTime.RelativeDateTime(days=company.manufacturing_lead)
produce_id = self.pool.get('mrp.production').create(cr, uid, {
'origin': procurement.origin,
'product_id': procurement.product_id.id,
@@ -892,8 +894,9 @@ class mrp_procurement(osv.osv):
wf_service.trg_validate(uid, 'mrp.production', produce_id, 'button_confirm', cr)
return produce_id
- def action_po_assign(self, cr, uid, ids):
+ def action_po_assign(self, cr, uid, ids, context={}):
purchase_id = False
+ company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
for procurement in self.browse(cr, uid, ids):
res_id = procurement.move_id.id
partner = procurement.product_id.seller_ids[0].name
@@ -910,6 +913,7 @@ class mrp_procurement(osv.osv):
price = self.pool.get('product.pricelist').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') - DateTime.RelativeDateTime(days=procurement.product_id.product_tmpl_id.seller_delay or 0.0)
+ newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead)
line = {
'name': procurement.product_id.name,
'product_qty': qty,
@@ -969,45 +973,15 @@ class mrp_procurement(osv.osv):
for id in ids:
wf_service.trg_trigger(uid, 'mrp.procurement', id, cr)
return res
- def run_scheduler(self, cr, uid, user_id=False, schedule_cycle=1.0,\
- po_cycle=1.0, po_lead=1.0, security_lead=50.0, picking_lead=1.0,\
- automatic=False, use_new_cursor=False, context=None):
+ def run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, context=None):
'''
use_new_cursor: False or the dbname
'''
if not context:
context={}
- self.run_procure_confirm(cr, uid, schedule_cycle=schedule_cycle,\
- po_cycle=po_cycle, po_lead=po_lead, security_lead=security_lead,\
- picking_lead=picking_lead, user_id=user_id,\
+ self._procure_confirm(cr, uid, use_new_cursor=use_new_cursor, context=context)
+ self._procure_orderpoint_confirm(cr, uid, automatic=automatic,\
use_new_cursor=use_new_cursor, context=context)
- self.run_orderpoint_confirm(cr, uid, automatic=automatic,\
- use_new_cursor=use_new_cursor, context=context, user_id=user_id)
-
- def run_procure_confirm(self, cr, uid, user_id=False, schedule_cycle=1.0,\
- po_cycle=1.0, po_lead=1.0, security_lead=50.0, picking_lead=1.0, \
- use_new_cursor=False, context=None):
- '''
- use_new_cursor: False or the dbname
- '''
- from wizard.schedulers import _procure_confirm
- if not context:
- context={}
- _procure_confirm(self, cr, uid, schedule_cycle=schedule_cycle,\
- po_cycle=po_cycle, po_lead=po_lead, security_lead=security_lead,\
- picking_lead=picking_lead, user_id=user_id, use_new_cursor=use_new_cursor,\
- context=context)
-
- def run_orderpoint_confirm(self, cr, uid, automatic=False, use_new_cursor=False,\
- context=None, user_id=False):
- '''
- use_new_cursor: False or the dbname
- '''
- from wizard.schedulers import _procure_orderpoint_confirm
- if not context:
- context={}
- _procure_orderpoint_confirm(self, cr, uid, automatic=automatic,\
- use_new_cursor=use_new_cursor, context=context, user_id=user_id)
mrp_procurement()
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index b7eb2faa4a3..b31b0390b6c 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -382,6 +382,18 @@
+
+
+ mrp.production.graph
+ mrp.production
+ graph
+
+
+
+
+
+
+
@@ -446,7 +458,7 @@
ir.actions.act_window
mrp.production
form
- tree,form,calendar
+ tree,form,calendar,graph
@@ -456,7 +468,7 @@
ir.actions.act_window
mrp.production
form
- tree,form,calendar
+ tree,form,calendar,graph
[('state','=','ready')]
@@ -465,7 +477,7 @@
ir.actions.act_window
mrp.production
form
- tree,form,calendar
+ tree,form,calendar,graph
[('state','=','in_production')]
@@ -474,7 +486,7 @@
ir.actions.act_window
mrp.production
form
- tree,form,calendar
+ tree,form,calendar,graph
[('state','=','confirmed')]
@@ -484,7 +496,7 @@
ir.actions.act_window
mrp.production
form
- form,tree,calendar
+ form,tree,calendar,graph
diff --git a/addons/mrp/mrp_wizard.xml b/addons/mrp/mrp_wizard.xml
index 14a162c9551..6e02dbc55e6 100644
--- a/addons/mrp/mrp_wizard.xml
+++ b/addons/mrp/mrp_wizard.xml
@@ -2,19 +2,19 @@
- Compute all schedulers
+ Compute All Schedulers
mrp.procurement.compute.all
- Compute procurement
+ Compute Procurements Only
mrp.procurement.compute
- Compute stock minimum rules
+ Compute Stock Minimum Rules Only
mrp.procurement.orderpoint.compute
@@ -31,4 +31,4 @@
-
\ No newline at end of file
+
diff --git a/addons/mrp/schedulers.py b/addons/mrp/schedulers.py
new file mode 100644
index 00000000000..a02d8ae901c
--- /dev/null
+++ b/addons/mrp/schedulers.py
@@ -0,0 +1,248 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id$
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from osv import osv
+import netsvc
+import pooler
+from mx import DateTime
+import time
+
+class mrp_procurement(osv.osv):
+ _inherit = 'mrp.procurement'
+ def _procure_confirm(self, cr, uid, ids=None, use_new_cursor=False, context=None):
+ '''
+ use_new_cursor: False or the dbname
+ '''
+ if not context:
+ context={}
+
+ if use_new_cursor:
+ cr = pooler.get_db(use_new_cursor).cursor()
+ wf_service = netsvc.LocalService("workflow")
+
+ procurement_obj = self.pool.get('mrp.procurement')
+ if not ids:
+ ids=procurement_obj.search(cr,uid,[], order="date_planned")
+ for id in ids:
+ wf_service.trg_validate(uid, 'mrp.procurement', id, 'button_restart', cr)
+ 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)
+ start_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
+ offset = 0
+ report = []
+ report_total = 0
+ report_except = 0
+ report_later = 0
+ while True:
+ cr.execute('select id from mrp_procurement where state=%s and procure_method=%s order by date_planned limit 500 offset %d', ('confirmed','make_to_order',offset))
+ ids = map(lambda x:x[0], cr.fetchall())
+ for proc in procurement_obj.browse(cr, uid, ids):
+ if maxdate.strftime('%Y-%m-%d')>=proc.date_planned:
+ wf_service.trg_validate(uid, 'mrp.procurement', proc.id, 'button_check', cr)
+ else:
+ offset+=1
+ report_later += 1
+ for proc in procurement_obj.browse(cr, uid, ids):
+ if proc.state == 'exception':
+ report.append('PROC %d: on order - %3.2f %-5s - %s' % \
+ (proc.id, proc.product_qty, proc.product_uom.name,
+ proc.product_id.name))
+ report_except += 1
+ report_total += 1
+ if use_new_cursor:
+ cr.commit()
+ if not ids:
+ break
+
+ offset = 0
+ ids = []
+ while True:
+ report_ids = []
+ ids = self.pool.get('mrp.procurement').search(cr, uid, [('state','=','confirmed'),('procure_method','=','make_to_stock')], offset=offset)
+ for proc in procurement_obj.browse(cr, uid, ids):
+ if (maxdate).strftime('%Y-%m-%d') >= proc.date_planned:
+ wf_service.trg_validate(uid, 'mrp.procurement', proc.id, 'button_check', cr)
+ report_ids.append(proc.id)
+ else:
+ report_later +=1
+ report_total +=1
+ for proc in procurement_obj.browse(cr, uid, report_ids):
+ if proc.state == 'exception':
+ report.append('PROC %d: from stock - %3.2f %-5s - %s' % \
+ (proc.id, proc.product_qty, proc.product_uom.name,
+ proc.product_id.name,))
+ report_except +=1
+ if use_new_cursor:
+ cr.commit()
+ offset += len(ids)
+ if not ids: break
+ end_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
+ if uid:
+ request = self.pool.get('res.request')
+ summary = '''Here is the procurement scheduling report.
+
+ Computation Started; %s
+ Computation Finnished; %s
+
+ Total procurement: %d
+ Exception procurement: %d
+ Not run now procurement: %d
+
+ Exceptions;
+ '''% (start_date,end_date,report_total, report_except,report_later)
+ summary += '\n'.join(report)
+ request.create(cr, uid,
+ {'name' : "Procurement calculation report.",
+ 'act_from' : uid,
+ 'act_to' : uid,
+ 'body': summary,
+ })
+ if use_new_cursor:
+ cr.commit()
+ cr.close()
+ return {}
+
+ def create_automatic_op(cr, uid, context=None):
+ if not context:
+ context={}
+ product_obj = self.pool.get('product.product')
+ proc_obj = self.pool.get('mrp.procurement')
+ warehouse_obj = self.pool.get('stock.warehouse')
+ wf_service = netsvc.LocalService("workflow")
+
+ cr.execute('select id from stock_warehouse')
+ warehouses = [x for x, in cr.fetchall()]
+ cr.execute('select id from product_product')
+ products_id = [x for x, in cr.fetchall()]
+ products = dict(zip(products_id, product_obj.browse(cr, uid, products_id, context)))
+ for warehouse in warehouses:
+ v_stock = product_obj._product_virtual_available(cr, uid, products_id, None, {'warehouse': warehouse})
+ cr.execute("select lot_stock_id from stock_warehouse")
+ location_ids_str = ','.join([str(id) for id, in cr.fetchall()])
+ stock_locations = warehouse_obj.read(cr, uid, [warehouse], ['lot_input_id', 'lot_stock_id'])[0]
+ for prod_id, available in v_stock.items():
+ if available >= 0:
+ continue
+ newdate = DateTime.now() + DateTime.RelativeDateTime(days=products[prod_id].seller_delay)
+ if products[prod_id].supply_method == 'buy':
+ location_id = stock_locations['lot_input_id'][0]
+ elif products[prod_id].supply_method == 'produce':
+ location_id = stock_locations['lot_stock_id'][0]
+ else:
+ continue
+ proc_id = proc_obj.create(cr, uid, {
+ 'name': 'PROC:Automatic OP for product:%s' % products[prod_id].name,
+ 'origin': 'SCHEDULER',
+ 'date_planned': newdate.strftime('%Y-%m-%d'),
+ 'product_id': prod_id,
+ 'product_qty': -available,
+ 'product_uom': products[prod_id].uom_id.id,
+ 'location_id': location_id,
+ 'procure_method': 'make_to_order',
+ })
+ wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
+ wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_check', cr)
+
+
+ def _procure_orderpoint_confirm(self, cr, uid, automatic=False,\
+ use_new_cursor=False, context=None, user_id=False):
+ '''
+ use_new_cursor: False or the dbname
+ '''
+ if not context:
+ context={}
+ if use_new_cursor:
+ cr = pooler.get_db(use_new_cursor).cursor()
+ orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
+ location_obj = self.pool.get('stock.location')
+ procurement_obj = self.pool.get('mrp.procurement')
+ request_obj = self.pool.get('res.request')
+ wf_service = netsvc.LocalService("workflow")
+ report = []
+ offset = 0
+ ids = [1]
+ if automatic:
+ create_automatic_op(cr, uid, context=context)
+ while ids:
+ ids=orderpoint_obj.search(cr,uid,[],offset=offset,limit=100)
+ for op in orderpoint_obj.browse(cr, uid, ids):
+ try:
+ prods = location_obj._product_virtual_get(cr, uid,
+ op.warehouse_id.lot_stock_id.id, [op.product_id.id],
+ {'uom': op.product_uom.id})[op.product_id.id]
+ if prods < op.product_min_qty:
+ qty = max(op.product_min_qty, op.product_max_qty)-prods
+ reste = qty % op.qty_multiple
+ if reste>0:
+ qty += op.qty_multiple-reste
+ newdate = DateTime.now() + DateTime.RelativeDateTime(
+ days=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
+ proc_id = procurement_obj.create(cr, uid, {
+ 'name': 'OP:'+str(op.id),
+ 'date_planned': newdate.strftime('%Y-%m-%d'),
+ 'product_id': op.product_id.id,
+ 'product_qty': qty,
+ 'product_uom': op.product_uom.id,
+ 'location_id': op.warehouse_id.lot_input_id.id,
+ 'procure_method': 'make_to_order',
+ 'origin': op.name
+ })
+ wf_service.trg_validate(uid, 'mrp.procurement', proc_id,
+ 'button_confirm', cr)
+ wf_service.trg_validate(uid, 'mrp.procurement', proc_id,
+ 'button_check', cr)
+ orderpoint_obj.write(cr, uid, [op.id],
+ {'procurement_id': proc_id})
+ except Exception, e:
+ report.append('OP %d:\n%s\n' % (op.id, str(e)))
+ offset += len(ids)
+ if use_new_cursor:
+ cr.commit()
+ if user_id and report:
+ request_obj.create(cr, uid, {
+ 'name': 'Orderpoint report.',
+ 'act_from': user_id,
+ 'act_to': user_id,
+ 'body': '\n'.join(report)
+ })
+ if use_new_cursor:
+ cr.commit()
+ cr.close()
+ return {}
+mrp_procurement()
diff --git a/addons/mrp/wizard/schedulers.py b/addons/mrp/wizard/schedulers.py
deleted file mode 100644
index 98ff98111ea..00000000000
--- a/addons/mrp/wizard/schedulers.py
+++ /dev/null
@@ -1,264 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
-#
-# $Id$
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-import pooler
-import time
-from mx import DateTime
-import netsvc
-from osv import osv
-
-def _procure_confirm(self, cr, uid, schedule_cycle=1.0, po_cycle=1.0,\
- po_lead=1.0, security_lead=50.0, picking_lead=1.0, user_id=False,\
- use_new_cursor=False, context=None):
- '''
- use_new_cursor: False or the dbname
- '''
- if not context:
- context={}
-
- if use_new_cursor:
- cr = pooler.get_db(use_new_cursor).cursor()
- wf_service = netsvc.LocalService("workflow")
-
- procurement_obj = pooler.get_pool(cr.dbname).get('mrp.procurement')
- ids=procurement_obj.search(cr,uid,[], order="date_planned")
- for id in ids:
- wf_service.trg_validate(uid, 'mrp.procurement', id, 'button_restart', cr)
- if use_new_cursor:
- cr.commit()
-
- po_time = po_cycle + po_lead
- maxdate = DateTime.now() + DateTime.RelativeDateTime(days=schedule_cycle + security_lead)
- start_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
- offset = 0
- report = []
- report_total = 0
- report_except = 0
- report_later = 0
- ids = [1]
- while len(ids):
- cr.execute('select id from mrp_procurement where state=%s and procure_method=%s order by date_planned limit 500 offset %d', ('confirmed','make_to_order',offset))
- ids = map(lambda x:x[0], cr.fetchall())
- for proc in procurement_obj.browse(cr, uid, ids):
- if proc.product_id.supply_method=='produce':
- wf_service.trg_validate(uid, 'mrp.procurement', proc.id, 'button_check', cr)
- else:
- if (maxdate + DateTime.RelativeDateTime(days=(proc.product_id.seller_delay or 0 + po_time))).strftime('%Y-%m-%d')>=proc.date_planned:
- wf_service.trg_validate(uid, 'mrp.procurement', proc.id, 'button_check', cr)
- else:
- offset+=1
- report_later += 1
- for proc in procurement_obj.browse(cr, uid, ids):
- if proc.state == 'exception':
- report.append('PROC %d: on order - %3.2f %-5s - %s' % \
- (proc.id, proc.product_qty, proc.product_uom.name,
- proc.product_id.name))
- report_except += 1
- report_total += 1
- if use_new_cursor:
- cr.commit()
-
- offset = 0
- ids = [1]
- while len(ids):
- report_ids = []
- ids = pooler.get_pool(cr.dbname).get('mrp.procurement').search(cr, uid, [('state','=','confirmed'),('procure_method','=','make_to_stock')], offset=offset)
- for proc in procurement_obj.browse(cr, uid, ids):
- if (maxdate + DateTime.RelativeDateTime(days=picking_lead)).strftime('%Y-%m-%d') >= proc.date_planned:
- wf_service.trg_validate(uid, 'mrp.procurement', proc.id, 'button_check', cr)
- report_ids.append(proc.id)
- else:
- report_later +=1
- report_total +=1
- for proc in procurement_obj.browse(cr, uid, report_ids):
- if proc.state == 'exception':
- report.append('PROC %d: from stock - %3.2f %-5s - %s' % \
- (proc.id, proc.product_qty, proc.product_uom.name,
- proc.product_id.name,))
- report_except +=1
- if use_new_cursor:
- cr.commit()
- offset += len(ids)
- end_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
- if user_id:
- request = pooler.get_pool(cr.dbname).get('res.request')
- summary = '''Here is the procurement scheduling report.
-
-Computation Started; %s
-Computation Finnished; %s
-
-Total procurement: %d
-Exception procurement: %d
-Not run now procurement: %d
-
-Exceptions;
-'''% (start_date,end_date,report_total, report_except,report_later)
- summary += '\n'.join(report)
- request.create(cr, uid,
- {'name' : "Procurement calculation report.",
- 'act_from' : user_id,
- 'act_to' : user_id,
- 'body': summary,
- })
- if use_new_cursor:
- cr.commit()
- cr.close()
- return {}
-
-def create_automatic_op(cr, uid, context=None):
- if not context:
- context={}
- product_obj = pooler.get_pool(cr.dbname).get('product.product')
- proc_obj = pooler.get_pool(cr.dbname).get('mrp.procurement')
- warehouse_obj = pooler.get_pool(cr.dbname).get('stock.warehouse')
- wf_service = netsvc.LocalService("workflow")
-
- cr.execute('select id from stock_warehouse')
- warehouses = [x for x, in cr.fetchall()]
- cr.execute('select id from product_product')
- products_id = [x for x, in cr.fetchall()]
- products = dict(zip(products_id, product_obj.browse(cr, uid, products_id, context)))
- for warehouse in warehouses:
- v_stock = product_obj._product_virtual_available(cr, uid, products_id, None, {'warehouse': warehouse})
- cr.execute("select lot_stock_id from stock_warehouse")
- location_ids_str = ','.join([str(id) for id, in cr.fetchall()])
- stock_locations = warehouse_obj.read(cr, uid, [warehouse], ['lot_input_id', 'lot_stock_id'])[0]
- for prod_id, available in v_stock.items():
- if available >= 0:
- continue
- newdate = DateTime.now() + DateTime.RelativeDateTime(days=products[prod_id].seller_delay)
- if products[prod_id].supply_method == 'buy':
- location_id = stock_locations['lot_input_id'][0]
- elif products[prod_id].supply_method == 'produce':
- location_id = stock_locations['lot_stock_id'][0]
- else:
- continue
- proc_id = proc_obj.create(cr, uid, {
- 'name': 'PROC:Automatic OP for product:%s' % products[prod_id].name,
- 'origin': 'SCHEDULER',
- 'date_planned': newdate.strftime('%Y-%m-%d'),
- 'product_id': prod_id,
- 'product_qty': -available,
- 'product_uom': products[prod_id].uom_id.id,
- 'location_id': location_id,
- 'procure_method': 'make_to_order',
- })
- wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
- wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_check', cr)
-
-
-def _procure_orderpoint_confirm(self, cr, uid, automatic=False,\
- use_new_cursor=False, context=None, user_id=False):
- '''
- use_new_cursor: False or the dbname
- '''
- if not context:
- context={}
- if use_new_cursor:
- cr = pooler.get_db(use_new_cursor).cursor()
- pool = pooler.get_pool(cr.dbname)
- orderpoint_obj = pool.get('stock.warehouse.orderpoint')
- location_obj = pool.get('stock.location')
- procurement_obj = pool.get('mrp.procurement')
- request_obj = pool.get('res.request')
- wf_service = netsvc.LocalService("workflow")
- report = []
- offset = 0
- ids = [1]
- if automatic:
- create_automatic_op(cr, uid, context=context)
- while ids:
- ids=orderpoint_obj.search(cr,uid,[],offset=offset,limit=100)
- for op in orderpoint_obj.browse(cr, uid, ids):
- #if op.procurement_id and op.procurement_id.purchase_id:
- # if (op.procurement_id.purchase_id.state=='confirmed'):
- # #
- # # TODO: Should write a request with this warning
- # #
- # continue
- # elif op.procurement_id.purchase_id.state=='draft':
- # wf_service = netsvc.LocalService("workflow")
- # wf_service.trg_validate(uid, 'purchase.order',
- # op.procurement_id.purchase_id.id, 'purchase_cancel', cr)
- try:
- prods = location_obj._product_virtual_get(cr, uid,
- op.warehouse_id.lot_stock_id.id, [op.product_id.id],
- {'uom': op.product_uom.id})[op.product_id.id]
- if prods < op.product_min_qty:
- # order the quantity necessary to get to max(min_qty, max_qty)
- qty = max(op.product_min_qty, op.product_max_qty)-prods
- reste = qty % op.qty_multiple
- if reste>0:
- qty += op.qty_multiple-reste
- newdate = DateTime.now() + DateTime.RelativeDateTime(
- days=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
- proc_id = procurement_obj.create(cr, uid, {
- 'name': 'OP:'+str(op.id),
- 'date_planned': newdate.strftime('%Y-%m-%d'),
- 'product_id': op.product_id.id,
- 'product_qty': qty,
- 'product_uom': op.product_uom.id,
- 'location_id': op.warehouse_id.lot_input_id.id,
- 'procure_method': 'make_to_order',
- 'origin': op.name
- })
- wf_service.trg_validate(uid, 'mrp.procurement', proc_id,
- 'button_confirm', cr)
- wf_service.trg_validate(uid, 'mrp.procurement', proc_id,
- 'button_check', cr)
- orderpoint_obj.write(cr, uid, [op.id],
- {'procurement_id': proc_id})
- except Exception, e:
- report.append('OP %d:\n%s\n' % (op.id, str(e)))
- offset += len(ids)
- if use_new_cursor:
- cr.commit()
- if user_id and report:
- request_obj.create(cr, uid, {
- 'name': 'Orderpoint report.',
- 'act_from': user_id,
- 'act_to': user_id,
- 'body': '\n'.join(report)
- })
- if use_new_cursor:
- cr.commit()
- cr.close()
- return {}
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mrp/wizard/wizard_orderpoint_procurement.py b/addons/mrp/wizard/wizard_orderpoint_procurement.py
index ef64c2c070b..956b5ed111c 100644
--- a/addons/mrp/wizard/wizard_orderpoint_procurement.py
+++ b/addons/mrp/wizard/wizard_orderpoint_procurement.py
@@ -51,8 +51,8 @@ def _procure_calculation_orderpoint(self, db_name, uid, data, context):
cr = db.cursor()
proc_obj = pool.get('mrp.procurement')
automatic = data['form']['automatic']
- proc_obj.run_orderpoint_confirm(cr, uid, automatic=automatic,\
- use_new_cursor=cr.dbname, context=context, user_id=uid)
+ proc_obj._procure_orderpoint_confirm(cr, uid, automatic=automatic,\
+ use_new_cursor=cr.dbname, context=context)
return {}
def _procure_calculation(self, cr, uid, data, context):
diff --git a/addons/mrp/wizard/wizard_procurement.py b/addons/mrp/wizard/wizard_procurement.py
index afa5795cdb8..09dde8071aa 100644
--- a/addons/mrp/wizard/wizard_procurement.py
+++ b/addons/mrp/wizard/wizard_procurement.py
@@ -34,38 +34,17 @@ import pooler
parameter_form = '''
'''
parameter_fields = {
- 'schedule_cycle': {'string':'Scheduler Cycle', 'type':'float', 'required':True, 'default': lambda *a: 1.0},
- 'po_cycle': {'string':'PO Cycle', 'type':'float', 'required':True, 'default': lambda *a: 1.0},
- 'po_lead': {'string':'PO Lead Time', 'type':'float', 'required':True, 'default': lambda *a: 1.0},
- 'security_lead': {'string':'Security Days', 'type':'float', 'required':True, 'default': lambda *a: 5.0},
- 'picking_lead': {'string':'Packing Lead Time', 'type':'float', 'required':True, 'default': lambda *a: 1.0},
- 'user_id': {'string':'Send Result To', 'type':'many2one', 'relation':'res.users', 'default': lambda uid,data,state: uid},
}
def _procure_calculation_procure(self, db_name, uid, data, context):
db, pool = pooler.get_db_and_pool(db_name)
cr = db.cursor()
proc_obj = pool.get('mrp.procurement')
- schedule_cycle = data['form']['schedule_cycle']
- po_cycle = data['form']['po_cycle']
- po_lead = data['form']['po_lead']
- security_lead = data['form']['security_lead']
- picking_lead = data['form']['picking_lead']
- user_id = data['form']['user_id']
- proc_obj.run_procure_confirm(cr, uid, user_id=user_id, schedule_cycle=schedule_cycle,\
- po_cycle=po_cycle, po_lead=po_lead, security_lead=security_lead,\
- picking_lead=picking_lead, use_new_cursor=cr.dbname, context=context)
+ proc_obj._procure_confirm(cr, uid, use_new_cursor=cr.dbname, context=context)
return {}
def _procure_calculation(self, cr, uid, data, context):
diff --git a/addons/mrp/wizard/wizard_schedulers_all.py b/addons/mrp/wizard/wizard_schedulers_all.py
index b9a909210c8..19b4a6168b3 100644
--- a/addons/mrp/wizard/wizard_schedulers_all.py
+++ b/addons/mrp/wizard/wizard_schedulers_all.py
@@ -34,41 +34,19 @@ import pooler
parameter_form = '''
'''
parameter_fields = {
- 'schedule_cycle': {'string':'Scheduler Cycle', 'type':'float', 'required':True, 'default': lambda *a: 1.0},
- 'po_cycle': {'string':'PO Cycle', 'type':'float', 'required':True, 'default': lambda *a: 1.0},
- 'po_lead': {'string':'PO Lead Time', 'type':'float', 'required':True, 'default': lambda *a: 1.0},
- 'security_lead': {'string':'Security Days', 'type':'float', 'required':True, 'default': lambda *a: 50.0},
- 'picking_lead': {'string':'Packing Lead Time', 'type':'float', 'required':True, 'default': lambda *a: 1.0},
'automatic': {'string': 'Automatic orderpoint', 'type': 'boolean', 'help': 'Triggers an automatic procurement for all products that have a virtual stock under 0.', 'default': lambda *a: False},
- 'user_id': {'string':'Send Result To', 'type':'many2one', 'relation':'res.users', 'default': lambda uid,data,state: uid},
}
def _procure_calculation_all(self, db_name, uid, data, context):
db, pool = pooler.get_db_and_pool(db_name)
cr = db.cursor()
proc_obj = pool.get('mrp.procurement')
- schedule_cycle = data['form']['schedule_cycle']
- po_cycle = data['form']['po_cycle']
- po_lead = data['form']['po_lead']
- security_lead = data['form']['security_lead']
- picking_lead = data['form']['picking_lead']
- user_id = data['form']['user_id']
automatic = data['form']['automatic']
- proc_obj.run_scheduler(cr, uid, user_id=user_id, schedule_cycle=schedule_cycle,\
- po_cycle=po_cycle, po_lead=po_lead, security_lead=security_lead,\
- picking_lead=picking_lead, automatic=automatic, use_new_cursor=cr.dbname,\
+ proc_obj.run_scheduler(cr, uid, automatic=automatic, use_new_cursor=cr.dbname,\
context=context)
return {}
diff --git a/addons/product/product.py b/addons/product/product.py
index a48e3932570..5c7f7d13bff 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -196,7 +196,7 @@ class product_category(osv.osv):
_name = "product.category"
_description = "Product Category"
_columns = {
- 'name': fields.char('Name', size=64, required=True),
+ 'name': fields.char('Name', size=64, required=True, translate=True),
'complete_name': fields.function(_name_get_fnc, method=True, type="char", string='Name'),
'parent_id': fields.many2one('product.category','Parent Category', select=True),
'child_id': fields.one2many('product.category', 'parent_id', string='Childs Categories'),
diff --git a/addons/profile_accounting/profile_accounting.py b/addons/profile_accounting/profile_accounting.py
index a1bf4e8f1fd..74f8023bdc9 100644
--- a/addons/profile_accounting/profile_accounting.py
+++ b/addons/profile_accounting/profile_accounting.py
@@ -29,8 +29,8 @@
from osv import fields, osv
import pooler
-class config_install_extra_modules(osv.osv_memory):
- _name='config.install_extra_modules'
+class profile_accounting_config_install_modules_wizard(osv.osv_memory):
+ _name='profile.accounting.config.install_modules_wizard'
_columns = {
'name':fields.char('Name', size=64),
'account_analytic_analysis':fields.boolean('Analytic Accounting'),
@@ -69,7 +69,7 @@ class config_install_extra_modules(osv.osv_memory):
}
-config_install_extra_modules()
+profile_accounting_config_install_modules_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/profile_accounting/profile_accounting.xml b/addons/profile_accounting/profile_accounting.xml
index 7d37d1704c1..a1a38921192 100644
--- a/addons/profile_accounting/profile_accounting.xml
+++ b/addons/profile_accounting/profile_accounting.xml
@@ -2,8 +2,8 @@
- Install extra modules
- config.install_extra_modules
+ Accounting Profile : Install extra modules
+ profile.accounting.config.install_modules_wizard
form
- Install Extra Modules
+ Accounting Profile : Install Extra Modules
ir.actions.act_window
- config.install_extra_modules
+ profile.accounting.config.install_modules_wizard
form
form
new
- Install Extra modules
+ id="profile_accounting.config_install_wizard">
+ Accounting Profile : Install Extra modules
Install more modules. A few modules are proposed according to the service profile you selected. You will be able to install them based on our requirements.
open
diff --git a/addons/profile_accounting/security/ir.model.access.csv b/addons/profile_accounting/security/ir.model.access.csv
index 07c7312f535..08145a00f54 100644
--- a/addons/profile_accounting/security/ir.model.access.csv
+++ b/addons/profile_accounting/security/ir.model.access.csv
@@ -1,2 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_config_install_extra_modules,config.install_extra_modules,model_config_install_extra_modules,base.group_system,1,1,1,1
+
diff --git a/addons/profile_association/profile_association.py b/addons/profile_association/profile_association.py
index cb962c77d3f..5a5a541ebbe 100644
--- a/addons/profile_association/profile_association.py
+++ b/addons/profile_association/profile_association.py
@@ -30,8 +30,8 @@ from osv import fields, osv
import pooler
-class config_install_extra_modules(osv.osv_memory):
- _name='config.install_extra_modules'
+class profile_association_config_install_modules_wizard(osv.osv_memory):
+ _name='profile.association.config.install_modules_wizard'
_columns = {
'crm_configuration':fields.boolean('CRM & Calendars', help="This installs the customer relationship features like: leads and opportunities tracking, shared calendar, jobs tracking, bug tracker, and so on."),
'hr_expense':fields.boolean('Expenses Tracking', help="Tracks the personal expenses process, from the employee expense encoding, to the reimbursement of the employee up to the reinvoicing to the final customer."),
@@ -68,6 +68,6 @@ class config_install_extra_modules(osv.osv_memory):
}
-config_install_extra_modules()
+profile_association_config_install_modules_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/profile_association/profile_association.xml b/addons/profile_association/profile_association.xml
index 3dd394c4ff7..d2b2d26cadc 100644
--- a/addons/profile_association/profile_association.xml
+++ b/addons/profile_association/profile_association.xml
@@ -2,8 +2,8 @@
- Install extra modules
- config.install_extra_modules
+ Association Profile : Install extra modules
+ profile.association.config.install_modules_wizard
form
- Install Extra Modules
+ Association Profile : Install Extra Modules
ir.actions.act_window
- config.install_extra_modules
+ profile.association.config.install_modules_wizard
form
form
new
@@ -36,7 +36,7 @@
- Install Extra modules
+ Association Profile : Install Extra modules
Install more modules. A few modules are proposed according to the service profile you selected. You will be able to install them based on our requirements.
open
diff --git a/addons/profile_manufacturing/profile_manufacturing.py b/addons/profile_manufacturing/profile_manufacturing.py
index abe5ddcf075..bb660552587 100644
--- a/addons/profile_manufacturing/profile_manufacturing.py
+++ b/addons/profile_manufacturing/profile_manufacturing.py
@@ -31,7 +31,7 @@ import pooler
class config_install_extra_modules(osv.osv_memory):
- _name='config.install_extra_modules'
+ _name='config.install_extra_modules.mrp'
_columns = {
'mrp_jit':fields.boolean('Just in Time Scheduling',
help="The JIT module allows you to not run the scheduler "\
diff --git a/addons/profile_manufacturing/profile_manufacturing.xml b/addons/profile_manufacturing/profile_manufacturing.xml
index f86cf4173f1..9ddf4866215 100644
--- a/addons/profile_manufacturing/profile_manufacturing.xml
+++ b/addons/profile_manufacturing/profile_manufacturing.xml
@@ -2,11 +2,11 @@
- Install extra modules
- config.install_extra_modules
+ Manufacturing Profile : Install extra modules
+ profile.manufacturing.config.install_modules_wizard
form
-
- Install Extra Modules
+ Manufacturing Profile : Install Extra Modules
ir.actions.act_window
- config.install_extra_modules
+ profile.manufacturing.config.install_modules_wizard
form
form
new
@@ -38,7 +38,7 @@
- Install Extra modules
+ Manufacturing Profile : Install Extra modules
Install more modules. A few modules are proposed according to the service profile you selected. You will be able to install them based on our requirements.
open
diff --git a/addons/profile_manufacturing/security/ir.model.access.csv b/addons/profile_manufacturing/security/ir.model.access.csv
index 07c7312f535..08145a00f54 100644
--- a/addons/profile_manufacturing/security/ir.model.access.csv
+++ b/addons/profile_manufacturing/security/ir.model.access.csv
@@ -1,2 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_config_install_extra_modules,config.install_extra_modules,model_config_install_extra_modules,base.group_system,1,1,1,1
+
diff --git a/addons/profile_service/profile_service.py b/addons/profile_service/profile_service.py
index 55f3620ca9f..71371f59846 100644
--- a/addons/profile_service/profile_service.py
+++ b/addons/profile_service/profile_service.py
@@ -30,8 +30,8 @@
from osv import fields, osv
import pooler
-class config_install_extra_modules(osv.osv_memory):
- _name='config.install_extra_modules'
+class profile_service_config_install_modules_wizard(osv.osv_memory):
+ _name='profile.service.config.install_modules_wizard'
_rec_name = 'crm_configuration'
_columns = {
'crm_configuration':fields.boolean('CRM & Calendars', help="This installs the customer relationship features like: leads and opportunities tracking, shared calendar, jobs tracking, bug tracker, and so on."),
@@ -69,7 +69,7 @@ class config_install_extra_modules(osv.osv_memory):
'type': 'ir.actions.act_window',
'target':'new',
}
-config_install_extra_modules()
+profile_service_config_install_modules_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/profile_service/profile_service.xml b/addons/profile_service/profile_service.xml
index e6edeecdeb0..1010ef236a4 100644
--- a/addons/profile_service/profile_service.xml
+++ b/addons/profile_service/profile_service.xml
@@ -2,8 +2,8 @@
- Install extra modules
- config.install_extra_modules
+ Service Profile : Install extra modules
+ profile.service.config.install_modules_wizard
form
- Install Extra Modules
+ Service Profile : Install Extra Modules
ir.actions.act_window
- config.install_extra_modules
+ profile.service.config.install_modules_wizard
form
form
new
@@ -43,7 +43,7 @@
- Install Extra modules
+ Service Profile : Install Extra modules
A few modules are proposed according to the 'service profile' you selected. You will be able to install them or more modules later through the Administration menu.
open
diff --git a/addons/profile_service/security/ir.model.access.csv b/addons/profile_service/security/ir.model.access.csv
index 07c7312f535..97dd8b917b8 100644
--- a/addons/profile_service/security/ir.model.access.csv
+++ b/addons/profile_service/security/ir.model.access.csv
@@ -1,2 +1 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_config_install_extra_modules,config.install_extra_modules,model_config_install_extra_modules,base.group_system,1,1,1,1
diff --git a/addons/project/project.py b/addons/project/project.py
index 3e66310bcbb..a18036843bd 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -242,7 +242,6 @@ class task(osv.osv):
'child_ids': fields.one2many('project.task', 'parent_id', 'Delegated Tasks'),
'history': fields.function(_history_get, method=True, string="Task Details", type="text"),
'notes': fields.text('Notes'),
- 'start_sequence': fields.boolean('Wait for previous sequences'),
'planned_hours': fields.float('Planned Hours', readonly=True, states={'draft':[('readonly',False)]}, required=True),
'effective_hours': fields.function(_hours_get, method=True, string='Hours Spent', multi='hours', store=True),
@@ -263,7 +262,6 @@ class task(osv.osv):
'sequence': lambda *a: 10,
'active': lambda *a: True,
'date_start': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
- 'start_sequence': lambda *a: True
}
_order = "state, sequence, priority, date_deadline, id"
@@ -375,7 +373,7 @@ class project_work(osv.osv):
'name': fields.char('Work summary', size=128),
'date': fields.datetime('Date'),
'task_id': fields.many2one('project.task', 'Task', ondelete='cascade', required=True),
- 'hours': fields.float('Hours spent'),
+ 'hours': fields.float('Time Spent'),
'user_id': fields.many2one('res.users', 'Done by', required=True),
}
_defaults = {
diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml
index 4f10508ddb8..7e46e0428d4 100644
--- a/addons/project/project_demo.xml
+++ b/addons/project/project_demo.xml
@@ -89,7 +89,6 @@
20
- 1
32.0
@@ -97,7 +96,6 @@
25
- 1
24.0
@@ -128,7 +126,6 @@
30
- 1
32.0
@@ -172,7 +169,6 @@
50
- 1
24.0
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 9f59af14e04..299e6a99075 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -266,7 +266,6 @@
-
@@ -309,12 +308,24 @@
+
+ project.task.graph
+ project.task
+ graph
+
+
+
+
+
+
+
+
All Tasks
project.task
form
- tree,form,calendar
+ tree,form,calendar,graph
@@ -323,7 +334,7 @@
My Tasks
project.task
form
- tree,form
+ tree,form,calendar,graph
[('user_id', '=', uid)]
@@ -332,7 +343,7 @@
My Pending Tasks
project.task
form
- tree,form
+ tree,form,calendar,graph
[('user_id', '=', uid),('state','=','pending')]
@@ -341,7 +352,7 @@
My Open Tasks
project.task
form
- tree,form
+ tree,form,calendar,graph
[('user_id', '=', uid),('state','=','open')]
@@ -350,7 +361,7 @@
My Tasks in Progress
project.task
form
- tree,form
+ tree,form,calendar,graph
[('user_id', '=', uid),('state','=','open')]
@@ -359,7 +370,7 @@
New Task
project.task
form
- form,tree
+ form,tree,calendar,graph
@@ -367,7 +378,7 @@
Open Tasks
project.task
form
- tree,form
+ tree,form,calendar,graph
[('state', '=', 'open')]
@@ -376,7 +387,7 @@
Tasks in Progress
project.task
form
- tree,form
+ tree,form,calendar,graph
[('state', '=', 'progress')]
@@ -385,7 +396,7 @@
Unassigned Tasks
project.task
form
- tree,form
+ tree,form,calendar,graph
[('user_id', '=', False)]
@@ -395,7 +406,7 @@
project.task
Project's tasks
form
- tree,form
+ tree,form,calendar,graph
[('project_id', 'child_of', [active_id])]
@@ -444,7 +455,7 @@
name="All Tasks"
res_model="project.task"
src_model="project.project"
- view_mode="tree,form,calendar"
+ view_mode="tree,form,calendar,graph"
view_type="form"/>
diff --git a/addons/project/report/_date_compute.py b/addons/project/report/_date_compute.py
index 628dba3bf80..f5f49273f30 100644
--- a/addons/project/report/_date_compute.py
+++ b/addons/project/report/_date_compute.py
@@ -52,13 +52,12 @@ def _compute_tasks(cr, uid, task_list, date_begin):
date_start = users[task.user_id.id]
else:
date_start = date_begin
- if task.start_sequence:
- sequences.sort()
- for (seq,dt) in sequences:
- if seqform
-
-
-
-
-
+
+
+
+
+
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 0a18640ad42..049c68e2b91 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -16,6 +16,17 @@
+
+ purchase.order.graph
+ purchase.order
+ graph
+
+
+
+
+
+
+
purchase.order.form
@@ -87,7 +98,7 @@
Purchase Orders
ir.actions.act_window
purchase.order
- tree,calendar,form
+ tree,form,calendar,graph
@@ -97,7 +108,7 @@
purchase.order
[('state','=','draft')]
form
- tree,calendar,form
+ tree,form,calendar,graph
@@ -106,7 +117,7 @@
ir.actions.act_window
purchase.order
form
- tree,calendar,form
+ tree,form,calendar,graph
[('state','=','confirmed')]
@@ -116,7 +127,7 @@
ir.actions.act_window
purchase.order
form
- tree,calendar,form
+ tree,form,calendar,graph
[('state','=','approved')]
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 7c95282f78d..6f3336f2c3c 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -129,11 +129,17 @@ class sale_order(osv.osv):
res[r] = 0.0
else:
res[r] = 100.0 * res[r][0] / res[r][1]
+ for order in self.browse(cr, uid, ids, context):
+ if order.shipped:
+ res[order.id] = 100.0
return res
def _invoiced_rate(self, cursor, user, ids, name, arg, context=None):
res = {}
for sale in self.browse(cursor, user, ids, context=context):
+ if sale.invoiced:
+ res[sale.id] = 100.0
+ continue
tot = 0.0
for invoice in sale.invoice_ids:
if invoice.state not in ('draft','cancel'):
@@ -159,7 +165,6 @@ class sale_order(osv.osv):
def _invoiced_search(self, cursor, user, obj, name, args):
if not len(args):
return []
-
clause = ''
no_invoiced = False
for arg in args:
@@ -169,7 +174,6 @@ class sale_order(osv.osv):
else:
clause += 'AND inv.state <> \'paid\''
no_invoiced = True
-
cursor.execute('SELECT rel.order_id ' \
'FROM sale_order_invoice_rel AS rel, account_invoice AS inv ' \
'WHERE rel.invoice_id = inv.id ' + clause)
@@ -210,7 +214,7 @@ class sale_order(osv.osv):
'partner_shipping_id':fields.many2one('res.partner.address', 'Shipping Address', readonly=True, required=True, states={'draft':[('readonly',False)]}),
'incoterm': fields.selection(_incoterm_get, 'Incoterm',size=3),
- 'picking_policy': fields.selection([('direct','Direct Delivery'),('one','All at once')], 'Packing Policy', required=True ),
+ 'picking_policy': fields.selection([('direct','Partial Delivery'),('one','Complete Delivery')], 'Packing Policy', required=True ),
'order_policy': fields.selection([
('prepaid','Payment before delivery'),
('manual','Shipping & Manual Invoice'),
@@ -322,9 +326,13 @@ class sale_order(osv.osv):
'comment': order.note,
'payment_term': pay_term,
}
- inv.update(self._inv_get(cr, uid, order))
inv_obj = self.pool.get('account.invoice')
+ inv.update(self._inv_get(cr, uid, order))
inv_id = inv_obj.create(cr, uid, inv)
+ data = inv_obj.onchange_payment_term_date_invoice(cr, uid, [inv_id],
+ pay_term,time.strftime('%Y-%m-%d'))
+ if data.get('value',False):
+ inv_obj.write(cr, uid, [inv_id], inv.update(data['value']), context=context)
inv_obj.button_compute(cr, uid, [inv_id])
return inv_id
@@ -464,12 +472,14 @@ class sale_order(osv.osv):
def action_ship_create(self, cr, uid, ids, *args):
picking_id=False
+ company = self.pool.get('res.users').browse(cr, uid, uid).company_id
for order in self.browse(cr, uid, ids, context={}):
output_id = order.shop_id.warehouse_id.lot_output_id.id
picking_id = False
for line in order.order_line:
proc_id=False
- date_planned = (DateTime.now() + DateTime.RelativeDateTime(days=line.delay or 0.0)).strftime('%Y-%m-%d')
+ date_planned = DateTime.now() + DateTime.RelativeDateTime(days=line.delay or 0.0)
+ date_planned = (date_planned - DateTime.RelativeDateTime(days=company.security_lead)).strftime('%Y-%m-%d')
if line.state == 'done':
continue
if line.product_id and line.product_id.product_tmpl_id.type in ('product', 'consu'):
@@ -771,12 +781,7 @@ class sale_order_line(osv.osv):
if not product:
return {'value': {'th_weight' : 0, 'product_packaging': False,
'product_uos_qty': qty}, 'domain': {'product_uom': [],
- 'product_uos': []}}
-
- if not pricelist:
- raise osv.except_osv(_('No Pricelist !'),
- _('You have to select a pricelist in the sale form !\n'
- 'Please set one before choosing a product.'))
+ 'product_uos': []}}
if not date_order:
date_order = time.strftime('%Y-%m-%d')
@@ -788,18 +793,7 @@ class sale_order_line(osv.osv):
pack = self.pool.get('product.packaging').browse(cr, uid, packaging, context)
q = product_uom_obj._compute_qty(cr, uid, uom, pack.qty, default_uom)
qty = qty - qty % q + q
- result['product_uom_qty'] = qty
-
- price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],
- product, qty or 1.0, partner_id, {
- 'uom': uom,
- 'date': date_order,
- })[pricelist]
- if price is False:
- raise osv.except_osv(_('No valid pricelist line found !'),
- _("Couldn't find a pricelist line matching this product and quantity.\n"
- "You have to change either the product, the quantity or the pricelist."))
-
+ result['product_uom_qty'] = qty
if uom:
uom2 = product_uom_obj.browse(cr, uid, uom)
@@ -814,7 +808,7 @@ class sale_order_line(osv.osv):
else:
uos = False
- result .update({'price_unit': price, 'type': product_obj.procure_method})
+ result .update({'type': product_obj.procure_method})
if product_obj.description_sale:
result['notes'] = product_obj.description_sale
@@ -868,7 +862,34 @@ class sale_order_line(osv.osv):
result['product_uom_qty'] = qty_uos / product_obj.uos_coeff
result['th_weight'] = result['product_uom_qty'] * product_obj.weight
# Round the quantity up
- return {'value': result, 'domain': domain}
+
+ # get unit price
+ warning={}
+ if not pricelist:
+ warning={
+ 'title':'No Pricelist !',
+ 'message':
+ 'You have to select a pricelist in the sale form !\n'
+ 'Please set one before choosing a product.'
+ }
+ else:
+ price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],
+ product, qty or 1.0, partner_id, {
+ 'uom': uom,
+ 'date': date_order,
+ })[pricelist]
+ if price is False:
+ warning={
+ 'title':'No valid pricelist line found !',
+ 'message':
+ "Couldn't find a pricelist line matching this product and quantity.\n"
+ "You have to change either the product, the quantity or the pricelist."
+ }
+ else:
+ result.update({'price_unit': price})
+
+
+ return {'value': result, 'domain': domain,'warning':warning}
def product_uom_change(self, cursor, user, ids, pricelist, product, qty=0,
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 50cf8dbfc0c..d5cfcb25ca7 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -43,6 +43,29 @@
+
+
+ sale.order.calendar
+ sale.order
+ calendar
+
+
+
+
+
+
+
+
+ sale.order.graph
+ sale.order
+ graph
+
+
+
+
+
+
+
sale.order.tree
@@ -207,7 +230,7 @@
ir.actions.act_window
sale.order
form
- tree,form
+ tree,form,calendar,graph
[('user_id','=',uid)]
@@ -218,7 +241,7 @@
ir.actions.act_window
sale.order
form
- tree,form
+ tree,form,calendar,graph
@@ -227,7 +250,7 @@
ir.actions.act_window
sale.order
form
- form,tree
+ form,tree,calendar,graph
@@ -237,7 +260,7 @@
ir.actions.act_window
sale.order
form
- tree,form
+ tree,form,calendar,graph
[('state','in',('shipping_except','invoice_except')]
@@ -247,7 +270,7 @@
ir.actions.act_window
sale.order
form
- tree,form
+ tree,form,calendar,graph
[('state','=','manual')]
@@ -257,7 +280,7 @@
ir.actions.act_window
sale.order
form
- tree,form
+ tree,form,calendar,graph
[('state','in',('progress','waiting_date','manual'))]
@@ -268,7 +291,7 @@
ir.actions.act_window
sale.order
form
- tree,form
+ tree,form,calendar,graph
[('state','=','draft')]
@@ -278,7 +301,7 @@
ir.actions.act_window
sale.order
form
- tree,form
+ tree,form,calendar,graph
[('state','in',('shipping_except','invoice_except')),('user_id','=',uid)]
@@ -288,7 +311,7 @@
ir.actions.act_window
sale.order
form
- tree,form
+ tree,form,calendar,graph
[('state','=','manual'),('user_id','=',uid)]
@@ -298,7 +321,7 @@
ir.actions.act_window
sale.order
form
- tree,form
+ tree,form,calendar,graph
[('state','in',('progress','waiting_date','manual')),('user_id','=',uid)]
@@ -309,7 +332,7 @@
ir.actions.act_window
sale.order
form
- tree,form
+ tree,form,calendar,graph
[('state','=','draft'),('user_id','=',uid)]
@@ -404,7 +427,7 @@
ir.actions.act_window
sale.order.line
form
- tree,form
+ tree,form,graph
[('invoiced','<>', 1),('state','<>','draft'),('state','<>','cancel')]
@@ -414,7 +437,7 @@
ir.actions.act_window
sale.order.line
form
- tree,form
+ tree,form,graph
[('invoiced','<>', 1),('state','=','done')]
diff --git a/addons/sale_crm/sale_crm_wizard.xml b/addons/sale_crm/sale_crm_wizard.xml
index 5a51f092567..0af64870428 100644
--- a/addons/sale_crm/sale_crm_wizard.xml
+++ b/addons/sale_crm/sale_crm_wizard.xml
@@ -3,7 +3,7 @@
+ stock.picking.calendar
+ stock.picking
+ calendar
+
+
+
+
+
+
+
+
+
stock.picking.tree
stock.picking
tree
-
+
-
-
-
+
+
+
@@ -477,11 +490,11 @@
@@ -577,7 +589,8 @@
-
+
+
@@ -638,7 +651,7 @@
stock.picking
ir.actions.act_window
form
- tree,form
+ tree,form,calendar
[('type','=','delivery')]
{'contact_display': 'partner'}
@@ -662,7 +675,7 @@
stock.picking
ir.actions.act_window
form
- tree,form
+ tree,form,calendar
[('state','=','assigned'),('type','=','delivery')]
{'contact_display': 'partner'}
@@ -685,7 +698,7 @@
stock.picking
ir.actions.act_window
form
- tree,form
+ tree,form,calendar
[('state','=','confirmed'),('type','=','delivery')]
{'contact_display': 'partner'}
@@ -713,14 +726,13 @@
tree
-
+
-
-
-
+
+
@@ -735,6 +747,8 @@
+
+
@@ -794,7 +808,7 @@
stock.picking
ir.actions.act_window
form
- tree,form
+ tree,form,calendar
[('type','=','out')]
{'contact_display': 'partner'}
@@ -817,7 +831,7 @@
stock.picking
ir.actions.act_window
form
- tree,form
+ tree,form,calendar
[('state','=','assigned'),('type','=','out')]
{'contact_display': 'partner'}
@@ -840,7 +854,7 @@
stock.picking
ir.actions.act_window
form
- tree,form
+ tree,form,calendar
[('state','=','confirmed'),('type','=','out')]
{'contact_display': 'partner'}
@@ -873,6 +887,7 @@
+
@@ -883,10 +898,11 @@
form