Skip to Content
Odoo Меню
  • Увійти
  • Спробуйте це безкоштовно
  • Додатки
    Фінанси
    • Бухоблік
    • Виставлення рахунку
    • Витрати
    • Електронні таблиці (BI)
    • Документи
    • Підпис
    Продажі
    • CRM
    • Продажі
    • POS Магазин
    • POS Ресторан
    • Підписки
    • Оренда
    Веб-сайти
    • Конструктор веб-сайту
    • Електронна комерція
    • Блог
    • Форум
    • Живий чат
    • Електронне навчання
    Ланцюг поставок
    • Склад
    • Виробництво
    • PLM
    • Купівлі
    • Технічне обслуговування
    • Якість
    Кадри
    • Співробітники
    • Рекрутинг
    • Відпустки
    • Оцінювання
    • Рекомендації
    • Автотранспорт
    Маркетинг
    • Маркетинг соцмереж
    • Email-маркетинг
    • SMS-маркетинг
    • Події
    • Автом. маркетингу
    • Опитування
    Послуги
    • Проект
    • Табелі
    • Виїзне обслуговування
    • Служба підтримки
    • Планування
    • Призначення
    Продуктивність
    • Обговорення
    • Схвалення
    • IoT
    • IP-телефонія
    • База знань
    • WhatsApp
    Сторонні модулі Odoo Studio Платформа Odoo Cloud
  • Сфери
    Роздрібна торгівля
    • Книжковий магазин
    • Магазин одягу
    • Магазин меблів
    • Продуктовий магазин
    • Магазин будівельних матеріалів
    • Магазин іграшок
    Food & Hospitality
    • Бар та паб
    • Ресторан
    • Фастфуд
    • Guest House
    • Дистриб'ютор напоїв
    • Hotel
    Нерухомість
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Консалтинг
    • Бухгалтерська компанія
    • Партнер Odoo
    • Агенція маркетингу
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Меблі
    • Їжа
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Системи сонячної енергії
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Інші
    • Nonprofit Organization
    • Екологічна агенція
    • Оренда білбордів
    • Фотографія
    • Лізинг велосипедів
    • Реселлер програмного забезпечення
    Browse all Industries
  • Спільнота
    Навчання
    • Навчальний посібник
    • Документація
    • Сертифікації
    • Тренування
    • Блог
    • Подкаст
    Сприяйте Освіті
    • Програма навчання
    • Бізнес гра Scale Up!
    • Відвідайте Odoo
    Отримайте програмне забезпечення
    • Завантаження
    • Порівняйте версії
    • Релізи
    Співпрацюйте
    • Github
    • Форум
    • Події
    • Переклади
    • Стати партнером
    • Services for Partners
    • Зареєструйте вашу бухгалтерську фірму
    Отримайте послуги
    • Знайдіть партнера
    • Знайдіть бухгалтера
    • Зустріньтеся з консультантом
    • Послуги з впровадження
    • Референси клієнтів
    • Підтримка
    • Оновлення
    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
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Допомога

How do I make products in bom-lines appear as "links"?

Підписатися

Отримуйте сповіщення про активність щодо цієї публікації

Це запитання позначене
1 Відповісти
5841 Переглядів
Аватар
philjun

The standard bill-of-material (bom) view is set up to display a list (lines) of any child boms. These lines also show the product_id of any child boms, but this product_id does not appear as a clickable 'link' taking me to actual products in my warehouse. As far as I can see, the structure is as follows: the bom-lines themselves each refer to a mrp.bom-object with a product_id, which refers to a product.product-object. As such, I should anticipate the product-names in the bom-lines to appear as links, but this is not the case. Can someone help me make the necessary configurations (to the view itself or to the underlying models)?

Cheers. 

2
Аватар
Відмінити
Will Stott

Did you get anywhere with this? I would like to do the same thing. I found the following module: https://www.odoo.com/apps/6.1/web_treeviewlinks/ and the source: http://bazaar.launchpad.net/~credativ/credativ-openerp/addons-6.1/files/head:/web_treeviewlinks/ But it's quite old and I am having trouble understanding how you define the links.

Аватар
Will Stott
Найкраща відповідь

This seems to be broken now. I'm getting a Missing Error: "One of the documents you are trying to access has been deleted, please try again after refreshing." When the product definitely exists. The wrong ID is being given to the script. I don't know why this is. But this still might be a vaguely useful answer for someone trying to do this.

This is a bit of a dirty method. And it definitely isn't the ideal method for doing this. It doesn't retain history, and the links require a double click on the browser back button, because odoo changes the url slightly. But it works and it's a place to start.

 

I found a way to do this using javascript and modifying a view.xml in the form of a module:

<addons folder>/bom_links/__init__.py

 

<addons folder>/bom_links/__openerp__.py

{ 
 'name' : 'Bom Links',
 'version' : '1.0',
 'author' : 'Will Stott',
 'description' : 'MRP override module, adds links to the BOM view',
 'category': 'Manufacturing',
 'website': 'http://www.openerp.com',
 'depends' : ['base', 'mrp', 'web'], # list of dependencies, conditioning startup order
 'data' : [
 'view/views.xml', 
 ], 
 'installable': True,
 'auto-install': False,
} 

<addons folder>/bom_links/view/views.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
  <data>

    <template id="assets_backend" name="bom_assets" inherit_id="web.assets_backend">
      <xpath expr="." position="inside">
        <script type="text/javascript" src="/bom_links/static/src/override.js"/>
      </xpath>
    </template>

    <record id="mrp_bom_form_view" model="ir.ui.view">
      <field name="name">mrp.bom.form</field>
      <field name="model">mrp.bom</field>
      <field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
      <field name="arch" type="xml">
        <xpath expr="/form/notebook/page[@string='Components']/field/tree/field[@name='product_id']" position="replace"> 
          <field name="product_id" widget="link" on_change="onchange_product_id(product_id, product_qty)"/>
        </xpath>
      </field>
    </record>
  </data>
</openerp>

<addons folder>/bom_links/static/src/override.js

openerp.bom_links = function(instance) {
    instance.web.list.columns.add("field.link","instance.web.list.FieldTextLink");

        _format: function (row_data, options) {
           return _.template('<a class="oe_form_uri" href="<%-src%>"><%-text%></a>', {
                src: instance.session.url('/web',
                    {id: row_data[this.id].value[0], view_type:'form', model: 'product.template'}
                    ).replace('?', instance.session.debug ? '?debug=#' : '?#'),

                 text: row_data[this.id].value[1],

           });
        }
    });
}

I hope this helps some people.

 

3
Аватар
Відмінити
Will Stott

I have no idea how to paste code. So I just used quotes.

philjun
Автор

Thank you for your reply, Will. This might be the way to go, but I have the feeling that there must be an easier and 'cleaner' solution. I am thinking that the fields which is defined as object-relations (one2many, many2one etc.) already appear as clickable links in the different views (e.g. the field 'product_id' in the 'mrp.bom' object, which relates to the corresponding product). Maybe it is just a case of editing the html of the corresponding view, though I must admit that I have not had much succes in this regard. Please let me know, if you find an elegant solution.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Реєстрація
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
Open Source
  • Завантаження
  • Github
  • Runbot
  • Переклади
Послуги
  • Хостинг Odoo.sh
  • Підтримка
  • Оновлення
  • Кастомні доробки
  • Навчання
  • Знайдіть бухгалтера
  • Знайдіть партнера
  • Стати партнером
Про нас
  • Наша компанія
  • Торгові активи
  • Зв'яжіться з нами
  • Вакансії
  • Події
  • Подкаст
  • Блог
  • Клієнти
  • Юридичні документи • Конфіденційність
  • Безпека
الْعَرَبيّة 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, електронна комерція, бухгалтерський облік, склад, точка продажу, управління проектами тощо.

Унікальна пропозиція 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