Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Creating a custom product.product by demo xml file?

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
salesproductdemodata
11 Odpowiedzi
11265 Widoki
Awatar
Tihomir Stoychev Stoychev

Hello Team im trying to create a product but by xml file, i know its possible but its giving me the next error : 


odoo.tools.convert.ParseError: "null value in column "purchase_line_warn" violates not-null constraint

DETAIL:  Failing row contains (88, Valencia Product, 1, null, null, null, service, f, 1, 1.00, null, null, t, t, 1, 1, 1, t, null, null, null, null, 1, 2019-01-17 10:52:47.369262, 1, 2019-01-17 10:52:47.369262, manual, no-message, null, no, order, 1, 0, none, null, null, null, null, null, null, null, null, null).

My code is the following:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record
model="product.product" id="hotels_be_bago.product1">
<field
name="name">Valencia Product</field>
<field
name="type">service</field>
<field
name="purchase_line_warn">1</field>
<field
name="sale_line_warn">no-message</field>
</record>

</data>
</odoo>
Why is telling me that is null when i have value 1 set on it?

Thanks for the help    
1
Awatar
Odrzuć
Awatar
Rakesh Vadeghar
Najlepsza odpowiedź

I solved this error by putting 'depends': ['sale'], in manifest file

2
Awatar
Odrzuć
Mohamed Bessou

Thanks that works

Awatar
Cybrosys Techno Solutions Pvt.Ltd
Najlepsza odpowiedź

Hi,

The error message says that the field named "purchase_line_warn" is not getting the value and it is a required field, so it is mandatory to supply the value for that field.
Checking your data file, it seems you have given 1 for the field purchase_line_warn . The value that can be accepted by this field are 'no-message' ,  'warning' or 'block'



Sample,

<odoo>
<data noupdate="1">
<record model="product.product" id="hotels_be_bago.product1">
<field name="name">Valencia Product</field>
<field name="type">service</field>
<field name="purchase_line_warn">warning</field>
<field name="sale_line_warn">no-message</field>
</record>

</data>
</odoo>

So update the code accordingly and try. Once everything is okay, give noupdate="1" for the data file.


Thanks

1
Awatar
Odrzuć
Tihomir Stoychev Stoychev
Autor

odoo.tools.convert.ParseError: "null value in column "purchase_line_warn" violates not-null constraint

DETAIL: Failing row contains (96, Valencia Product, 1, null, null, null, service, f, 1, 1.00, null, null, t, t, 1, 1, 1, t, null, null, null, null, 1, 2019-01-17 11:10:42.859666, 1, 2019-01-17 11:10:42.859666, manual, no-message, null, no, order, 1, 0, none, null, null, null, null, null, null, null, null, null).

" while parsing /var/lib/odoo/modules/hotels_be_bago/demo/demoProducto.xml:4, near

<record model="product.product" id="hotels_be_bago.product1">

<field name="name">Valencia Product</field>

<field name="type">service</field>

<field name="purchase_line_warn">warning</field>

<field name="sale_line_warn">no-message</field>

</record>

Cybrosys Techno Solutions Pvt.Ltd

Can you check the same in new db also change the id of the record to 'custom_pro1' and see

Tihomir Stoychev Stoychev
Autor

Keeps saying the same even i changed the db and the id

odoo.tools.convert.ParseError: "null value in column "purchase_line_warn" violates not-null constraint

DETAIL: Failing row contains (102, Valencia Product, 1, null, null, null, service, f, 1, 1.00, null, null, t, t, 1, 1, 1, t, null, null, null, null, 1, 2019-01-17 12:10:23.841209, 1, 2019-01-17 12:10:23.841209, manual, no-message, null, no, order, 1, 0, none, null, null, null, null, null, null, null, null, null).

" while parsing /var/lib/odoo/modules/hotels_be_bago/demo/demoProducto.xml:4, near

<record model="product.product" id="custom_pro1">

<field name="name">Valencia Product</field>

<field name="type">service</field>

<field name="purchase_line_warn">warning</field>

<field name="sale_line_warn">no-message</field>

</record>

Reinhart

Have you managed to solve this?

Awatar
Guillaume Seran
Najlepsza odpowiedź

Hello,

this error message appear if you have already installed your module !

If you uninstalled and installed your module you will not have an error!

1
Awatar
Odrzuć
Awatar
Kevin Cardona
Najlepsza odpowiedź

I solved it adding to the _manifest__.py on the "depends" key the purchase module, seems like odoo creates like an "environment" when updating a module and that environment only has whatever the depends key value in the manifest  indicates, so if you have installed the purchase module and then you reinstall a module that creates a new product and you dont have added in the key depends the purchase module, it will not detect all the fields that purchase have added, in this specific case purchase_line_warn, and since the field has a not null constraint the database will raise an exception.

I dont know why odoo developed like this, but not seems to be good. Hope this helps someone who affronts this problem too.


0
Awatar
Odrzuć
Awatar
Reinhart
Najlepsza odpowiedź

I'm having the same probem, didn't even have the warning config activated, but seems is a base field, but:

<field name="purchase_line_warn">no-message</field>

doesn't work at all.

Also the field is declared with a default 'no-message' value :

    purchase_line_warn = fields.Selection(WARNING_MESSAGE, 'Purchase Order Line', help=WARNING_HELP, required=True, default="no-message")

Shouldn't take the default value if the field is missed?

0
Awatar
Odrzuć
Awatar
Maks
Najlepsza odpowiedź

He is right (guy whit kung-fu panda image. Odoo forum is so pathetic that I cannot comment his post or address him in mine)! I had the same issue. If you want to keep updating your module, you have to add noupdate='1' in data tag, but remember that after this everything in this data tag will not be updated while module update.

0
Awatar
Odrzuć
Awatar
Tihomir Stoychev Stoychev
Autor Najlepsza odpowiedź

It tells me the same...


odoo.tools.convert.ParseError: "null value in column "purchase_line_warn" violates not-null constraint

DETAIL:  Failing row contains (96, Valencia Product, 1, null, null, null, service, f, 1, 1.00, null, null, t, t, 1, 1, 1, t, null, null, null, null, 1, 2019-01-17 11:10:42.859666, 1, 2019-01-17 11:10:42.859666, manual, no-message, null, no, order, 1, 0, none, null, null, null, null, null, null, null, null, null).

" while parsing /var/lib/odoo/modules/hotels_be_bago/demo/demoProducto.xml:4, near

<record model="product.product" id="hotels_be_bago.product1">

<field name="name">Valencia Product</field>

<field name="type">service</field>

<field name="purchase_line_warn">warning</field>

<field name="sale_line_warn">no-message</field>

</record>


0
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Conditionally show or hide product attributes (Odoo Online/Studio)
sales product
Awatar
Awatar
1
paź 25
807
Hide the cost
sales product
Awatar
Awatar
Awatar
2
maj 25
4606
Products in multi company
sales product
Awatar
0
lis 24
1571
how to filter out all products which got no sales with the last 3 months or a specific period?
sales product
Awatar
Awatar
1
sie 24
2420
Difference between Product Type and Product Category Rozwiązane
sales product
Awatar
Awatar
1
sie 24
4605
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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