- Change
__openerp__.py
addon name field - Change
README.rst
file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_valid_barcode(value): | |
if not isinstance(value, str): | |
return False | |
if len(value) not in [8, 12, 13, 14, 17, 18]: | |
return False | |
if len(value) != 18: | |
number_zero_to_add = 18 - len(value) | |
value = '0' * number_zero_to_add + value |
Create a scrapy exporter on the root of your scrapy project, we suppose the name of your project is my_project
, we can name this exporter: my_project_csv_item_exporter.py
from scrapy.conf import settings
from scrapy.contrib.exporter import CsvItemExporter
class MyProjectCsvItemExporter(CsvItemExporter):
def __init__(self, *args, **kwargs):
delimiter = settings.get('CSV_DELIMITER', ',')