Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Umělá inteligence
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Product not Avaliable in E-Shop

Odebírat

Get notified when there's activity on this post

This question has been flagged
webecommerceodooV8
1 Odpovědět
5106 Zobrazení
Avatar
Luis Miguel Varón E

Hello

I'm developing a module that insert some columns to the product.attribute and product.attribute.value, but when i make a product with 2 variants itś get not available on the e-shop. This doesn happen without my module installed.

My code:

class product_colorisa_attribute(osv.osv):
    _inherit = "product.attribute.value"
    _columns = {
        'code' : fields.char('Codigo', size=3, required=True, help="Campo con capacidad de 3 caracteres, pero segun definicion de la codificacion de los productos ingresar unicamente 2 en caso de catalogar un Color, Sabor."),
        'scode' : fields.char('Sub Codigo', size=2, required=False, help="")
    }

class product_product(osv.osv):
    _inherit = 'product.product'
      
    def get_ref(self, cr, uid, ids,context=None):
        if isinstance(ids, (list, tuple)) and not len(ids):
            return []
        if isinstance(ids, (long, int)):
            ids = [ids]
        reads = self.browse(cr, uid, ids)
        res = []
        for records in reads:
            if records.categ_id.code:
                ref = records.categ_id.code + '' + records.linea_id.code + '' + records.marca_id.code
                for attribute in records.attribute_value_ids:
                    print attribute.code
                    if attribute.code:
                        ref = ref + '' + attribute.code
                if ref:
                    print ref
                    res.append((records['id'], ref))
        return res
        
    
    def _get_ref(self, cr, uid, ids, prop, unknow_none, context=None):
        res = self.get_ref(cr, uid, ids, context=context)
        return dict(res)

 _columns = {
        'ref' : fields.function(_get_ref, type='char', string='Internal Reference', store=True ),

}

Thanks for anything and forgive my english

0
Avatar
Zrušit
Avatar
Anton Chepurov
Nejlepší odpověď

This happens when your product.template has an attribute with a single value, e.g. Color: blue.

Here's what you could do:

diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js
index d700ef2..a1cc3e0 100644
--- a/addons/website_sale/static/src/js/website_sale.js
+++ b/addons/website_sale/static/src/js/website_sale.js
@@ -103,6 +103,7 @@ $('.oe_website_sale').each(function () {
 
     $(oe_website_sale).on('change', 'input.js_variant_change, select.js_variant_change', function (ev) {
         var $ul = $(this).parents('ul.js_add_cart_variants:first');
+        var $section = $(this).parents('#product_detail');
         var $parent = $ul.closest('.js_product');
         var $product_id = $parent.find('input.product_id').first();
         var $price = $parent.find(".oe_price:first .oe_currency_value");
@@ -112,6 +113,9 @@ $('.oe_website_sale').each(function () {
         $parent.find('input.js_variant_change:checked, select.js_variant_change').each(function () {
             values.push(+$(this).val());
         });
+        $section.find('span.js_variant_static').each(function () {
+            values.push(parseInt($(this).attr('value')));
+        });
 
         $parent.find("label").removeClass("text-muted css_not_available");

And override one template in your XML file:

        <template id="product_attributes" inherit_id="website_sale.product_attributes" name="Product attributes">
            <xpath expr="//span[@t-field='variant_id.value_ids[0].name']" position="attributes">
                <attribute name="t-att-value">variant_id.value_ids[0].id</attribute>
                <attribute name="class">js_variant_static</attribute>
            </xpath>
        </template>

 

0
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Avoid negative stock on eCommerce
web html ecommerce odooV8
Avatar
Avatar
2
kvě 21
8219
Odoo 8 web unique field constraint ?
web odooV8
Avatar
0
dub 15
4907
How to add web references in our customers after installed module?
web ecommerce
Avatar
0
bře 15
5026
Duplicate Vyřešeno
ecommerce webshop odooV8
Avatar
Avatar
1
pro 24
19302
How to build a page in odoo with featured products
web tags ecommerce
Avatar
Avatar
1
zář 23
5427
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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