Search 1.9 billion lines of Odoo code on GitHub

web_domain_field

Author: ACSONE SA/NV,Odoo Community Association (OCA)
License: AGPL-3
Branch: 15.0
Repository: ACCOMODATA-BVBA/web
Dependencies: web
Languages: HTML (383, 58.7%), JavaScript (169, 25.9%), Python (16, 2.5%), and reStructuredText (85, 13.0%)
Other branches: 10.0, 13.0, 13.0-Cleanup, and 15.0-PR2176
Other repositories: 001101/web-1, 2FM/web, 718981206/web, 965714601/web-1, A-you/web, AITIC/web, AMhadhbi/web, ARCSKS85/web, Abdulrahman3282/web, AdriaGForgeFlow/web, AlexandreDias23/web, Alfa-90/web, AnilKesariya/web, AntoniRomera/web, Ark74/web, ArkanSystem/web, As400it/web, AsEAsEAsEROMaSe/web, AyoubZahid/web, BADEP/web, BS-creator/web, BT-aestebanez/web, BT-fgarbely/web, BT-nstuder/web, BT-tbaechle/web, Banetese/web, BenjaHe/web, Bochelly/web, Bubbles-IT/web, CB-Gran-Canaria/web, CFarhad/web-1, Callino/web, ChanFeei/web, Change2improve/web, ChenBing19980410/web-1, Chure43/web, ClancyQiao/web, Colorlessgold/web, ComitorDevTeam/web, CompassionCH/web, CrazyGuo/web, Cy-Ghost/web, DMGSys/web, Daemo00/web, Dan-Stephen/web, DarioLodeiros/web, DarkIsComing/web, Darknroses/web, Decikingship/web, Dhirendrasinh-SerpentCS/web, Digital5-Odoo/web, DjamelEd/web, Dobtor-OCA/web, Domatix/web, DreamSpacexx/web, DudhatShivam/web, ELMARDI0107/web, ERPLibre/web, Ecnart/web, EdyKend/web, EgyCrash/web, ElgatodeSchrodinger/web, Ellafimouheb/web, EssentNovaTeam/web, Feinhe/web, ForgeFlow/web, GSLabIt/web, GabbasovDinar/web, Gabinete-Digital/web, Gio666/web, GlodoUK/oca-web, Glue-Software-Engineering-AG/web, Gofekra/web, Gonscar88/web, GrupoAlvamex/web, GuavanaUX/web, Guobower/OCA-web, HelloXMFJ/web, HirenDangar/web, HomerDeoDatu/web, Ingeos/web, IronStraightManUser/web, JBF91/web, Jarsa-dev/web, Jarsa/web, JayVora-SerpentCS/web, JazziMc/web, JoanMarin/web, JohnLYH/web, JohnmarkEnriquez/web, Jonathan-pr/web, JonathanOsAlc/web, KENLYLST/web, KKamaa/web, KareemAbuzaid/web, Kayuulab/web, Kiplangatdan/web, KonaERP/web, LasLabs/web, Leuan12/web, LevelPrime/web, Linekio/web, Lpunk/web, MMorlock/web, MacqGit/web, MadsackMediaStore/web, Mahmoud-Alaa-Eldeen/web, Martronic-SA/web, MathBenTech/web, MaxyMoos/web, MediaJockey/web, MeetKD/web, Mefistous/web, Meyjan/web, MicheleZak/web, MihranThalhath/web, Mixedmick/web, MjAbuz/web, Morsiesml/web, Muhamed-Git/web, Murtaza-Mithaiwala/web, NL66278/web, NeatNerdPrime/web, Netsoro/web, NextERP-Romania/web, Nicodebug/odooWeb, Nikul-Chaudhary/web, Nowheresly/web, Numigi/odoo-web, OCA-MUK/web, OCA/web, Odoo-Italia-Associazione/web, Ommo73/web, OpenCode/web, PCatinean/web, Palpid/web, Paul98isep/web, PettyBell/web-1, Phaunswater/web, PlanetaTIC/web, PrenorSistemas/web, QubiQ/web, RLeeOSI/web, SalahAdDin/web, SanteLibre/web, Saul-Qiang2/web, ScottAI/web, SequarSrl/web, SerpentConsultingServices/web, SeuMarco/web, Siddhant-Pageni/web, SimoRubi/web, Sirius7/web, SirumTME/web, SodexisTeam/web, SolutionSeekers/web, Sote-LS/web, SportPursuit/web, Sroeurnsuon/web, StefanRijnhart/web, Studio73/web, Syci-Consulting/web, TDu/web, TRESCLOUD/web, Tardo/web, TechonomicsInc/web, Tecnativa/web, ThanhMany/web, ThijsvOers/web, VCLS-org/web, VanMoof/web, Vauxoo/web, VisiionSolucionesTecnologicas/web, VitalPet/web, WEBDEV-PROTEC/web, WilldooIT/web, YarnSeemannsgarn/web, YevhenPechurin/web, YogeshMahera-SerpentCS/web, Zoubid/web, a4435351/web, aaltinisik/web, abgfbr/web, acm1pt-colorado/web, acsone/web, acysos/web, adhoc-dev/web, adriansteel/web, agemticcl/web, agranadosb/web, agrista/odoo-web, ahmadheriyanto/web, ahmedgenina/web, aitorbouzas/web, ajas91/web, ajinvn2019/web, akhdaniel/web, akloptim/web, akretion/web, alan80080/web, alexbclay/web, algiopensource/web, alinolandry/web, ammarofficewla/web, anandkansagra/web, anderson2304/web, androettop/web, anhnangcuaanh/web, anhvu-sg/web, aniket852016/web, anishagg17/web, ansinaesmejor/web, antilhue/web, antonioburic/web, antonyrajserpentcs/web, arielwunderlich/web, arkyalpyae/web, ashmita34/web, asitemap/web, asphaltzipper/web, athirapnair/web, atonaltzin/web, aurestic/web, avoinsystems/web, ayouweixiansheng/web, barkhass89/web, baruklucifer/web, bishalgit/web, bizzappdev/web, blackbelts01/web, blaggacao/web, blooparksystems/web, bmorelax/web, bmya/web, boky1993/web, bolderdene123/web, borni-dhifi/web, boskowski/web, boutitinizar/web, brain-tec/web, brainbeanapps/web, brian10048/web, britoederr/web, bud-e/web, buidinhsy/web, buiminhthanh3a/web, buoncuaanh/web, burakberkanbostanci/web, buzzy3/web, cameroun/web, camptocamp/web, carlosmiras/web, cdasadiya74/web, changshuai1/web, chenjingxiong/web, chermed/web, chianggq/web, chintan-ambaliya/web, cogaihien/web, conandark/web, congdpt/web, coopiteasy/web, cormaza/web, cvinh/web, cxinde/web, damcar/web, dani-xtendoo/web, daniboy2215/web, danztensai/web, daoviet/web, daramousk/web, darshan-odoo/web, davidkhang6/web, delgerS/web, denislour/web, denvian/web, dev00007/web, devang-dreambits/web, diegobgl/web, dingguijin/web, dinhvannam78/web, dinhvanvuong/web, dkruegerkj/web, dlorenzop87/web, dndoanh/web, dong-z/web, dossarockia/web, druidoo-dev/web, duongngochien/web, duyisu/web, dvalladares66/web, dynapps/web, eLBati/web, earthat/web, ecosoft-odoo/web, edlwise/web, eezee-it/web, ehsu0407/web, elteatroescultura/web, emagdalenaC2i/web, eng-eslam-a-y/web, enmasys/web, epierre3/web, ernestotejeda/web, eslAmer/web, espo-tony/web, essamcis/web, evansadji/web, evertonteotonio/web, exosoftware/oca-web, factorlibre/web, falinwasales/web, fallewi/web, fanha99/web, farah-cherif/web, farinoire/web, firefly1994/web, fjouatte/web, focusate/web-oca, foramaktiv/web, gab-net/web, gajendra117/web-2, gastonfeng/web, gbaumgartner-callino/web, gbertolani/web, gdgellatly/web, gfcapalbo/web, gimebreak/web, githubtaotao/web, grizzlysmit/web, gtorresemmanuel/web, guewen/web, gurneyalex/web, gustitammam/web, harinathsrinivasan/web, haroldtamo/web, hassanfadl/web, hbrunn/web, hefeilaowang/web, hinfo506/web, hiren-serpentcs/web, hoangthithao/web, hoathom/web, houzefa-abba/web, hpatelserpentcs/web, huntergps/web, i-vyshnevska/web, iSqXIE/web, ibudgie/web, ideaspositivas-group/web, ifoelarbeis/web, igor-mitin/web, ilecyang/web, inforpordev/web, initOS/web, inspiredbusiness/web, insscn/web, intissarB/web, intoqh/web, isabellerichard/web, isoscl/web, it-projects-llc/web, itspeepo/web, jacky82669513/web, jans23/web, janverb/web, javiergm02/web, jcdrubay/web, jchanme/web, jeroen7s/web, jguerriat/web, jhasolo/web, jhonaelramos/web, jimmyec/web, jladage/web, jobiols/oca-web, johnotoole68/web, josueBulle/web, jpaquete/web, jpcweb/web, jrdabrio/web, julenalgios/web, kamasteve/web, karlis-dreizis/web, karol1985/web, katiakweb/web, kejuswiss/web, keylor2906/web, khanvuthy88/web, khidir15/web-1, kibahop/web, killvis/web, kittiu/web, kitworks-systems/web, kkasing11/web, kmee/web, kos94ok-3D/web, kurniawanlucky/web, kyrylogr/web, lasarux/web, lathiphuong/web, lbaldi/web, leanhtuan1996/web, legalsylvain/web, leizhan17/web, lembregtse/web, leonidasthe300/web, lgharib/web, libregob/web, lideritjnma/web, lilotter45/web, lincoln6delta/web, lisidan/web, liulongyunwanfeng/web, liunux4odoo/web, loftwah/web, lonelyleaves/web, lpajaresv/web, lubw/web, ludlafTest/web, luisrodriguez-e2e/web, lukebranch/web, luthihongvy/web, lvzhenbang/web, lweiming/web, magnuscolors/web, makov44/web, manuelcalerosolis/web, marcelomora/web, marcos-mendez/web, marianoadangelo/web, markrobinson85/web, mashanz/web, mayankksolves/web, mcojocaru/web, mecva/web, mediaengagers/web, mesebin/web, mgosai/web, mhadi12/web, mharenz/web, miguelangelorocha/web, mingkongz/web, mingleecqu/web, minhhq09/web, mivilsoft/web, mochammadrizanaufal/web, modoolar/oca-web, mohamedhagag/web, monksoftware/web, moustafakhairy4/web, mrshelly/web, msaid251/web, mulaudzicalvin/web, multidadosti-erp/web, munawirsyam/web, murtuzasaleh/web, myonnet/oca-web, nawawi/OCA_web, neamatKhan/web, nebras-solutions/web, necrodevz/web, netzweltmex/web, newtratip/web, ngocanh67/web, ngovantu3/web, ngrandjean/web, nguyenkimphung/web, nguyenmanhhuy45/web, nguyenthibichngoc/web, nguyenthimonghien/web, nguyenthitieuvy/web, nikhil150355/web, nikul-serpentcs/web, nilshamerlinck/web, niulinlnc/web, njeudy/web, nmenkov/web, nodoo/web, noorealam96/web, novawish/web, npiganeau/web, nrdroque/web, ntsirintanis/web, ob0420/web, odof/web, odoofans/web, odoogap/web, odoosoft/web, okapandya/web, onurugur/web, onyanga/web, oondeo/web, orlandosorio/web, osamaegypt/web, osanchezm/web, osbzr/gooderp_extra, osiell/web, osoul/web, osvalr/web, ovnicraft/web, p-tombez/web, pamdinhcu/web, paraita/web, pegonzalezspesol/web, petrus-v/web, phamlelan/web, phamngocmaianh/web, phamnguyentram/web, phamvanchau/web, phanthuyhang/web, phanvanduongba/web, phucngta/web, phuctranerp/web, piensom/web, pkagori/web, planesnet/oca_web, pnajman-modoolar/web-1, popcomputadores-desenv/web, popsolutions/web, praxigento/oca-web, presenceverte/web, ps-tubtim/web, pscloud/web, putao615/web, pythoner-3k/web, qgzhiguo/web, qibinlin/web, qtheuret/web, quentinDupont/web, quentingigon/web, raizs/web, ravishekharco/web, rbuisson/web, redblow/web, redcor/web, reloadbrain/web, remi-filament/web, richard-willdooit/web, ristecona/web, ritwik15/web, rkhalil1990/web, robertrottermann/web, robertsoh/web, robertsvx27/web, rohit-envertis/web, royalline1/web, rquintanam/web, rsullivan2704/web, ruben-tonetto/web, rven/web, saas-addons/web, sahil-navadiya/web, samsagaz/web, sanjay-hercules/web, sanube/web, saphiro/web, save85/web, savoirfairelinux/web, sbejaoui/web, sc4you/web, scbrianti/web, scottliu/web, sebalix/web, sergiocorato/web, servetechafrica/web, sewisoft/web, sgajardo/web, sgheller/web, shengyf1/web, shiram/web, shurshilov/web-1, sidpcomissario/web, simahawk/web, simplifysolutions/web, sinandurgut07/web, singhadarsh0403/web, siweilai/web, sixtofarfan/web, sodexis/web, solvosci/web, srikesh/web, ssaid/web, sschmid-test-org/web, steigendit/web, steingabelgaard/web, stevematos/web, stuti135/web, sudhir-erpharbor/web, sudotech-org/web, sunflowerit/web, syci/web, sysproluisrodriguez/web, szellmark20/web, tafaRU/web, takinobori/oca-web, tarteo/web, techonomics69/web, tedi3231/web, tegin/web, thoongnv/web, thuyduongnhi/web, tianshangjun/web, tienhieuD/web, tinvan94/web, tirix/web, tirma-sa/web, tpa-odoo/web, trandainghiaan/web, trannguyengiang/web, tranvanchienlam/web, tranvannam34/web, tranvanthai5/web, trevi-software/web, trionoharjadi/web, truongtuquynh/web, truongvanquyet5/web, tschanzt/web, tsengeagle/web, tvtma/web, umitoprojet/web, unitek-solusi/OCA-web, unpezllamadomiki/web, ursais/web, valtterilattu/web, vanderperre/web, vasiljevicmarko/web, vdedyukhin/web, veetoki/web, venkateshan-s/web, versada/web, vertelab/web, vialaurea/OCA-web, vjd8866/web, vnsofthe/web, vsalazar2017/web, wahello/oca-web, watcharapon24/web, waveFuncjs/web, willmakenoise/web, wodeguaiguai/web, wuhuizhong/web, x0rzkov/odoo-web, xavidj/web, xcgd/web, xiaowenzi/web, xiaoyi-yanqing/web, xtjie/web, y2gsmith/web, yanpierchirino/web, yogesh-serpentcs/web, zarumaru/web, zcyuefan/web, zeroheure/web, zeroincombenze/web, and zlf4535/web

<h1 class="title">Web Domain Field</h1> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/15.0/web_domain_field"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-15-0/web-15-0-web_domain_field"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>When you define a view you can specify on the relational fields a domain attribute. This attribute is evaluated as filter to apply when displaying existing records for selection.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#usage" id="id1">Usage</a></li> <li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id3">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id4">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li> <li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li> </ul> </li> </ul> </div> <a name="usage"></a> <h2><a class="toc-backref" href="#id1">Usage</a></h2> <p>When you define a view you can specify on the relational fields a domain attribute. This attribute is evaluated as filter to apply when displaying existing records for selection.</p> <pre> <code lang="xml">&lt;field name=&quot;product_id&quot; domain=&quot;[('type','=','product')]&quot;/&gt;</code> </pre> <p>The value provided for the domain attribute must be a string representing a valid Odoo domain. This string is evaluated on the client side in a restricted context where we can reference as right operand the values of fields present into the form and a limited set of functions.</p> <p>In this context it's hard to build complex domain and we are facing to some limitations as:</p> <blockquote> <ul class="simple"> <li>The syntax to include in your domain a criteria involving values from a x2many field is complex.</li> <li>The right side of domain in case of x2many can involve huge amount of ids (performance problem).</li> <li>Domains computed by an onchange on an other field are not recomputed when you modify the form and don't modify the field triggering the onchange.</li> <li>It's not possible to extend an existing domain. You must completely redefine the domain in your specialized addon</li> <li>etc...</li> </ul> </blockquote> <p>In order to mitigate these limitations this new addon allows you to use the value of a field as domain of an other field in the xml definition of your view.</p> <pre> <code lang="xml">&lt;field name=&quot;product_id_domain&quot; invisible=&quot;1&quot;/&gt; &lt;field name=&quot;product_id&quot; domain=&quot;product_id_domain&quot;/&gt;</code> </pre> <p>The field used as domain must provide the domain as a JSON encoded string.</p> <pre> <code lang="python">product_id_domain = fields.Char( compute=&quot;_compute_product_id_domain&quot;, readonly=True, store=False, ) &#64;api.depends('name') def _compute_product_id_domain(self): for rec in self: rec.product_id_domain = json.dumps( [('type', '=', 'product'), ('name', 'like', rec.name)] )</code> </pre> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id2">Bug Tracker</a></h2> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed <a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_domain_field%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> <a name="credits"></a> <h2><a class="toc-backref" href="#id3">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id4">Authors</a></h3> <ul class="simple"> <li>ACSONE SA/NV</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id5">Contributors</a></h3> <ul class="simple"> <li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;</li> <li>Denis Roussel &lt;<a class="reference external" href="mailto:denis.roussel&#64;acsone.eu">denis.roussel&#64;acsone.eu</a>&gt;</li> <li>Raf Ven &lt;<a class="reference external" href="mailto:raf.ven&#64;dynapps.be">raf.ven&#64;dynapps.be</a>&gt;</li> </ul> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id6">Maintainers</a></h3> <p>This module is maintained by the OCA.</p> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <p>OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/15.0/web_domain_field">OCA/web</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>