Перейти к содержимому
Odoo Меню
  • Войти
  • Попробовать бесплатно
  • Модули
    Финансы
    • Бухгалтерия
    • Выставление счетов
    • Расходы
    • Таблицы
    • Документооборот
    • Подпись
    Продажи
    • CRM
    • Продажи
    • POS Магазин
    • POS Ресторан
    • Подписки
    • Аренда
    Вебсайты
    • Конструктор вебсайтов
    • eCommerce
    • Блог
    • Форум
    • Онлайн-чат
    • Электронное обучение
    Логистика
    • Склад
    • Производство
    • PLM
    • Закупки
    • Обслуживание
    • Качество
    Отдел кадров
    • Сотрудники
    • Подбор персонала
    • Отпуска
    • Оценка персонала
    • Реферальная программа
    • Автопарк
    Маркетинг
    • SMM
    • E-mail рассылки
    • СМС рассылки
    • Мероприятия
    • Автоматизация маркетинга
    • Опросы
    Услуги
    • Проекты
    • Табели
    • Выездной сервис
    • Поддержка
    • Планирование
    • Встречи
    Продуктивность
    • Обсуждения
    • Согласование
    • IoT
    • VoIP-телефония
    • Knowledge
    • WhatsApp
    Сторонние приложения Модуль Студия Odoo Платформа Odoo Cloud
  • Индустрии
    Розничная торговля
    • Книжный магазин
    • Магазин одежды
    • Мебельный магазин
    • Продуктовый магазин
    • Строительный магазин
    • Магазин игрушек
    Гостинично-ресторанный бизнес
    • Бар и паб
    • Ресторан
    • Фастфуд
    • Гостевой дом
    • Дистрибьютор напитков
    • Отель
    Недвижимость
    • Агентство недвижимости
    • Архитектурное бюро
    • Строительство
    • Управление недвижимостью
    • Ландшафтный дизайн
    • Товарищество собственников жилья
    Консалтинг
    • Бухгалтерская фирма
    • Партнер Odoo
    • Маркетинговое агентство
    • Юридическая фирма
    • Подбор персонала
    • Аудиторское бюро
    Производство
    • Текстиль
    • Металл
    • Мебель
    • Продукты питания
    • Пивоварня
    • Корпоративные сувениры
    Здоровье и фитнес
    • Спортивный комплекс
    • Магазин оптики
    • Фитнес-клуб
    • Велнес-центр
    • Аптека
    • Салон красоты
    Услуги
    • Специалист по бытовым услугам
    • Продажа и обслуживание IT-оборудования
    • Солнечные энергосистемы
    • Производство обуви
    • Клининг
    • Системы ОВКВ
    Прочее
    • Некоммерческая организация
    • Консалтинг в сфере устойчивого развития
    • Аренда рекламных щитов
    • Бизнес по фотосъемке
    • Прокат велосипедов
    • Реселлер программного обеспечения
    Все индустрии
  • Community
    Обучение
    • Видео уроки
    • Документация
    • Сертификация
    • Тренинг
    • Блог
    • Подкаст
    Образование и развитие
    • Образовательная программа
    • Деловая игра Scale Up!
    • Экскурсия в офис Odoo
    ПО
    • Скачать
    • Сравнить версии
    • Релизы
    Сотрудничество
    • Github
    • Форум
    • Мероприятия
    • Перевод
    • Стать партнером
    • Услуги для партнеров
    • Зарегистрировать бухгалтерскую фирму
    Услуги
    • Найти партнера
    • Найти бухгалтера
    • Встреча с экспертом
    • Услуги по внедрению
    • Отзывы клиентов
    • Поддержка
    • Обновления
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Заказать демонстрацию
  • Цены
  • Поддержка

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Бухгалтерия
  • Склад
  • PoS
  • Проекты
  • MRP
All apps
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Помощь

Cannot search archived products by barcode

Подписаться

Получайте уведомления о появлении активности в этом посте

Этот вопрос был отмечен
9 Ответы
11067 Представления
Аватар
Glen Lowe

Odoo CE 10

It seems that when you archive a product the barcode and the cost temporarily disappear from the product for some reason (even though they are still stored in database and show up when re-activated).  This makes it impossible to search archived items by barcode.  So lets say you want to add a new item and you get the "Cannot add item: this barcode already exists" message.  This means you cannot search the archived items for the matching  barcode and simply re-activate it.  I currently have to:

1) Search archived products by name or other filter

2) Temporarily un-archive product to "see" the barcode and check if it's my match

3 If it's not a match, repeat this process with all the filtered archived items until I find my barcode match and un-archive it

Is this the normal behavior?  How can I make this easier?  Thank you!

1
Аватар
Отменить
Pawan Kumar Sharma

Hello @Keegan,

I need barcode feature for my system Odoo CE 10. So, Can you help me by providing your barcode code or task perform by you to implement this feature.

Thanks,

Manish Bohra

Hello @Keegan,

I am also need barcode functionality for odoo10 Community Edition. So Can you tell me how to perform this functionality.

Аватар
Parth Choksi (pch)
Лучший ответ

Hi,

This can be done by passing this value in the context of your view: {'active_test': False,}

Like for eg:  

<filter string="Archived" name="inactive" context="{'active_test': False}" domain="[('active','=',False)]"/>


0
Аватар
Отменить
Аватар
Jerome Guerriat
Лучший ответ

Archived records are NEVER included in any standard search..

If you use self.env['sale.order'].search([]), it will retrieve every sale order in your system.. Except the ones that are archived. This is standard.

This mean that, indeed, if you search a product over its barcode, the search function will NOT find your archived product.
However, if a SQL constrains is defined over the field, then it will still be triggered uppon insertion of a new record (meaning you won't be able to add a new product with the same barcode if a unique(barcode) constrains is set in the database)

The only way of including the archived records in a search is to specifically add a filter in the search function. 

You could add the filters ['|', ('active','=',True),  ('active','=',False)] to the search method whenever you need to search for any product (wether they are inactive or not) 

0
Аватар
Отменить
Ray Carnes

This is a great answer for programmatic searching. I think from some of the clues in the post, like "temporarily un-archive product" and "filtered archived items" that the question may be about searching via the UI.

Glen Lowe
Автор

Correct. This is a function I was hoping an end-user can do from the web UI. If not possible by default, I can possibly use the info in the previous answer to make a custom module for this? Users need to be able to find products by barcode whether archived or not.

Jerome Guerriat

you can also do that from the UI.

On the search bar, click on the "+", "filters", "add a custom filter", "active is false", "add a condition", "active is true".

This will create a filter "active is false or active is true".

you can then save the current search.

All the products will now be displayed in the tree view by default.

Glen Lowe
Автор

I know how to display all the items in the list view, but this still does not allow for searching them by barcode, try for yourself.

Jerome Guerriat

I just tested with that specific case and indeed it act kind of weird.

The barcode field is defined on product.product. So if you go in the product variants, you'll be able to search over that field.

However, on the product.template, the field barcode is defined as related to the variant_ids:

barcode = fields.Char('Barcode', oldname='ean13', related='product_variant_ids.barcode')

and indeed when a record with a related field is archived, the relation might be broken until you un-archive the record.

If you want to solve this completely using the GUI, i think there is only a dirty way of doing it :/.

- install Studio

- add a new field on the product.template form view

- go to its properties, then click on "more"

- make it computed, stored, and dependent on "barcode"

- then use this kind of code:

for product in self:

if product.product_variant_ids[0]:

product['x_permanent_barcode'] = product.product_variant_ids[0].barcode

where x_permanent_barcode is the name of the field you are defining.

By doing so, you will be able to search over the value of x_permanent_barcode, this time, even archiving the record will NOT remove that value.

However, as i said, you'll still have to use a custom filter (programmaticaly or from the GUI) to be able to search for archived records.

We never use studio, so i would of course recommand creating a custom module that fits your needs, for example by directly redifining the barcode field on product.product (remove the related=.. and make it computed), but if you specifically need to use only the GUI, this would work.

Не оставайтесь в стороне – присоединяйтесь к обсуждению!

Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!

Регистрация
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • Github
  • Runbot
  • Перевод
Услуги
  • Хостинг Odoo.sh
  • Поддержка
  • Обновление
  • Индивидуальные решения по доработке
  • Образование
  • Найти бухгалтера
  • Найти партнера
  • Стать партнером
О нас
  • Наша компания
  • Активы бренда
  • Cвяжитесь с нами
  • Вакансии
  • Мероприятия
  • Подкаст
  • Блог
  • Клиенты
  • Правовые документы • Конфиденциальность
  • Безопасность
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo – это набор бизнес-модулей с открытым исходным кодом, который закроет все потребности вашей компании: CRM, E-commerce, Бухгалтерия, Склад, POS, управление проектами и др.

Odoo сочетает в себе простоту использования и полную интеграцию всех бизнес-процессов в одной системе.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now