[FIX] Typo regarding MP comments

This commit is contained in:
Joel Grand-Guillaume
2013-01-21 17:07:58 +01:00
parent 117fa448dd
commit f35e1ba6c7
2 changed files with 13 additions and 11 deletions

View File

@@ -48,7 +48,7 @@ class AccountMoveLine(orm.Model):
if line.invoice:
err_msg = _('Invoice name (id): %s (%s)') % (line.invoice.name, str(line.invoice.id))
raise osv.except_osv(
_('Error!'),
_('Error'),
_('You cannot do this on an entry generated by an invoice. You must '
'change the related invoice directly.\n%s.') % err_msg)
return True
@@ -58,18 +58,19 @@ class AccountMoveLine(orm.Model):
if line.statement_id:
err_msg = _('Bank statement name (id): %s (%s)') % (line.statement_id.name, str(line.statement_id.id))
raise osv.except_osv(
_('Error!'),
_('Error'),
_('You cannot do this on an entry generated by a bank statement. '
'You must change the related bank statement directly.\n%s.') % err_msg)
return True
def unlink(self, cr, uid, ids, context=None, check=True):
""" Add the verification of:
""" Add the following checks:
- Is the move related to an invoice
- Is the move related to a bank statement
In that case, we forbid the move to be deleted even if draft. We should
never delete directly a move line related or generated by another object.
This is mandatory if you use the all move in draft (module: account_default_draft_move)
This is mandatory if you use the module setting all moves in draft
(module: account_default_draft_move)
"""
if not context.get('from_parent_object', False):
self._check_invoice_related_move(cr, uid, ids, context=context)
@@ -77,12 +78,13 @@ class AccountMoveLine(orm.Model):
return super(AccountMoveLine, self).unlink(cr, uid, ids, context=context, check=check)
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
""" Add the verification of:
""" Add the following checks:
- Is the move related to an invoice
- Is the move related to a bank statement
In that case, we forbid the move to be modified even if draft. We should
never update directly a move line related or generated by another object.
This is mandatory if you use the all move in draft (module: account_default_draft_move)
This is mandatory if you use the module setting all moves in draft
(module: account_default_draft_move)
"""
if not context.get('from_parent_object', False):
self._check_invoice_related_move(cr, uid, ids, context=context)
@@ -137,7 +139,7 @@ class AccountInvoice(orm.Model):
def action_cancel(self, cr, uid, ids, context=None):
"""Override the method to add the key 'from_parent_object' in
the context. This is to allow to delete move line related to invoice
through the buton cancel."""
through the cancel button."""
if context is None:
context = {}
context['from_parent_object'] = True
@@ -158,7 +160,7 @@ class AccountBankStatement(orm.Model):
def button_cancel(self, cr, uid, ids, context=None):
"""Override the method to add the key 'from_parent_object' in
the context. This is to allow to delete move line related to bank statement
through the buton cancel."""
through the cancel button."""
if context is None:
context = {}
context['from_parent_object'] = True