Skip to content

Commit

Permalink
Merge pull request #157 from agaldona/8.0-account_invoice_line_stock_…
Browse files Browse the repository at this point in the history
…move_info

[IMP] account_invoice_line_stock_move_info: allow deleting canceled invoices
  • Loading branch information
agaldona committed May 31, 2017
2 parents 6643c18 + 2c3bc12 commit c2a5829
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
3 changes: 2 additions & 1 deletion account_invoice_line_stock_move_info/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
##############################################################################
{
'name': 'Account Invoice Line Stock Move Info',
'version': "1.0",
'version': "8.0.1.0.0",
'license': "AGPL-3",
'author': 'OdooMRP team,'
'AvanzOSC,'
'Serv. Tecnol. Avanzados - Pedro M. Baeza',
Expand Down
37 changes: 22 additions & 15 deletions account_invoice_line_stock_move_info/i18n/es.po
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_line_stock_move_info
#
# Translators:
# Oihane Crucelaegui <oihanecruce@gmail.com>, 2015
# * account_invoice_line_stock_move_info
#
msgid ""
msgstr ""
"Project-Id-Version: odoomrp-utils (8.0)\n"
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-08 08:46+0000\n"
"PO-Revision-Date: 2015-09-11 12:39+0000\n"
"Last-Translator: Oihane Crucelaegui <oihanecruce@gmail.com>\n"
"Language-Team: Spanish (http://www.transifex.com/oca/odoomrp-utils-8-0/language/es/)\n"
"POT-Creation-Date: 2017-05-24 09:55+0000\n"
"PO-Revision-Date: 2017-05-24 11:59+0100\n"
"Last-Translator: Ainara Galdona <ainaragaldona@avanzosc.es>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.5.4\n"

#. module: account_invoice_line_stock_move_info
#: code:addons/account_invoice_line_stock_move_info/models/account_invoice.py:17
#: code:addons/account_invoice_line_stock_move_info/models/account_invoice.py:18
#, python-format
msgid "Before deleting invoice should cancel the picking(s): %s"
msgstr "Antes de cancelar la factura debe cancelar los albaranes: %s"
msgid ""
"Before deleting invoices you should cancel them or cancel next picking(s): "
"%s."
msgstr ""
"Antes de eliminar una factura debes cancelar la factura o cancelar lo(s) "
"albaran(es): %s."

#. module: account_invoice_line_stock_move_info
#: model:ir.model,name:account_invoice_line_stock_move_info.model_account_invoice
Expand All @@ -34,6 +36,11 @@ msgstr "Factura"
msgid "Invoice Line"
msgstr "Línea de factura"

#. module: account_invoice_line_stock_move_info
#: field:account.invoice.line,picking_id:0
msgid "Picking"
msgstr "Picking"

#. module: account_invoice_line_stock_move_info
#: field:account.invoice.line,move:0
#: model:ir.model,name:account_invoice_line_stock_move_info.model_stock_move
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ class AccountInvoice(models.Model):

@api.multi
def unlink(self):
if any([x and x != 'cancel' for x in
self.mapped('invoice_line.picking_id.state')]):
if (any([x and x != 'cancel' for x in
self.mapped('invoice_line.picking_id.state')]) and
any([x.state != 'cancel' for x in self])):
raise exceptions.Warning(
_('Before deleting invoice should cancel the picking(s): %s')
_('Before deleting invoices you should cancel them or cancel '
'next picking(s): %s.')
% self.mapped('invoice_line.picking_id.name'))
return super(AccountInvoice, self).unlink()

Expand Down

0 comments on commit c2a5829

Please sign in to comment.