diff --git a/doc/es/index.rst b/doc/es/index.rst index bb48061..41af7e9 100644 --- a/doc/es/index.rst +++ b/doc/es/index.rst @@ -2,3 +2,9 @@ Stock Lot CSV Module #################### Módulo para la importación de lotes de producto mediante ficheros CSV. + +El fichero CSV contendrá esta estructura: + +"Código producto","Número de lote" + +Si el lote ya existe en el producto, este no será creado y se omite. diff --git a/locale/ca_ES.po b/locale/ca_ES.po index 0093966..692f46d 100644 --- a/locale/ca_ES.po +++ b/locale/ca_ES.po @@ -26,6 +26,10 @@ msgctxt "field:import.csv.start,separator:" msgid "CSV Separator" msgstr "Separador CSV" +msgctxt "help:import.csv.start,archive:" +msgid "First column: product code. Second column: number lot" +msgstr "Primera columna: codi producte. Segona columna: número lot" + msgctxt "help:import.csv.start,header:" msgid "Set this check box to true if CSV file has headers." msgstr "Marqueu aquesta casella si l'arxiu CSV té capçaleres." diff --git a/locale/es_ES.po b/locale/es_ES.po index bb2e2ea..9439fed 100644 --- a/locale/es_ES.po +++ b/locale/es_ES.po @@ -26,6 +26,10 @@ msgctxt "field:import.csv.start,separator:" msgid "CSV Separator" msgstr "Separador CSV" +msgctxt "help:import.csv.start,archive:" +msgid "First column: product code. Second column: number lot" +msgstr "Primera columna: código producto. Segunda columna: número lote" + msgctxt "help:import.csv.start,header:" msgid "Set this check box to true if CSV file has headers." msgstr "Marque esta casilla si el archivo CSV tiene cabeceras." diff --git a/stock.py b/stock.py index 0598b03..79cd6db 100644 --- a/stock.py +++ b/stock.py @@ -18,7 +18,8 @@ logger = getLogger(__name__) class ImportCSVStart(ModelView): 'Import CSV start' __name__ = 'import.csv.start' - archive = fields.Binary('Archive', required=True) + archive = fields.Binary('Archive', required=True, + help='First column: product code. Second column: number lot') character_encoding = fields.Selection([ ('utf-8', 'UTF-8'), ('latin-1', 'Latin-1'), @@ -88,7 +89,7 @@ class ImportCSV(Wizard): lot = Lot.__table__() product = Product.__table__() - cursor.execute(*lot + cursor.execute(*lotr .join(product, 'LEFT', condition=(lot.product == product.id)) .select( product.code.as_('code'),