Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Error while validating constraint 'purchase.order.line' object has no attribute 'purchase_id'

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
procurementreordering
3 Antwoorden
8010 Weergaven
Avatar
mong ramos jr.

I got this error when i click on "Run Procurement"  button in the module "Inventory" or when I click 'Confirm Sale' in module 'Sale'.

Odoo Warning - Validation Error

Error while validating constraint

'purchase.order.line' object has no attribute 'purchase_id'   

Note that the route of  the product listed in the sales order has been set to 'Buy' and 'Make to Order'.  Also I  created a reordering rule for this product. I I wanted is to trigger a purchase order whenever the stock  reaches the minimum level.  I am using odoo version 9.0c-20170906

0
Avatar
Annuleer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Beste antwoord

Hi,

You can check whether you are getting this issue in odoo runbot or not. You can access it from the following link :  http://runbot.odoo.com/runbot

Choose V9 and log in using the credentials email: admin and password: admin

If you are not able to reproduce the issue in the runbot please update your version to the latest of odoo v9.


Most probably you will not get such an error in runbot, if you found means you can report it at : https://github.com/odoo/odoo/issues

 Thanks

1
Avatar
Annuleer
Avatar
mong ramos jr.
Auteur Beste antwoord

Samo Arko, reordering rule is from the feature of inventory module. Anyway, i traced the code that triggers creation of purchase order, the error raised at line 983 in purchase.py of purchase module. Ill try in runboot if i could recreate the error.

#981            if not po_line:
#982                vals = procurement._prepare_purchase_order_line(po, supplier)
#983                self.env['purchase.order.line'].create(vals)
#984        return res
0
Avatar
Annuleer
Samo Arko

Then you probably try to create it with wrong data.

Samo Arko

To see what you're passing you can create a custom module where you inherit the model and override the method (copy/paste) and add raise ValidationError('values {}'.format(vals)) before the code on line 983 and you'll with what data you try to create the record.

mong ramos jr.
Auteur

Thanks for the input. I already traced the culprit. It came from the custom module named operating_unit. They put a constraint in purchase _id in the inherited model of procurement.order.

Avatar
Samo Arko
Beste antwoord

Your reordering rule, is it a custom module? If it is you need to add the module sale to the dependencies of your custom module.

If you have an error in your custom code it can prevent to load the module whole and this can cause the problem.

This two things are normally what causes my modules to raise the validation constrain error.   

0
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
How does Odoo determine the reorder quantity based on a rule and multiple orders of procurement (OP)?
procurement reordering
Avatar
0
nov. 15
6902
Reorder Point Purchase Algorithm Module
procurement reordering
Avatar
Avatar
1
aug. 15
5550
PR to RFQ
procurement
Avatar
Avatar
1
mrt. 24
2828
Automated action to delete a record? (odoo.sh v13) Opgelost
reordering
Avatar
Avatar
1
jun. 20
6531
How should I handle procurements suggested by Odoo?
procurement
Avatar
0
nov. 15
4396
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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