mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[FIX] Typo regarding MP comments
This commit is contained in:
@@ -51,9 +51,9 @@ Summary of constraints are:
|
||||
|
||||
* Remove the possibility to modify or delete a move line related to an
|
||||
invoice or a bank statement, no matter what the status of the move
|
||||
(draft, validated or posted). This is usefule in standard context but
|
||||
moreover if you're using : account_default_draft_move. This way you ensure
|
||||
user cannot make mistake even in draft, he must pass through the
|
||||
(draft, validated or posted). This is useful in a standard context but
|
||||
even more if you're using `account_default_draft_move`. This way you ensure
|
||||
that the user cannot make mistakes even in draft state, he must pass through the
|
||||
parent object to make his modification.
|
||||
|
||||
""",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user