[IMP]Purchase : Warinig Messages are Changed

bzr revid: hsa@tinyerp.com-20120712060049-u38d37i1oxz7bo3g
This commit is contained in:
Hardik 2012-07-12 11:30:49 +05:30
parent 6cbb04758a
commit 646b0a1067
2 changed files with 10 additions and 10 deletions

View File

@ -238,7 +238,7 @@ class purchase_order(osv.osv):
if s['state'] in ['draft','cancel']:
unlink_ids.append(s['id'])
else:
raise osv.except_osv(_('Invalid action !'), _('In order to delete a purchase order, it must be cancelled first!'))
raise osv.except_osv(_('Invalid action !'), _('In order to delete a purchase order, it must be cancelled first.'))
# TODO: temporary fix in 5.0, to remove in 5.2 when subflows support
# automatically sending subflow.delete upon deletion
@ -428,7 +428,7 @@ class purchase_order(osv.osv):
journal_ids = journal_obj.search(cr, uid, [('type', '=','purchase'),('company_id', '=', order.company_id.id)], limit=1)
if not journal_ids:
raise osv.except_osv(_('Error !'),
_('There is no purchase journal defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id))
_('No purchase journal is defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id))
# generate invoice line correspond to PO line and link that to created invoice (inv_id) and PO line
inv_lines = []
@ -438,7 +438,7 @@ class purchase_order(osv.osv):
if not acc_id:
acc_id = po_line.product_id.categ_id.property_account_expense_categ.id
if not acc_id:
raise osv.except_osv(_('Error !'), _('There is no expense account defined for this product: "%s" (id:%d)') % (po_line.product_id.name, po_line.product_id.id,))
raise osv.except_osv(_('Error !'), _('No expense account is defined for this company: "%s" (id:%d)') % (po_line.product_id.name, po_line.product_id.id,))
else:
acc_id = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category').id
fpos = order.fiscal_position or False
@ -495,15 +495,15 @@ class purchase_order(osv.osv):
for pick in purchase.picking_ids:
if pick.state not in ('draft','cancel'):
raise osv.except_osv(
_('Unable to cancel this purchase order!'),
_('You must first cancel all receptions related to this purchase order.'))
_('Unable to cancel this purchase order.'),
_('First cancelled all receptions related to this purchase order.'))
for pick in purchase.picking_ids:
wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_cancel', cr)
for inv in purchase.invoice_ids:
if inv and inv.state not in ('cancel','draft'):
raise osv.except_osv(
_('Unable to cancel this purchase order!'),
_('You must first cancel all invoices related to this purchase order.'))
_('Unable to cancel this purchase order.'),
_('First cancelled all receptions related to this purchase order.'))
if inv:
wf_service.trg_validate(uid, 'account.invoice', inv.id, 'invoice_cancel', cr)
self.write(cr,uid,ids,{'state':'cancel'})
@ -887,9 +887,9 @@ class purchase_order_line(osv.osv):
# - check for the presence of partner_id and pricelist_id
if not pricelist_id:
raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist or a supplier in the purchase form !\nPlease set one before choosing a product.'))
raise osv.except_osv(_('No Pricelist !'), _('Before choosing a product,\n select a price list for a supplier in the purchase form.'))
if not partner_id:
raise osv.except_osv(_('No Partner!'), _('You have to select a partner in the purchase form !\nPlease set one partner before choosing a product.'))
raise osv.except_osv(_('No Partner!'), _('Before choosing a product.\n select a partner in purchase order.'))
# - determine name and notes based on product in partner lang.
lang = res_partner.browse(cr, uid, partner_id).lang

View File

@ -38,7 +38,7 @@ class purchase_requisition_partner(osv.osv_memory):
record_id = context and context.get('active_id', False) or False
tender = self.pool.get('purchase.requisition').browse(cr, uid, record_id, context=context)
if not tender.line_ids:
raise osv.except_osv(_('Error!'), _('No Product in Tender'))
raise osv.except_osv(_('Error!'), _('No Product in Tender.'))
return res
def create_order(self, cr, uid, ids, context=None):