[IMP]Removed space before Exclamation marks [!]

bzr revid: ggh@tinyerp.com-20130429071557-vnxo5nni03vc886j
This commit is contained in:
ggh-openerp 2013-04-29 12:45:57 +05:30
parent 1cdda96284
commit 3b73e2b2a4
32 changed files with 71 additions and 71 deletions

View File

@ -648,10 +648,10 @@ class account_account(osv.osv):
if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]): if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]):
#Check for 'Closed' type #Check for 'Closed' type
if old_type == 'closed' and new_type !='closed': if old_type == 'closed' and new_type !='closed':
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from 'Closed' to any other type as it contains journal items!")) raise osv.except_osv(_('Warning!'), _("You cannot change the type of account from 'Closed' to any other type as it contains journal items!"))
# Forbid to change an account type for restricted_groups as it contains journal items (or if one of its children does) # Forbid to change an account type for restricted_groups as it contains journal items (or if one of its children does)
if (new_type in restricted_groups): if (new_type in restricted_groups):
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account to '%s' type as it contains journal items!") % (new_type,)) raise osv.except_osv(_('Warning!'), _("You cannot change the type of account to '%s' type as it contains journal items!") % (new_type,))
return True return True
@ -1015,14 +1015,14 @@ class account_period(osv.osv):
if not result: if not result:
result = self.search(cr, uid, args, context=context) result = self.search(cr, uid, args, context=context)
if not result: if not result:
raise osv.except_osv(_('Error !'), _('There is no period defined for this date: %s.\nPlease create one.')%dt) raise osv.except_osv(_('Error!'), _('There is no period defined for this date: %s.\nPlease create one.')%dt)
return result return result
def action_draft(self, cr, uid, ids, *args): def action_draft(self, cr, uid, ids, *args):
mode = 'draft' mode = 'draft'
for period in self.browse(cr, uid, ids): for period in self.browse(cr, uid, ids):
if period.fiscalyear_id.state == 'done': if period.fiscalyear_id.state == 'done':
raise osv.except_osv(_('Warning !'), _('You can not re-open a period which belongs to closed fiscal year')) raise osv.except_osv(_('Warning!'), _('You can not re-open a period which belongs to closed fiscal year'))
cr.execute('update account_journal_period set state=%s where period_id in %s', (mode, tuple(ids),)) cr.execute('update account_journal_period set state=%s where period_id in %s', (mode, tuple(ids),))
cr.execute('update account_period set state=%s where id in %s', (mode, tuple(ids),)) cr.execute('update account_period set state=%s where id in %s', (mode, tuple(ids),))
return True return True
@ -2307,7 +2307,7 @@ class account_model(osv.osv):
try: try:
entry['name'] = model.name%{'year': move_date.strftime('%Y'), 'month': move_date.strftime('%m'), 'date': move_date.strftime('%Y-%m')} entry['name'] = model.name%{'year': move_date.strftime('%Y'), 'month': move_date.strftime('%m'), 'date': move_date.strftime('%Y-%m')}
except: except:
raise osv.except_osv(_('Wrong model !'), _('You have a wrong expression "%(...)s" in your model !')) raise osv.except_osv(_('Wrong model!'), _('You have a wrong expression "%(...)s" in your model !'))
move_id = account_move_obj.create(cr, uid, { move_id = account_move_obj.create(cr, uid, {
'ref': entry['name'], 'ref': entry['name'],
'period_id': period_id, 'period_id': period_id,
@ -2319,7 +2319,7 @@ class account_model(osv.osv):
analytic_account_id = False analytic_account_id = False
if line.analytic_account_id: if line.analytic_account_id:
if not model.journal_id.analytic_journal_id: if not model.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (model.journal_id.name,)) raise osv.except_osv(_('No Analytic Journal!'),_("You have to define an analytic journal on the '%s' journal!") % (model.journal_id.name,))
analytic_account_id = line.analytic_account_id.id analytic_account_id = line.analytic_account_id.id
val = { val = {
'move_id': move_id, 'move_id': move_id,

View File

@ -420,7 +420,7 @@ class account_bank_statement(osv.osv):
for st_line in st.line_ids: for st_line in st.line_ids:
if st_line.analytic_account_id: if st_line.analytic_account_id:
if not st.journal_id.analytic_journal_id: if not st.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to assign an analytic journal on the '%s' journal!") % (st.journal_id.name,)) raise osv.except_osv(_('No Analytic Journal!'),_("You have to assign an analytic journal on the '%s' journal!") % (st.journal_id.name,))
if not st_line.amount: if not st_line.amount:
continue continue
st_line_number = self.get_next_st_line_number(cr, uid, st_number, st_line, context) st_line_number = self.get_next_st_line_number(cr, uid, st_number, st_line, context)

View File

@ -252,7 +252,7 @@ class account_cash_statement(osv.osv):
for statement in statement_pool.browse(cr, uid, ids, context=context): for statement in statement_pool.browse(cr, uid, ids, context=context):
vals = {} vals = {}
if not self._user_allow(cr, uid, statement.id, context=context): if not self._user_allow(cr, uid, statement.id, context=context):
raise osv.except_osv(_('Error!'), (_('You do not have rights to open this %s journal !') % (statement.journal_id.name, ))) raise osv.except_osv(_('Error!'), (_('You do not have rights to open this %s journal!') % (statement.journal_id.name, )))
if statement.name and statement.name == '/': if statement.name and statement.name == '/':
c = {'fiscalyear_id': statement.period_id.fiscalyear_id.id} c = {'fiscalyear_id': statement.period_id.fiscalyear_id.id}

View File

@ -69,7 +69,7 @@ class account_invoice(osv.osv):
tt = type2journal.get(type_inv, 'sale') tt = type2journal.get(type_inv, 'sale')
result = self.pool.get('account.analytic.journal').search(cr, uid, [('type','=',tt)], context=context) result = self.pool.get('account.analytic.journal').search(cr, uid, [('type','=',tt)], context=context)
if not result: if not result:
raise osv.except_osv(_('No Analytic Journal !'),_("You must define an analytic journal of type '%s'!") % (tt,)) raise osv.except_osv(_('No Analytic Journal!'),_("You must define an analytic journal of type '%s'!") % (tt,))
return result[0] return result[0]
def _get_type(self, cr, uid, context=None): def _get_type(self, cr, uid, context=None):
@ -736,7 +736,7 @@ class account_invoice(osv.osv):
else: else:
ref = self._convert_ref(cr, uid, inv.number) ref = self._convert_ref(cr, uid, inv.number)
if not inv.journal_id.analytic_journal_id: if not inv.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (inv.journal_id.name,)) raise osv.except_osv(_('No Analytic Journal!'),_("You have to define an analytic journal on the '%s' journal!") % (inv.journal_id.name,))
il['analytic_lines'] = [(0,0, { il['analytic_lines'] = [(0,0, {
'name': il['name'], 'name': il['name'],
'date': inv['date_invoice'], 'date': inv['date_invoice'],
@ -861,7 +861,7 @@ class account_invoice(osv.osv):
if not inv.journal_id.sequence_id: if not inv.journal_id.sequence_id:
raise osv.except_osv(_('Error!'), _('Please define sequence on the journal related to this invoice.')) raise osv.except_osv(_('Error!'), _('Please define sequence on the journal related to this invoice.'))
if not inv.invoice_line: if not inv.invoice_line:
raise osv.except_osv(_('No Invoice Lines !'), _('Please create some invoice lines.')) raise osv.except_osv(_('No Invoice Lines!'), _('Please create some invoice lines.'))
if inv.move_id: if inv.move_id:
continue continue
@ -882,7 +882,7 @@ class account_invoice(osv.osv):
group_check_total = self.pool.get('res.groups').browse(cr, uid, group_check_total_id, context=context) group_check_total = self.pool.get('res.groups').browse(cr, uid, group_check_total_id, context=context)
if group_check_total and uid in [x.id for x in group_check_total.users]: if group_check_total and uid in [x.id for x in group_check_total.users]:
if (inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0)): if (inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0)):
raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe encoded total does not match the computed total.')) raise osv.except_osv(_('Bad total!'), _('Please verify the price of the invoice!\nThe encoded total does not match the computed total.'))
if inv.payment_term: if inv.payment_term:
total_fixed = total_percent = 0 total_fixed = total_percent = 0
@ -1423,7 +1423,7 @@ class account_invoice_line(osv.osv):
context = dict(context) context = dict(context)
context.update({'company_id': company_id, 'force_company': company_id}) context.update({'company_id': company_id, 'force_company': company_id})
if not partner_id: if not partner_id:
raise osv.except_osv(_('No Partner Defined !'),_("You must first select a partner !") ) raise osv.except_osv(_('No Partner Defined!'),_("You must first select a partner!") )
if not product: if not product:
if type in ('in_invoice', 'in_refund'): if type in ('in_invoice', 'in_refund'):
return {'value': {}, 'domain':{'product_uom':[]}} return {'value': {}, 'domain':{'product_uom':[]}}

View File

@ -192,7 +192,7 @@ class account_move_line(osv.osv):
for obj_line in self.browse(cr, uid, ids, context=context): for obj_line in self.browse(cr, uid, ids, context=context):
if obj_line.analytic_account_id: if obj_line.analytic_account_id:
if not obj_line.journal_id.analytic_journal_id: if not obj_line.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (obj_line.journal_id.name, )) raise osv.except_osv(_('No Analytic Journal!'),_("You have to define an analytic journal on the '%s' journal!") % (obj_line.journal_id.name, ))
vals_line = self._prepare_analytic_line(cr, uid, obj_line, context=context) vals_line = self._prepare_analytic_line(cr, uid, obj_line, context=context)
acc_ana_line_obj.create(cr, uid, vals_line) acc_ana_line_obj.create(cr, uid, vals_line)
return True return True
@ -1101,7 +1101,7 @@ class account_move_line(osv.osv):
period = period_obj.browse(cr, uid, period_id, context=context) period = period_obj.browse(cr, uid, period_id, context=context)
for (state,) in result: for (state,) in result:
if state == 'done': if state == 'done':
raise osv.except_osv(_('Error !'), _('You can not add/modify entries in a closed period %s of journal %s.' % (period.name,journal.name))) raise osv.except_osv(_('Error!'), _('You can not add/modify entries in a closed period %s of journal %s.' % (period.name,journal.name)))
if not result: if not result:
jour_period_obj.create(cr, uid, { jour_period_obj.create(cr, uid, {
'name': (journal.code or journal.name)+':'+(period.name or ''), 'name': (journal.code or journal.name)+':'+(period.name or ''),
@ -1181,7 +1181,7 @@ class account_move_line(osv.osv):
move_id = move_obj.create(cr, uid, v, context) move_id = move_obj.create(cr, uid, v, context)
vals['move_id'] = move_id vals['move_id'] = move_id
else: else:
raise osv.except_osv(_('No piece number !'), _('Cannot create an automatic sequence for this piece.\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.')) raise osv.except_osv(_('No piece number!'), _('Cannot create an automatic sequence for this piece.\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.'))
ok = not (journal.type_control_ids or journal.account_control_ids) ok = not (journal.type_control_ids or journal.account_control_ids)
if ('account_id' in vals): if ('account_id' in vals):
account = account_obj.browse(cr, uid, vals['account_id'], context=context) account = account_obj.browse(cr, uid, vals['account_id'], context=context)

View File

@ -111,7 +111,7 @@ class account_installer(osv.osv_memory):
def check_unconfigured_cmp(self, cr, uid, context=None): def check_unconfigured_cmp(self, cr, uid, context=None):
""" check if there are still unconfigured companies """ """ check if there are still unconfigured companies """
if not self.get_unconfigured_cmp(cr, uid, context=context): if not self.get_unconfigured_cmp(cr, uid, context=context):
raise osv.except_osv(_('No unconfigured company !'), _("There is currently no company without chart of account. The wizard will therefore not be executed.")) raise osv.except_osv(_('No unconfigured company!'), _("There is currently no company without chart of account. The wizard will therefore not be executed."))
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
if context is None: context = {} if context is None: context = {}

View File

@ -641,7 +641,7 @@ class account_analytic_account(osv.osv):
fpos_obj = self.pool.get('account.fiscal.position') fpos_obj = self.pool.get('account.fiscal.position')
if not contract.partner_id: if not contract.partner_id:
raise osv.except_osv(_('No Customer Defined !'),_("You must first select a Customer for Contract %s!") % contract.name ) raise osv.except_osv(_('No Customer Defined!'),_("You must first select a Customer for Contract %s!") % contract.name )
fpos = contract.partner_id.property_account_position.id or False fpos = contract.partner_id.property_account_position.id or False
journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=', contract.company_id.id or False)], limit=1) journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=', contract.company_id.id or False)], limit=1)

View File

@ -332,7 +332,7 @@ class account_move_line(osv.osv):
for line in self.browse(cr, uid, ids, context=context): for line in self.browse(cr, uid, ids, context=context):
if line.analytics_id: if line.analytics_id:
if not line.journal_id.analytic_journal_id: if not line.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal.") % (line.journal_id.name,)) raise osv.except_osv(_('No Analytic Journal!'),_("You have to define an analytic journal on the '%s' journal.") % (line.journal_id.name,))
toremove = analytic_line_obj.search(cr, uid, [('move_id','=',line.id)], context=context) toremove = analytic_line_obj.search(cr, uid, [('move_id','=',line.id)], context=context)
if toremove: if toremove:
@ -471,7 +471,7 @@ class account_bank_statement(osv.osv):
for st_line in st.line_ids: for st_line in st.line_ids:
if st_line.analytics_id: if st_line.analytics_id:
if not st.journal_id.analytic_journal_id: if not st.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal.") % (st.journal_id.name,)) raise osv.except_osv(_('No Analytic Journal!'),_("You have to define an analytic journal on the '%s' journal.") % (st.journal_id.name,))
if not st_line.amount: if not st_line.amount:
continue continue
return True return True

View File

@ -965,7 +965,7 @@ class account_voucher(osv.osv):
name = voucher_brw.number name = voucher_brw.number
elif voucher_brw.journal_id.sequence_id: elif voucher_brw.journal_id.sequence_id:
if not voucher_brw.journal_id.sequence_id.active: if not voucher_brw.journal_id.sequence_id.active:
raise osv.except_osv(_('Configuration Error !'), raise osv.except_osv(_('Configuration Error!'),
_('Please activate the sequence of selected journal !')) _('Please activate the sequence of selected journal !'))
c = dict(context) c = dict(context)
c.update({'fiscalyear_id': voucher_brw.period_id.fiscalyear_id.id}) c.update({'fiscalyear_id': voucher_brw.period_id.fiscalyear_id.id})

View File

@ -104,7 +104,7 @@ class hr_analytic_timesheet(osv.osv):
a = r.product_id.categ_id.property_account_expense_categ.id a = r.product_id.categ_id.property_account_expense_categ.id
if not a: if not a:
raise osv.except_osv(_('Error!'), raise osv.except_osv(_('Error!'),
_('There is no expense account define ' \ _('There is no expense account defined ' \
'for this product: "%s" (id:%d)') % \ 'for this product: "%s" (id:%d)') % \
(r.product_id.name, r.product_id.id,)) (r.product_id.name, r.product_id.id,))
# Compute based on pricetype # Compute based on pricetype
@ -133,7 +133,7 @@ class hr_analytic_timesheet(osv.osv):
a = r.product_id.categ_id.property_account_expense_categ.id a = r.product_id.categ_id.property_account_expense_categ.id
if not a: if not a:
raise osv.except_osv(_('Error!'), raise osv.except_osv(_('Error!'),
_('There is no expense account define ' \ _('There is no expense account defined ' \
'for this product: "%s" (id:%d)') % \ 'for this product: "%s" (id:%d)') % \
(r.product_id.name, r.product_id.id,)) (r.product_id.name, r.product_id.id,))
# Compute based on pricetype # Compute based on pricetype

View File

@ -86,11 +86,11 @@ class ir_model_fields_anonymization(osv.osv):
if context.get('manual'): if context.get('manual'):
global_state = self._get_global_state(cr, uid, context=context) global_state = self._get_global_state(cr, uid, context=context)
if global_state == 'anonymized': if global_state == 'anonymized':
raise osv.except_osv('Error !', "The database is currently anonymized, you cannot create, modify or delete fields.") raise osv.except_osv('Error!', "The database is currently anonymized, you cannot create, modify or delete fields.")
elif global_state == 'unstable': elif global_state == 'unstable':
msg = _("The database anonymization is currently in an unstable state. Some fields are anonymized," + \ msg = _("The database anonymization is currently in an unstable state. Some fields are anonymized," + \
" while some fields are not anonymized. You should try to solve this problem before trying to create, write or delete fields.") " while some fields are not anonymized. You should try to solve this problem before trying to create, write or delete fields.")
raise osv.except_osv('Error !', msg) raise osv.except_osv('Error!', msg)
return True return True
@ -357,7 +357,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
else: else:
msg = _("The database anonymization is currently in an unstable state. Some fields are anonymized," + \ msg = _("The database anonymization is currently in an unstable state. Some fields are anonymized," + \
" while some fields are not anonymized. You should try to solve this problem before trying to do anything else.") " while some fields are not anonymized. You should try to solve this problem before trying to do anything else.")
raise osv.except_osv('Error !', msg) raise osv.except_osv('Error!', msg)
res['arch'] = etree.tostring(eview) res['arch'] = etree.tostring(eview)
@ -521,11 +521,11 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
# check that all the defined fields are in the 'anonymized' state # check that all the defined fields are in the 'anonymized' state
state = ir_model_fields_anonymization_model._get_global_state(cr, uid, context=context) state = ir_model_fields_anonymization_model._get_global_state(cr, uid, context=context)
if state == 'clear': if state == 'clear':
raise osv.except_osv_('Error !', "The database is not currently anonymized, you cannot reverse the anonymization.") raise osv.except_osv_('Error!', "The database is not currently anonymized, you cannot reverse the anonymization.")
elif state == 'unstable': elif state == 'unstable':
msg = _("The database anonymization is currently in an unstable state. Some fields are anonymized," + \ msg = _("The database anonymization is currently in an unstable state. Some fields are anonymized," + \
" while some fields are not anonymized. You should try to solve this problem before trying to do anything.") " while some fields are not anonymized. You should try to solve this problem before trying to do anything.")
raise osv.except_osv('Error !', msg) raise osv.except_osv('Error!', msg)
wizards = self.browse(cr, uid, ids, context=context) wizards = self.browse(cr, uid, ids, context=context)
for wizard in wizards: for wizard in wizards:

View File

@ -104,7 +104,7 @@ class base_state(object):
if parent_id.change_responsible and parent_id.user_id: if parent_id.change_responsible and parent_id.user_id:
data['user_id'] = parent_id.user_id.id data['user_id'] = parent_id.user_id.id
else: else:
raise osv.except_osv(_('Error !'), _('You can not escalate, you are already at the top level regarding your sales-team category.')) raise osv.except_osv(_('Error!'), _('You can not escalate, you are already at the top level regarding your sales-team category.'))
self.write(cr, uid, [case.id], data, context=context) self.write(cr, uid, [case.id], data, context=context)
case.case_escalate_send_note(parent_id, context=context) case.case_escalate_send_note(parent_id, context=context)
return True return True

View File

@ -86,7 +86,7 @@ class crm_lead2opportunity_partner(osv.osv_memory):
lead_obj = self.pool.get('crm.lead') lead_obj = self.pool.get('crm.lead')
for lead in lead_obj.browse(cr, uid, context.get('active_ids', []), context=context): for lead in lead_obj.browse(cr, uid, context.get('active_ids', []), context=context):
if lead.state in ['done', 'cancel']: if lead.state in ['done', 'cancel']:
raise osv.except_osv(_("Warning !"), _("Closed/Cancelled leads cannot be converted into opportunities.")) raise osv.except_osv(_("Warning!"), _("Closed/Cancelled leads cannot be converted into opportunities."))
return False return False
def _convert_opportunity(self, cr, uid, ids, vals, context=None): def _convert_opportunity(self, cr, uid, ids, vals, context=None):

View File

@ -51,10 +51,10 @@ class sale_order(osv.osv):
for order in self.browse(cr, uid, ids, context=context): for order in self.browse(cr, uid, ids, context=context):
grid_id = carrier_obj.grid_get(cr, uid, [order.carrier_id.id], order.partner_shipping_id.id) grid_id = carrier_obj.grid_get(cr, uid, [order.carrier_id.id], order.partner_shipping_id.id)
if not grid_id: if not grid_id:
raise osv.except_osv(_('No grid available !'), _('No grid matching for this carrier !')) raise osv.except_osv(_('No Grid Available!'), _('No grid matching for this carrier!'))
if not order.state in ('draft'): if not order.state in ('draft'):
raise osv.except_osv(_('Order not in draft state !'), _('The order state have to be draft to add delivery lines.')) raise osv.except_osv(_('Order Not In Draft State!'), _('The order state have to be draft to add delivery lines.'))
grid = grid_obj.browse(cr, uid, grid_id, context=context) grid = grid_obj.browse(cr, uid, grid_id, context=context)

View File

@ -46,7 +46,7 @@ class hr_attendance_error(osv.osv_memory):
cr.execute("SELECT id FROM hr_attendance WHERE employee_id IN %s AND to_char(name,'YYYY-mm-dd')<=%s AND to_char(name,'YYYY-mm-dd')>=%s AND action IN %s ORDER BY name" ,(tuple(context['active_ids']), date_to, date_from, tuple(['sign_in','sign_out']))) cr.execute("SELECT id FROM hr_attendance WHERE employee_id IN %s AND to_char(name,'YYYY-mm-dd')<=%s AND to_char(name,'YYYY-mm-dd')>=%s AND action IN %s ORDER BY name" ,(tuple(context['active_ids']), date_to, date_from, tuple(['sign_in','sign_out'])))
attendance_ids = [x[0] for x in cr.fetchall()] attendance_ids = [x[0] for x in cr.fetchall()]
if not attendance_ids: if not attendance_ids:
raise osv.except_osv(_('No Data Available !'), _('No records are found for your selection!')) raise osv.except_osv(_('No Data Available!'), _('No records are found for your selection!'))
attendance_records = self.pool.get('hr.attendance').browse(cr, uid, attendance_ids, context=context) attendance_records = self.pool.get('hr.attendance').browse(cr, uid, attendance_ids, context=context)
for rec in attendance_records: for rec in attendance_records:

View File

@ -49,7 +49,7 @@ class hr_payslip_employees(osv.osv_memory):
to_date = run_data.get('date_end', False) to_date = run_data.get('date_end', False)
credit_note = run_data.get('credit_note', False) credit_note = run_data.get('credit_note', False)
if not data['employee_ids']: if not data['employee_ids']:
raise osv.except_osv(_("Warning !"), _("You must select employee(s) to generate payslip(s).")) raise osv.except_osv(_("Warning!"), _("You must select employee(s) to generate payslip(s)."))
for emp in emp_pool.browse(cr, uid, data['employee_ids'], context=context): for emp in emp_pool.browse(cr, uid, data['employee_ids'], context=context):
slip_data = slip_pool.onchange_employee_id(cr, uid, [], from_date, to_date, emp.id, contract_id=False, context=context) slip_data = slip_pool.onchange_employee_id(cr, uid, [], from_date, to_date, emp.id, contract_id=False, context=context)
res = { res = {

View File

@ -181,7 +181,7 @@ class account_analytic_line(osv.osv):
for account in analytic_account_obj.browse(cr, uid, list(account_ids), context=context): for account in analytic_account_obj.browse(cr, uid, list(account_ids), context=context):
partner = account.partner_id partner = account.partner_id
if (not partner) or not (account.pricelist_id): if (not partner) or not (account.pricelist_id):
raise osv.except_osv(_('Analytic Account incomplete !'), raise osv.except_osv(_('Analytic Account incomplete!'),
_('Contract incomplete. Please fill in the Customer and Pricelist fields.')) _('Contract incomplete. Please fill in the Customer and Pricelist fields.'))
date_due = False date_due = False

View File

@ -103,7 +103,7 @@ class payroll_advice(osv.osv):
slip_ids = payslip_pool.search(cr, uid, [('date_from', '<=', advice.date), ('date_to', '>=', advice.date), ('state', '=', 'done')], context=context) slip_ids = payslip_pool.search(cr, uid, [('date_from', '<=', advice.date), ('date_to', '>=', advice.date), ('state', '=', 'done')], context=context)
for slip in payslip_pool.browse(cr, uid, slip_ids, context=context): for slip in payslip_pool.browse(cr, uid, slip_ids, context=context):
if not slip.employee_id.bank_account_id and not slip.employee_id.bank_account_id.acc_number: if not slip.employee_id.bank_account_id and not slip.employee_id.bank_account_id.acc_number:
raise osv.except_osv(_('Error !'), _('Please define bank account for the %s employee') % (slip.employee_id.name)) raise osv.except_osv(_('Error!'), _('Please define bank account for the %s employee') % (slip.employee_id.name))
line_ids = payslip_line_pool.search(cr, uid, [ ('slip_id', '=', slip.id), ('code', '=', 'NET')], context=context) line_ids = payslip_line_pool.search(cr, uid, [ ('slip_id', '=', slip.id), ('code', '=', 'NET')], context=context)
if line_ids: if line_ids:
line = payslip_line_pool.browse(cr, uid, line_ids, context=context)[0] line = payslip_line_pool.browse(cr, uid, line_ids, context=context)[0]
@ -129,7 +129,7 @@ class payroll_advice(osv.osv):
seq_obj = self.pool.get('ir.sequence') seq_obj = self.pool.get('ir.sequence')
for advice in self.browse(cr, uid, ids, context=context): for advice in self.browse(cr, uid, ids, context=context):
if not advice.line_ids: if not advice.line_ids:
raise osv.except_osv(_('Error !'), _('You can not confirm Payment advice without advice lines.')) raise osv.except_osv(_('Error!'), _('You can not confirm Payment advice without advice lines.'))
advice_date = datetime.strptime(advice.date, DATETIME_FORMAT) advice_date = datetime.strptime(advice.date, DATETIME_FORMAT)
advice_year = advice_date.strftime('%m') + '-' + advice_date.strftime('%Y') advice_year = advice_date.strftime('%m') + '-' + advice_date.strftime('%Y')
number = seq_obj.get(cr, uid, 'payment.advice') number = seq_obj.get(cr, uid, 'payment.advice')
@ -183,7 +183,7 @@ class hr_payslip_run(osv.osv):
users = self.pool.get('res.users').browse(cr, uid, [uid], context=context) users = self.pool.get('res.users').browse(cr, uid, [uid], context=context)
for run in self.browse(cr, uid, ids, context=context): for run in self.browse(cr, uid, ids, context=context):
if run.available_advice: if run.available_advice:
raise osv.except_osv(_('Error !'), _("Payment advice already exists for %s, 'Set to Draft' to create a new advice.") %(run.name)) raise osv.except_osv(_('Error!'), _("Payment advice already exists for %s, 'Set to Draft' to create a new advice.") %(run.name))
advice_data = { advice_data = {
'batch_id': run.id, 'batch_id': run.id,
'company_id': users[0].company_id.id, 'company_id': users[0].company_id.id,
@ -201,7 +201,7 @@ class hr_payslip_run(osv.osv):
for slip in payslip_pool.browse(cr, uid, slip_ids, context=context): for slip in payslip_pool.browse(cr, uid, slip_ids, context=context):
if not slip.employee_id.bank_account_id or not slip.employee_id.bank_account_id.acc_number: if not slip.employee_id.bank_account_id or not slip.employee_id.bank_account_id.acc_number:
raise osv.except_osv(_('Error !'), _('Please define bank account for the %s employee') % (slip.employee_id.name)) raise osv.except_osv(_('Error!'), _('Please define bank account for the %s employee') % (slip.employee_id.name))
line_ids = payslip_line_pool.search(cr, uid, [('slip_id', '=', slip.id), ('code', '=', 'NET')], context=context) line_ids = payslip_line_pool.search(cr, uid, [('slip_id', '=', slip.id), ('code', '=', 'NET')], context=context)
if line_ids: if line_ids:
line = payslip_line_pool.browse(cr, uid, line_ids, context=context)[0] line = payslip_line_pool.browse(cr, uid, line_ids, context=context)[0]

View File

@ -64,7 +64,7 @@ class report_custom(report_int):
self.obj.render() self.obj.render()
return (self.obj.pdf, 'pdf') return (self.obj.pdf, 'pdf')
except Exception: except Exception:
raise osv.except_osv(_('pdf not created !'), _('Please check if package pdftk is installed!')) raise osv.except_osv(_('pdf not created!'), _('Please check if package pdftk is installed!'))
report_custom('report.l10n_lu.tax.report.print') report_custom('report.l10n_lu.tax.report.print')

View File

@ -128,7 +128,7 @@ class mrp_production_workcenter_line(osv.osv):
elif prod_obj.state =='in_production': elif prod_obj.state =='in_production':
return return
else: else:
raise osv.except_osv(_('Error!'),_('Manufacturing order cannot start in state "%s"!') % (prod_obj.state,)) raise osv.except_osv(_('Error!'),_('Manufacturing order cannot be started in state "%s"!') % (prod_obj.state,))
else: else:
oper_ids = self.search(cr,uid,[('production_id','=',prod_obj.id)]) oper_ids = self.search(cr,uid,[('production_id','=',prod_obj.id)])
obj = self.browse(cr,uid,oper_ids) obj = self.browse(cr,uid,oper_ids)
@ -443,7 +443,7 @@ class mrp_operations_operation(osv.osv):
if not oper_objs: if not oper_objs:
if code.start_stop!='start': if code.start_stop!='start':
raise osv.except_osv(_('Sorry!'),_('Operation is not started yet !')) raise osv.except_osv(_('Sorry!'),_('Operation is not started yet!'))
return False return False
else: else:
for oper in oper_objs: for oper in oper_objs:

View File

@ -365,7 +365,7 @@ class mrp_repair(osv.osv):
if repair.state in ('draft','cancel') or repair.invoice_id: if repair.state in ('draft','cancel') or repair.invoice_id:
continue continue
if not (repair.partner_id.id and repair.partner_invoice_id.id): if not (repair.partner_id.id and repair.partner_invoice_id.id):
raise osv.except_osv(_('No partner !'),_('You have to select a Partner Invoice Address in the repair form !')) raise osv.except_osv(_('No partner!'),_('You have to select a Partner Invoice Address in the repair form!'))
comment = repair.quotation_notes comment = repair.quotation_notes
if (repair.invoice_method != 'none'): if (repair.invoice_method != 'none'):
if group and repair.partner_invoice_id.id in invoices_group: if group and repair.partner_invoice_id.id in invoices_group:
@ -582,7 +582,7 @@ class ProductChangeMixin(object):
result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id or False result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id or False
if not pricelist: if not pricelist:
warning = { warning = {
'title':'No Pricelist !', 'title':'No Pricelist!',
'message': 'message':
'You have to select a pricelist in the Repair form !\n' 'You have to select a pricelist in the Repair form !\n'
'Please set one before choosing a product.' 'Please set one before choosing a product.'

View File

@ -545,7 +545,7 @@ class pos_order(osv.osv):
def unlink(self, cr, uid, ids, context=None): def unlink(self, cr, uid, ids, context=None):
for rec in self.browse(cr, uid, ids, context=context): for rec in self.browse(cr, uid, ids, context=context):
if rec.state not in ('draft','cancel'): if rec.state not in ('draft','cancel'):
raise osv.except_osv(_('Unable to Delete !'), _('In order to delete a sale, it must be new or cancelled.')) raise osv.except_osv(_('Unable to Delete!'), _('In order to delete a sale, it must be new or cancelled.'))
return super(pos_order, self).unlink(cr, uid, ids, context=context) return super(pos_order, self).unlink(cr, uid, ids, context=context)
def onchange_partner_id(self, cr, uid, ids, part=False, context=None): def onchange_partner_id(self, cr, uid, ids, part=False, context=None):
@ -1163,7 +1163,7 @@ class pos_order_line(osv.osv):
if not product_id: if not product_id:
return {} return {}
if not pricelist: if not pricelist:
raise osv.except_osv(_('No Pricelist !'), raise osv.except_osv(_('No Pricelist!'),
_('You have to select a pricelist in the sale form !\n' \ _('You have to select a pricelist in the sale form !\n' \
'Please set one before choosing a product.')) 'Please set one before choosing a product.'))

View File

@ -46,7 +46,7 @@ class pos_open_statement(osv.osv_memory):
st_ids = [] st_ids = []
j_ids = journal_obj.search(cr, uid, [('journal_user','=',1)], context=context) j_ids = journal_obj.search(cr, uid, [('journal_user','=',1)], context=context)
if not j_ids: if not j_ids:
raise osv.except_osv(_('No Cash Register Defined !'), _('You have to define which payment method must be available in the point of sale by reusing existing bank and cash through "Accounting / Configuration / Journals / Journals". Select a journal and check the field "PoS Payment Method" from the "Point of Sale" tab. You can also create new payment methods directly from menu "PoS Backend / Configuration / Payment Methods".')) raise osv.except_osv(_('No Cash Register Defined!'), _('You have to define which payment method must be available in the point of sale by reusing existing bank and cash through "Accounting / Configuration / Journals / Journals". Select a journal and check the field "PoS Payment Method" from the "Point of Sale" tab. You can also create new payment methods directly from menu "PoS Backend / Configuration / Payment Methods".'))
for journal in journal_obj.browse(cr, uid, j_ids, context=context): for journal in journal_obj.browse(cr, uid, j_ids, context=context):
ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)], context=context) ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)], context=context)

View File

@ -307,7 +307,7 @@ class procurement_order(osv.osv):
move_obj = self.pool.get('stock.move') move_obj = self.pool.get('stock.move')
for procurement in self.browse(cr, uid, ids, context=context): for procurement in self.browse(cr, uid, ids, context=context):
if procurement.product_qty <= 0.00: if procurement.product_qty <= 0.00:
raise osv.except_osv(_('Data Insufficient !'), raise osv.except_osv(_('Data Insufficient!'),
_('Please check the quantity in procurement order(s) for the product "%s", it should not be 0 or less!' % procurement.product_id.name)) _('Please check the quantity in procurement order(s) for the product "%s", it should not be 0 or less!' % procurement.product_id.name))
if procurement.product_id.type in ('product', 'consu'): if procurement.product_id.type in ('product', 'consu'):
if not procurement.move_id: if not procurement.move_id:

View File

@ -436,7 +436,7 @@ class project(osv.osv):
for project in projects: for project in projects:
if (not project.members) and force_members: if (not project.members) and force_members:
raise osv.except_osv(_('Warning!'),_("You must assign members on the project '%s' !") % (project.name,)) raise osv.except_osv(_('Warning!'),_("You must assign members on the project '%s'!") % (project.name,))
resource_pool = self.pool.get('resource.resource') resource_pool = self.pool.get('resource.resource')
@ -941,7 +941,7 @@ class task(base_stage, osv.osv):
if task.child_ids: if task.child_ids:
for child in task.child_ids: for child in task.child_ids:
if child.state in ['draft', 'open', 'pending']: if child.state in ['draft', 'open', 'pending']:
raise osv.except_osv(_("Warning !"), _("Child task still open.\nPlease cancel or complete child task first.")) raise osv.except_osv(_("Warning!"), _("Child task still open.\nPlease cancel or complete child task first."))
return True return True
def action_close(self, cr, uid, ids, context=None): def action_close(self, cr, uid, ids, context=None):

View File

@ -49,7 +49,7 @@ class project_timebox_empty(osv.osv_memory):
ids = obj_tb.search(cr, uid, [], context=context) ids = obj_tb.search(cr, uid, [], context=context)
if not len(ids): if not len(ids):
raise osv.except_osv(_('Error!'), _('No timebox child of this one !')) raise osv.except_osv(_('Error!'), _('No timebox child of this one!'))
tids = obj_task.search(cr, uid, [('timebox_id', '=', context['active_id'])]) tids = obj_task.search(cr, uid, [('timebox_id', '=', context['active_id'])])
for task in obj_task.browse(cr, uid, tids, context): for task in obj_task.browse(cr, uid, tids, context):
if (task.state in ('cancel','done')) or (task.user_id.id <> uid): if (task.state in ('cancel','done')) or (task.user_id.id <> uid):

View File

@ -79,22 +79,22 @@ class project_work(osv.osv):
emp_id = emp_obj.search(cr, uid, [('user_id', '=', user_id)]) emp_id = emp_obj.search(cr, uid, [('user_id', '=', user_id)])
if not emp_id: if not emp_id:
user_name = self.pool.get('res.users').read(cr, uid, [user_id], ['name'])[0]['name'] user_name = self.pool.get('res.users').read(cr, uid, [user_id], ['name'])[0]['name']
raise osv.except_osv(_('Bad Configuration !'), raise osv.except_osv(_('Bad Configuration!'),
_('Please define employee for user "%s". You must create one.')% (user_name,)) _('Please define employee for user "%s". You must create one.')% (user_name,))
emp = emp_obj.browse(cr, uid, emp_id[0]) emp = emp_obj.browse(cr, uid, emp_id[0])
if not emp.product_id: if not emp.product_id:
raise osv.except_osv(_('Bad Configuration !'), raise osv.except_osv(_('Bad Configuration!'),
_('Please define product and product category property account on the related employee.\nFill in the HR Settings tab of the employee form.')) _('Please define product and product category property account on the related employee.\nFill in the HR Settings tab of the employee form.'))
if not emp.journal_id: if not emp.journal_id:
raise osv.except_osv(_('Bad Configuration !'), raise osv.except_osv(_('Bad Configuration!'),
_('Please define journal on the related employee.\nFill in the timesheet tab of the employee form.')) _('Please define journal on the related employee.\nFill in the timesheet tab of the employee form.'))
acc_id = emp.product_id.property_account_expense.id acc_id = emp.product_id.property_account_expense.id
if not acc_id: if not acc_id:
acc_id = emp.product_id.categ_id.property_account_expense_categ.id acc_id = emp.product_id.categ_id.property_account_expense_categ.id
if not acc_id: if not acc_id:
raise osv.except_osv(_('Bad Configuration !'), raise osv.except_osv(_('Bad Configuration!'),
_('Please define product and product category property account on the related employee.\nFill in the timesheet tab of the employee form.')) _('Please define product and product category property account on the related employee.\nFill in the timesheet tab of the employee form.'))
res['product_id'] = emp.product_id.id res['product_id'] = emp.product_id.id
@ -286,7 +286,7 @@ class account_analytic_line(osv.osv):
st = acc.to_invoice.id st = acc.to_invoice.id
res['value']['to_invoice'] = st or False res['value']['to_invoice'] = st or False
if acc.state == 'close' or acc.state == 'cancelled': if acc.state == 'close' or acc.state == 'cancelled':
raise osv.except_osv(_('Invalid Analytic Account !'), _('You cannot select a Analytic Account which is in Close or Cancelled state.')) raise osv.except_osv(_('Invalid Analytic Account!'), _('You cannot select a Analytic Account which is in Close or Cancelled state.'))
return res return res

View File

@ -273,7 +273,7 @@ class sale_order(osv.osv):
if s['state'] in ['draft', 'cancel']: if s['state'] in ['draft', 'cancel']:
unlink_ids.append(s['id']) unlink_ids.append(s['id'])
else: else:
raise osv.except_osv(_('Invalid Action!'), _('In order to delete a confirmed sales order, you must cancel it before !')) raise osv.except_osv(_('Invalid Action!'), _('In order to delete a confirmed sales order, you must cancel it before!'))
return osv.osv.unlink(self, cr, uid, unlink_ids, context=context) return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
@ -870,7 +870,7 @@ class sale_order_line(osv.osv):
context = context or {} context = context or {}
lang = lang or context.get('lang',False) lang = lang or context.get('lang',False)
if not partner_id: if not partner_id:
raise osv.except_osv(_('No Customer Defined !'), _('Before choosing a product,\n select a customer in the sales form.')) raise osv.except_osv(_('No Customer Defined!'), _('Before choosing a product,\n select a customer in the sales form.'))
warning = {} warning = {}
product_uom_obj = self.pool.get('product.uom') product_uom_obj = self.pool.get('product.uom')
partner_obj = self.pool.get('res.partner') partner_obj = self.pool.get('res.partner')

View File

@ -87,7 +87,7 @@ class crm_make_sale(osv.osv_memory):
['default', 'invoice', 'delivery', 'contact']) ['default', 'invoice', 'delivery', 'contact'])
pricelist = partner.property_product_pricelist.id pricelist = partner.property_product_pricelist.id
if False in partner_addr.values(): if False in partner_addr.values():
raise osv.except_osv(_('Insufficient Data!'), _('No addresse(s) defined for this customer.')) raise osv.except_osv(_('Insufficient Data!'), _('No addresse(es) defined for this customer.'))
vals = { vals = {
'origin': _('Opportunity: %s') % str(case.id), 'origin': _('Opportunity: %s') % str(case.id),

View File

@ -1109,7 +1109,7 @@ class stock_picking(osv.osv):
if isinstance(partner, int): if isinstance(partner, int):
partner = partner_obj.browse(cr, uid, [partner], context=context)[0] partner = partner_obj.browse(cr, uid, [partner], context=context)[0]
if not partner: if not partner:
raise osv.except_osv(_('Error, no partner !'), raise osv.except_osv(_('Error, no partner!'),
_('Please put a partner on the picking list if you want to generate invoice.')) _('Please put a partner on the picking list if you want to generate invoice.'))
if not inv_type: if not inv_type:
@ -1763,7 +1763,7 @@ class stock_move(osv.osv):
for move in self.browse(cr, uid, ids, context=context): for move in self.browse(cr, uid, ids, context=context):
if move.state == 'done': if move.state == 'done':
if frozen_fields.intersection(vals): if frozen_fields.intersection(vals):
raise osv.except_osv(_('Operation forbidden !'), raise osv.except_osv(_('Operation Forbidden!'),
_('Quantities, Units of Measure, Products and Locations cannot be modified on stock moves that have already been processed (except by the Administrator).')) _('Quantities, Units of Measure, Products and Locations cannot be modified on stock moves that have already been processed (except by the Administrator).'))
return super(stock_move, self).write(cr, uid, ids, vals, context=context) return super(stock_move, self).write(cr, uid, ids, vals, context=context)

View File

@ -115,7 +115,7 @@ class subscription_subscription(osv.osv):
id = int(id) id = int(id)
model = self.pool[model_name] model = self.pool[model_name]
except: except:
raise osv.except_osv(_('Wrong Source Document !'), _('Please provide another source document.\nThis one does not exist !')) raise osv.except_osv(_('Wrong Source Document!'), _('Please provide another source document.\nThis one does not exist!'))
default = {'state':'draft'} default = {'state':'draft'}
doc_obj = self.pool.get('subscription.document') doc_obj = self.pool.get('subscription.document')
@ -142,7 +142,7 @@ class subscription_subscription(osv.osv):
def unlink(self, cr, uid, ids, context=None): def unlink(self, cr, uid, ids, context=None):
for record in self.browse(cr, uid, ids, context or {}): for record in self.browse(cr, uid, ids, context or {}):
if record.state=="running": if record.state=="running":
raise osv.except_osv(_('Error!'),_('You cannot delete an active subscription !')) raise osv.except_osv(_('Error!'),_('You cannot delete an active subscription!'))
return super(subscription_subscription, self).unlink(cr, uid, ids, context) return super(subscription_subscription, self).unlink(cr, uid, ids, context)
def set_done(self, cr, uid, ids, context=None): def set_done(self, cr, uid, ids, context=None):

View File

@ -63,7 +63,7 @@ class sale_order(osv.osv):
partner = self.pool.get('res.partner').browse(cr, uid, part, context=context) partner = self.pool.get('res.partner').browse(cr, uid, part, context=context)
if partner.sale_warn != 'no-message': if partner.sale_warn != 'no-message':
if partner.sale_warn == 'block': if partner.sale_warn == 'block':
raise osv.except_osv(_('Alert for %s !') % (partner.name), partner.sale_warn_msg) raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.sale_warn_msg)
title = _("Warning for %s") % partner.name title = _("Warning for %s") % partner.name
message = partner.sale_warn_msg message = partner.sale_warn_msg
warning = { warning = {
@ -91,7 +91,7 @@ class purchase_order(osv.osv):
partner = self.pool.get('res.partner').browse(cr, uid, part) partner = self.pool.get('res.partner').browse(cr, uid, part)
if partner.purchase_warn != 'no-message': if partner.purchase_warn != 'no-message':
if partner.purchase_warn == 'block': if partner.purchase_warn == 'block':
raise osv.except_osv(_('Alert for %s !') % (partner.name), partner.purchase_warn_msg) raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.purchase_warn_msg)
title = _("Warning for %s") % partner.name title = _("Warning for %s") % partner.name
message = partner.purchase_warn_msg message = partner.purchase_warn_msg
warning = { warning = {
@ -124,7 +124,7 @@ class account_invoice(osv.osv):
partner = self.pool.get('res.partner').browse(cr, uid, partner_id) partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
if partner.invoice_warn != 'no-message': if partner.invoice_warn != 'no-message':
if partner.invoice_warn == 'block': if partner.invoice_warn == 'block':
raise osv.except_osv(_('Alert for %s !') % (partner.name), partner.invoice_warn_msg) raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.invoice_warn_msg)
title = _("Warning for %s") % partner.name title = _("Warning for %s") % partner.name
message = partner.invoice_warn_msg message = partner.invoice_warn_msg
@ -155,7 +155,7 @@ class stock_picking(osv.osv):
message = False message = False
if partner.picking_warn != 'no-message': if partner.picking_warn != 'no-message':
if partner.picking_warn == 'block': if partner.picking_warn == 'block':
raise osv.except_osv(_('Alert for %s !') % (partner.name), partner.picking_warn_msg) raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.picking_warn_msg)
title = _("Warning for %s") % partner.name title = _("Warning for %s") % partner.name
message = partner.picking_warn_msg message = partner.picking_warn_msg
warning = { warning = {
@ -184,7 +184,7 @@ class stock_picking_in(osv.osv):
message = False message = False
if partner.picking_warn != 'no-message': if partner.picking_warn != 'no-message':
if partner.picking_warn == 'block': if partner.picking_warn == 'block':
raise osv.except_osv(_('Alert for %s !') % (partner.name), partner.picking_warn_msg) raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.picking_warn_msg)
title = _("Warning for %s") % partner.name title = _("Warning for %s") % partner.name
message = partner.picking_warn_msg message = partner.picking_warn_msg
warning = { warning = {
@ -210,7 +210,7 @@ class stock_picking_out(osv.osv):
message = False message = False
if partner.picking_warn != 'no-message': if partner.picking_warn != 'no-message':
if partner.picking_warn == 'block': if partner.picking_warn == 'block':
raise osv.except_osv(_('Alert for %s !') % (partner.name), partner.picking_warn_msg) raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.picking_warn_msg)
title = _("Warning for %s") % partner.name title = _("Warning for %s") % partner.name
message = partner.picking_warn_msg message = partner.picking_warn_msg
warning = { warning = {
@ -257,7 +257,7 @@ class sale_order_line(osv.osv):
if product_info.sale_line_warn != 'no-message': if product_info.sale_line_warn != 'no-message':
if product_info.sale_line_warn == 'block': if product_info.sale_line_warn == 'block':
raise osv.except_osv(_('Alert for %s !') % (product_info.name), product_info.sale_line_warn_msg) raise osv.except_osv(_('Alert for %s!') % (product_info.name), product_info.sale_line_warn_msg)
title = _("Warning for %s") % product_info.name title = _("Warning for %s") % product_info.name
message = product_info.sale_line_warn_msg message = product_info.sale_line_warn_msg
warning['title'] = title warning['title'] = title
@ -289,7 +289,7 @@ class purchase_order_line(osv.osv):
if product_info.purchase_line_warn != 'no-message': if product_info.purchase_line_warn != 'no-message':
if product_info.purchase_line_warn == 'block': if product_info.purchase_line_warn == 'block':
raise osv.except_osv(_('Alert for %s !') % (product_info.name), product_info.purchase_line_warn_msg) raise osv.except_osv(_('Alert for %s!') % (product_info.name), product_info.purchase_line_warn_msg)
title = _("Warning for %s") % product_info.name title = _("Warning for %s") % product_info.name
message = product_info.purchase_line_warn_msg message = product_info.purchase_line_warn_msg
warning['title'] = title warning['title'] = title