Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

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

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
res.partnerodoo10
8 Răspunsuri
20027 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Damon
Autor

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.

Imagine profil
Krupesh Laiya
Cel mai bun răspuns

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

hope this will solve your problem.

3
Imagine profil
Abandonează
Damon
Autor

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
Autor

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?

Imagine profil
Rob Baxter
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Burhan Vakharia
Cel mai bun răspuns

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
Imagine profil
Abandonează
Damon
Autor

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

Imagine profil
Masood Zarei
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Mohammad Hassanzadeh
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Art
Cel mai bun răspuns

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
Imagine profil
Abandonează
Damon
Autor

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
Autor

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.

Imagine profil
Sarga
Cel mai bun răspuns

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
Imagine profil
Abandonează
Damon
Autor

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

Imagine profil
Damon
Autor Cel mai bun răspuns

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
Imagine profil
Abandonează
Damon
Autor

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.

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

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Is there a differnce? commercial_company_name vs company_name Rezolvat
res.partner odoo10
Imagine profil
Imagine profil
2
dec. 16
7275
Mass mailing how to prevent email sending Rezolvat
res.partner mass_mailing odoo10
Imagine profil
1
iun. 18
4101
Odoo10: Cannot add a record to res.partner using a data file Rezolvat
res.partner data.xml odoo10
Imagine profil
1
ian. 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 Rezolvat
res.partner website odoo10
Imagine profil
Imagine profil
Imagine profil
Imagine profil
7
nov. 16
7492
Create schedule action For sending emails
odoo10
Imagine profil
Imagine profil
Imagine profil
2
iul. 25
6574
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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