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
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Producție
    • Textile
    • Metal
    • Furnitures
    • Food
    • 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
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    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

Unable to remove fields created by Studio

Abonare

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

Această întrebare a fost marcată
fieldsStudiov15
1 Răspunde
6590 Vizualizări
Imagine profil
Dieter

Though I have no knowledge of coding what so ever, the Studio app works great.

I've created several fields (float fields, integer fields, ...) but can't remove them afterwards. All fields have been named x_studio_... They all are base fields.  It seems to be a problem because I named want to create a new field but from a different type (integer to float) while using the name I've used for a previous (= tried to delete) field.

The fields are not invisible on the product form nor on the list "existing fields".

Already checked this out https://www.odoo.com/nl_NL/forum/help-1/how-can-you-delete-existing-fields-inventory-studio-v15-207713


0
Imagine profil
Abandonează
Dieter
Autor

Cybrosys, thank you very much for the detailed explination. Some research on Google I dead previously also mentioned this but I was unsure if changing them from Base Fields to Custom Field wouldn't mess up the DB.

Must be doing something wrong: ValueError: <class 'psycopg2.errors.UndefinedColumn'>: "column "x_studio_float_field_1hwuy" does not exist

Dieter
Autor

My bad, rookie mistake, I did not understand that "Field name" and "ID" were not the same.

To find the ID's, I exported the fields along with their ID. Is there a more efficient way?

Why do some Custom Fields suddenly become Base Fields?

Cybrosys Techno Solutions Pvt.Ltd

The id will be available in the URL when you open the form view of the field(The one you have shared in the image). If you need to remove the fields by name, just change the domain. The id will be unique in the table. If you use the name of a field, there is a possibility of having more fields with the same name(in different models). But, in your case it is not an issue(Please use this method for only removing the fields added using Studio.). For example,

query = "UPDATE ir_model_fields set state = 'manual' WHERE name = 'x_studio_float_field_1hwuy';"

env.cr.execute(query)
base_fields = model.sudo().search([('name', '=', 'x_studio_float_field_1hwuy')])

base_fields.sudo().unlink()

Regarding the state of the fields: the model 'product.product'(model for product variants) inherits model 'product.template'(model for product). As mentioned earlier, the Odoo Studio created that base field. The one you have created will be there as a custom field(in 'product.template').

Cybrosys Techno Solutions Pvt.Ltd

You can also refer the following app
https://apps.odoo.com/apps/modules/15.0/remove_studio_field/

Imagine profil
Cybrosys Techno Solutions Pvt.Ltd
Cel mai bun răspuns

Hi,

You cannot delete those fields since they are Base Fields. If you need to remove any fields, the first step is to remove the field from the view using studio(you have added it from studio) and then delete the field. But, in this case, you have to change the state of the fields from 'base' to 'manual' before deleting. i.e, you have to convert the Base Field to a Custom Field. You can do this by running a query from a scheduled action. For example if the ids of the fields to remove are 28341 and 28342 we can use the code below:

query = "UPDATE ir_model_fields set state = 'manual' WHERE id in (28341, 28342);"
env.cr.execute(query)
base_fields = model.sudo().search([('id', 'in', (28341, 28342))])
base_fields.sudo().unlink()

Here the first 2 lines are used to run the query to change the state of the fields. The next 2 lines are used to remove the fields.
Add this code in a scheduled action, where the model should be selected as Fields(ir.model.fields) and run it.

An additional case: the field that you have added here looks like it was added from the Product Template form view(that field is added in the Product Variant as a related field by Studio). So, you have to do an additional step. i.e, remove the field x_studio_float_field_1HwUy from the product.template model first. Then you can remove it from the product.product. For both steps, you can use the scheduled action with the code given above. You just have to provide the field ids.

Regards

1
Imagine profil
Abandonează
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
Migrating Odoo Studio fields to a custom module Rezolvat
fields Studio
Imagine profil
Imagine profil
1
sept. 25
968
Adding static text into form view Rezolvat
Studio v15
Imagine profil
Imagine profil
1
mar. 24
3845
Studio: Add related field that does not update after initial record creation Rezolvat
fields Studio
Imagine profil
Imagine profil
2
oct. 23
4791
Extending after Studio
Studio v15
Imagine profil
Imagine profil
Imagine profil
2
sept. 22
2812
Time field
fields v15
Imagine profil
Imagine profil
2
iul. 22
5339
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