mirror of
https://github.com/NaN-tic/trytond-stock_lot_csv.git
synced 2023-12-14 02:12:56 +01:00
DOC
This commit is contained in:
parent
2d03141d8c
commit
eae51d2fd1
|
@ -2,3 +2,9 @@ Stock Lot CSV Module
|
||||||
####################
|
####################
|
||||||
|
|
||||||
Módulo para la importación de lotes de producto mediante ficheros CSV.
|
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.
|
||||||
|
|
|
@ -26,6 +26,10 @@ msgctxt "field:import.csv.start,separator:"
|
||||||
msgid "CSV Separator"
|
msgid "CSV Separator"
|
||||||
msgstr "Separador CSV"
|
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:"
|
msgctxt "help:import.csv.start,header:"
|
||||||
msgid "Set this check box to true if CSV file has headers."
|
msgid "Set this check box to true if CSV file has headers."
|
||||||
msgstr "Marqueu aquesta casella si l'arxiu CSV té capçaleres."
|
msgstr "Marqueu aquesta casella si l'arxiu CSV té capçaleres."
|
||||||
|
|
|
@ -26,6 +26,10 @@ msgctxt "field:import.csv.start,separator:"
|
||||||
msgid "CSV Separator"
|
msgid "CSV Separator"
|
||||||
msgstr "Separador CSV"
|
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:"
|
msgctxt "help:import.csv.start,header:"
|
||||||
msgid "Set this check box to true if CSV file has headers."
|
msgid "Set this check box to true if CSV file has headers."
|
||||||
msgstr "Marque esta casilla si el archivo CSV tiene cabeceras."
|
msgstr "Marque esta casilla si el archivo CSV tiene cabeceras."
|
||||||
|
|
5
stock.py
5
stock.py
|
@ -18,7 +18,8 @@ logger = getLogger(__name__)
|
||||||
class ImportCSVStart(ModelView):
|
class ImportCSVStart(ModelView):
|
||||||
'Import CSV start'
|
'Import CSV start'
|
||||||
__name__ = '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([
|
character_encoding = fields.Selection([
|
||||||
('utf-8', 'UTF-8'),
|
('utf-8', 'UTF-8'),
|
||||||
('latin-1', 'Latin-1'),
|
('latin-1', 'Latin-1'),
|
||||||
|
@ -88,7 +89,7 @@ class ImportCSV(Wizard):
|
||||||
|
|
||||||
lot = Lot.__table__()
|
lot = Lot.__table__()
|
||||||
product = Product.__table__()
|
product = Product.__table__()
|
||||||
cursor.execute(*lot
|
cursor.execute(*lotr
|
||||||
.join(product, 'LEFT', condition=(lot.product == product.id))
|
.join(product, 'LEFT', condition=(lot.product == product.id))
|
||||||
.select(
|
.select(
|
||||||
product.code.as_('code'),
|
product.code.as_('code'),
|
||||||
|
|
Loading…
Reference in a new issue