[IMP] Improvement in sale and mrp

bzr revid: ksa@tinyerp.co.in-20100602135427-p8w2q3n3venurpbn
This commit is contained in:
ksa (Open ERP) 2010-06-02 19:24:27 +05:30
parent 79f3002d37
commit 22f4394162
5 changed files with 48 additions and 46 deletions

View File

@ -41,7 +41,7 @@ class account_invoice_confirm(osv.osv_memory):
for record in data_inv:
if record['state'] not in ('draft','proforma','proforma2'):
raise osv.except_osv(_('Warning'), _("Selected Invoice(s) cannot be confirmed as they are not in 'Draft' or 'Pro-Forma' state!"))
wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_open', cr)
wf_service.trg_validate(uid, 'account.invoice', record['id'], 'invoice_open', cr)
return {}
account_invoice_confirm()

View File

@ -20,6 +20,7 @@
##############################################################################
from mx import DateTime
from datetime import datetime, timedelta
from osv import fields
from osv import osv
from tools.translate import _
@ -419,7 +420,6 @@ class mrp_production(osv.osv):
_name = 'mrp.production'
_description = 'Manufacturing Order'
_date_name = 'date_planned'
_log_create = True
def _production_calc(self, cr, uid, ids, prop, unknow_none, context={}):
""" Calculates total hours and total no. of cycles for a production order.
@ -647,12 +647,16 @@ class mrp_production(osv.osv):
""" Changes the production state to Ready and location id of stock move.
@return: True
"""
for production in self.browse(cr, uid, ids):
production = self.browse(cr, uid, [production.id])[0]
s_date = datetime.strptime(production.date_planned,'%Y-%m-%d %H:%M:%S')
for (id,name) in self.name_get(cr, uid, ids):
message = _('Manufacturing Order ') + " '" + name + "' "+ _("is ready to produce.")
message = _('Manufacturing Order ') + " '" + name + "' "+ _("scheduled the") + " "
message += s_date.strftime('%Y-%m-%d') + " " + _("for") + " " + production.product_id.default_code
self.log(cr, uid, id, message)
move_obj = self.pool.get('stock.move')
self.write(cr, uid, ids, {'state': 'ready'})
for production in self.browse(cr, uid, ids):
if production.move_prod_id:
move_obj.write(cr, uid, [production.move_prod_id.id],
{'location_id': production.location_dest_id.id})

View File

@ -261,7 +261,6 @@ project()
class task(osv.osv):
_name = "project.task"
_description = "Task"
_log_create = True
_date_name = "date_start"
def _str_get(self, task, level=0, border='***', context={}):

View File

@ -211,7 +211,6 @@ class purchase_order(osv.osv):
}
_name = "purchase.order"
_description = "Purchase Order"
_log_create = True
_order = "name desc"
def unlink(self, cr, uid, ids, context=None):