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

Extending res.partner - first custom field worked, second raises "ProgrammingError: column ... does not exist" - what did I do wrong?

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
res.partnerodoo10
8 Antwoorden
20029 Weergaven
Avatar
Damon

I created and installed a module, barebones and everything was cool,

managed to add a field (cusvc_phone) to res.partner, verified in Models, but when I add the second field I get the following error

ProgrammingError: column res_partner.cusvc_email does not exist

My .py is as follows

# Merchant Application applicationfrom odoo import models, fields
#Extend res.partner model with customer service phone number
class Merchappl_respartner(models.Model):
        _inherit = 'res.partner'
        cusvc_phone = fields.Char('Customer Service Phone')
        cusvc_email = fields.Char('Customer Service Email')

It shouldn't be this hard to create a module which extends res.partner so I must be doing something wrong. Any help and/or pointers are much appreciated.

1
Avatar
Annuleer
Damon
Auteur

Apologies, but i have physically restarted my server many times to no avail. The only way I could get my changes to show was by creating a new database. It just wouldn't refresh my existing database. This wouldn't be a problem, but I have someone who is making changes to other applications, namely Website. I'll try to create and install a renamed version of my module and see if that takes in the existing database, fingers crossed.

Avatar
Krupesh Laiya
Beste antwoord

Just restart your server and use  while restarting - u MODULE_NAME -d DATABASE_NAME

hope this will solve your problem.

3
Avatar
Annuleer
Damon
Auteur

My installation is using the Yenthe script which autoruns the database upon startup so using:

./odoo-bin -d mydb -u Merchappl --- gives me an error 98 address already in use. even restarting doesn't pick it up Thank you though for your time.

Yenthe Van Ginneken (Mainframe Monkey)

@Damon in that case you should first stop the service (sudo service odoo-server stop) and then run the Odoo in the terminal with ./odoo-bin.py -u Merchappl.

(Nice to see you've used my script)

OdooBot

Awesome, thanks!

On Tue, Dec 6, 2016 at 11:35 AM Yenthe <yenthespam@gmail.com> wrote:

@Damon in that case you should first stop the service (sudo service odoo-server stop) and then run the Odoo in the terminal with ./odoo-bin.py -u Merchappl.

(Nice to see you've used my script)

--
Yenthe


Sent by Odoo S.A. using Odoo.

OdooBot
I'm SolutionArts via PayPal.
Thanks again for the script and service
Damon

On Tue, Dec 6, 2016 at 11:41 AM Damon John Hoxworth <damon@solutionarts.net> wrote:
Awesome, thanks!
On Tue, Dec 6, 2016 at 11:35 AM Yenthe <yenthespam@gmail.com> wrote:

@Damon in that case you should first stop the service (sudo service odoo-server stop) and then run the Odoo in the terminal with ./odoo-bin.py -u Merchappl.

(Nice to see you've used my script)

--
Yenthe


Sent by Odoo S.A. using Odoo.

Damon
Auteur

Yenthe, when I run the (sudo service odoo-server stop) my Odoo installation is still available to me via 8069. When I run (service --status-all) the readout for Odoo shows "[?] odoo-server" indicating that it does not have a status command. It doesn't seem that odoo-server is infact stopping?

Avatar
Rob Baxter
Beste antwoord

I had a similar experience to Damon.  It seems to be a problem with the characters for spacing or line breaks.  I tried manipulating the text in both Bluefish and the gnome Text Editor.  Still got errors.

Finally I opened the .py file in nano at the command prompt.  Some of the line breaks and spacing was shown in a different colour.  After deleting these and replacing it finally worked.

Additional editing in nano seems to work.


1
Avatar
Annuleer
Avatar
Burhan Vakharia
Beste antwoord

Hi Damon,


You need to restart the server and upgrade your module to reflect the new fields that you have created in the model.


Hope this helps,


Thank you

1
Avatar
Annuleer
Damon
Auteur

Thank you, should work for me, but is not.

Avatar
Masood Zarei
Beste antwoord

I had the same problem and doing as follow fix the issue:

  1. Stop your server
  2. Run this command at first:  python3 odoo-bin --update=purchase_request
  3. Reload your localhost in browser
  4. Upgrade your module
  5. Stop server again
  6. Now, using the old command (The command you use always) start server again
  7. Upgrade your module again
  8. Done.
0
Avatar
Annuleer
Avatar
Mohammad Hassanzadeh
Beste antwoord

Hi,

I have this error when i add new field to base table such as res.users or res.partner,

if i run service by ugprade module command it is ok.

is there any way without upgrade module commad?

I want restart service and upgrade my module manualy. but is not possible.

thanks

0
Avatar
Annuleer
Avatar
Art
Beste antwoord

Hi guys! I'm new to Odoo and I just decided to ask a question in this post instead of making the new one, b/c I had the same problem.

I'm using Odoo v10 and I'm trying to customize existing view (base.view_partner_form). Here are my model and view:

class add_supplier1099(models.Model):
    # _name = 'add.supplier1099'     
    _inherit = ['res.partner']     
    _description = "Add Checkbox and TaxID Field if Supplier Requires 1099"    

    supp_test_field = fields.Char(string="test field")


<odoo>     
    <data>
        <record id="add_supplier1099_view_inherit" model="ir.ui.view">
        <field name="name">res.partner.form</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="arch" type="xml">     
            <xpath expr="//field[@name='phone']" position="after">                
                <field name="supp_test_field"/>     
            </xpath>
        </field>         
        </record>    
    </data>
</odoo>

This code works and it adds "supp_test_field" to the form. But if you uncomment # _name = 'add.supplier1099' (I thinks it should add my new field to an existing table of "res.partner" model) it'll through an error:

ValueError: Can't validate view:
Field `supp_test_field` does not exist

I also tried to go with "_name = res.partner" (I thinks it should create a new table with my new field and fields from "res.partner" model), but I was getting the same error. Any ideas why i'm getting this error in the above cases and not getting an error when I comment out "_name" attribute?

0
Avatar
Annuleer
Damon
Auteur

Hi Art. I think, and I might be way off, but I think that having your _name in the model isn't needed as you're inheriting the parent model res.partner So you're not really creating a new class, you're inheriting and modifying res.partner. I think that's the reason for the error.

Art

Damon, you're right, there was no need to have _name in my model. It worked well. And I was wrong: if _name and _inherit are the same (res.partner) it'll add a custom field to the existing model and if not then it'll create a new table with custom field and fields from an existing table.

So what is the difference between having _name = res.partner and not having it? Is it the same thing?

Damon
Auteur

Art, I think having _name = res.partner is just redundant in that case.

Art

This is what odoo docs say:

_inherit:

- If _name is set, names of parent models to inherit from. Can be a str if inheriting from a single parent;

- If _name is unset, name of a single model to extend in-place.

Anyway as soon as it works I'm fine with it.

Avatar
Damon
Auteur Beste antwoord

I created a new database, and was able to proceed, but only so far.

The first 11 fields (41 total in .py) were added to res.partner and the remaining 30 fields were left alone. So tried multiple times, checked syntax etc. I ended up commenting out the first 11 fields that were being successfully added, created a new db, installed module and all uncommented fields (last 30) populated res.partner, as expected and doing nothing with the commented out first 11.

I don't understand what is happening here, maybe a timeout of some sort?

following are fields 11 and 12 for reference: (the breakpoint as near as I can tell)

itr_name = fields.Char('Name on Income Tax Return') 
prod_svcs = fields.Text('Detailed Explanation of Type of Merchandise, Products or Services Sold:')

Thanks for your time and eyes

0
Avatar
Annuleer
Damon
Auteur

Update: This is crazy, but i took my first 11 fields, and moved them to the end of my last 30 fields ran

./odoo-bin -d mydb -i mymodule

and res.partner shows my addl 41 fields in total. I still don't know what the issue was/is.

and res.partner was updated to my initial desire.

Avatar
Sarga
Beste antwoord

Hi,

i too have gone through similar situation .The changes that I make in my py wasn't reflecting.hence I checked if there where many instances running in my backend.There were many idle postgres instances and when I killed them and restarted everything was fine.

0
Avatar
Annuleer
Damon
Auteur

Thank you, but just isn't working for me.

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
Is there a differnce? commercial_company_name vs company_name Opgelost
res.partner odoo10
Avatar
Avatar
2
dec. 16
7275
Mass mailing how to prevent email sending Opgelost
res.partner mass_mailing odoo10
Avatar
1
jun. 18
4101
Odoo10: Cannot add a record to res.partner using a data file Opgelost
res.partner data.xml odoo10
Avatar
1
jan. 18
9265
I want to hide some res.partner address fields on the website from public visitors. I used a CSV file with READ permissions on res.partner to do this but it isn't working Opgelost
res.partner website odoo10
Avatar
Avatar
Avatar
Avatar
7
nov. 16
7492
Create schedule action For sending emails
odoo10
Avatar
Avatar
Avatar
2
jul. 25
6574
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