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

How to set the opt_out checkbox to a default value?

Abonare

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

Această întrebare a fost marcată
defaultvaluecheckboxopt_outemail_template
5 Răspunsuri
11746 Vizualizări
Imagine profil
Gérald Janniaux

I would like when opening the partner view to have the opt_out checkbox always checked. How can I do that?

0
Imagine profil
Abandonează
Imagine profil
Jusab Sida (jsi)
Cel mai bun răspuns

(Credit goes to Med Said BARA)

Hi...

For that you need to change here: For V8

module : email_template

file : res_partner.py 

 _defaults = {
    'opt_out': True,
}

For V9:

module: mail

file: res_partner

opt_out = fields.Boolean(
'Opt-Out', default=True, help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign. "
"Filter 'Available for Mass Mailing' allows users to filter the partners when performing mass mailing.")


Then restart your server, update module(email_temaplte(v8), mail(v9)).

Just refresh your page, click on create of partner form and see the magic in opt_out.

(It will be good if you do that all thing by inheriting respected model) 

0
Imagine profil
Abandonează
Imagine profil
Вихрен Кънев
Cel mai bun răspuns

I've found a way to do it. Here is the description:

Activate the "Technical features" from Settings -> Users -> Users -> USERNAME -> Access Rights (tab in the form) and check the "Technical features" checkbox and refresh with F5.

After this go to Settings -> Technical -> Actions -> User-defined Defaults. Then click on "Create" and fill in the fields as follows:

Name = opt_out (field name)

Model Name - leave it empty, because the next field will auto fill it

Model = res.partner (you can set also crm.lead if you use CRM module)

Condition - leave empty, because you want in any condition to have the opt_out field checked

User - leave empty if you want to activate this action for every user

Textarea (under Model field) = 1.

Finally, save the action and create a new partner. The field opt_out should be checked by default now.

I have used the same procedure to check this field by default for crm.lead and res.partner models. It works fine.

1
Imagine profil
Abandonează
Imagine profil
Med Said BARA
Cel mai bun răspuns

Hi;

Edit the file .../openerp/addons/crm/crm_lead.py around the line 317 add 'opt_out': 1,

Like:

_defaults = {

   'opt_out': 1,    <------------------- add this line

    'active': 1,

    'type': 'lead',

    'user_id': lambda s, cr, uid, c: s._get_default_user(cr, uid, c),

    'email_from': lambda s, cr, uid, c: s._get_default_email(cr, uid, c),

    'stage_id': lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c),

    'section_id': lambda s, cr, uid, c: s._get_default_section_id(cr, uid, c),

    'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.lead', context=c),

    'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],

    'color': 0,

}

_sql_constraints = [

Update the module crm.

Sory, change it here: openerp/addons/email_template/res_partner.py

Change False to True

_defaults = {

    'opt_out': False,

try with:

_defaults = {

    'opt_out':  lambda *a: True,
0
Imagine profil
Abandonează
Gérald Janniaux
Autor

Well, this does not work. I've also changed the 'active' value to 0, restarted the server updating all modules, and nothing changed.

Gérald Janniaux
Autor

Already tried the 'False to True' change in openerp/addons/email_template/res_partner.py. This has no effect....

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
Store checkbox action Rezolvat
store value checkbox
Imagine profil
Imagine profil
1
sept. 21
4088
default value for many2one field
default many2one value
Imagine profil
Imagine profil
1
mar. 15
10337
How to be sure of the default delivery method checked in /shop/payment?
default delivery method checkbox
Imagine profil
Imagine profil
1
ian. 17
4549
How to set a default value in debug mode? Rezolvat
debug default mode value
Imagine profil
Imagine profil
1
ian. 17
7634
Default Terms and condition in different language
language default value different
Imagine profil
Imagine profil
2
mar. 15
7323
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