Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

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

Odoberať

Get notified when there's activity on this post

This question has been flagged
res.partnerodoo10
8 Replies
20028 Zobrazenia
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
Zrušiť
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.

Avatar
Krupesh Laiya
Best Answer

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

hope this will solve your problem.

3
Avatar
Zrušiť
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?

Avatar
Rob Baxter
Best Answer

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
Zrušiť
Avatar
Burhan Vakharia
Best Answer

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
Zrušiť
Damon
Autor

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

Avatar
Masood Zarei
Best Answer

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
Zrušiť
Avatar
Mohammad Hassanzadeh
Best Answer

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
Zrušiť
Avatar
Art
Best Answer

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
Zrušiť
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.

Avatar
Sarga
Best Answer

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
Zrušiť
Damon
Autor

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

Avatar
Damon
Autor Best Answer

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
Zrušiť
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!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Is there a differnce? commercial_company_name vs company_name Solved
res.partner odoo10
Avatar
Avatar
2
dec 16
7275
Mass mailing how to prevent email sending Solved
res.partner mass_mailing odoo10
Avatar
1
jún 18
4101
Odoo10: Cannot add a record to res.partner using a data file Solved
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 Solved
res.partner website odoo10
Avatar
Avatar
Avatar
Avatar
7
nov 16
7492
Create schedule action For sending emails
odoo10
Avatar
Avatar
Avatar
2
júl 25
6574
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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