Search 1.9 billion lines of Odoo code on GitHub

pos_multi_session

Author: IT-Projects LLC, Ivan Yelizariev
License: Other OSI approved licence
Branch: 12.0-dinar-port-pr1027
Repository: mgielissen/pos-addons
Dependencies: point_of_sale, pos_longpolling, pos_multi_session_sync, and web
Languages: CSS (28, 0.7%), HTML (90, 2.1%), JavaScript (1581, 37.4%), PO File (679, 16.1%), Python (991, 23.5%), XML (352, 8.3%), and reStructuredText (501, 11.9%)
Other branches: 10.0, 10.0-pos_invoice_pay-screens_derive, 10.0-pos_invoice_pay-where-is-change-fix, 10.0-pos_invoice_postponed-main-image, 10.0-pos_multi_session_sync-logs, 11.0, 11.0-pos_invoice_pay-add-lines, 11.0-pos_invoice_pay-fix-css-print, 11.0-pos_invoice_pay-issue1182, 11.0-pos_multi_sesssion-port-sync-offline-fix-from-10, 11.0-pos_nfc, 11.0-pos_qr_scan-ctx-fix, 12.0, 12.0-makepot, 12.0-pos_invoice_pay-fix-css-print, 12.0-pos_invoice_pay-get_sale_details_fix, 12.0-pos_invoice_pay-port-fix-from-10.0, 12.0-pos_mobile-fix-clientlist, 12.0-pos_multi_session-port-fixes-from-10, 12.0_pos_product_category_discount-docs, 13.0-pos_network_printer, 13.0-price-change, 13.0-travis-bump-build-link, 13.0-travis-bump-python, 13.0-travis-notifications, 13.0-travis-porting-to-13, 8.0, 9.0, 9.0-pos_invoice_pay-invoice_lines_in_receipt, and patch-1
Other repositories: 001101/pos-addons, 2FM/pos-addons, ADVALAKI/pos-addons, AEK-BKF/pos-addons, AITIC/pos-addons, Abdullah-Alghoul/pos-addons, AcruxLab/pos-addons, Alikerin/pos-addons, Alitec-sg/pos-addons, AndryEddy/pos-addons, Antiun/yelizariev-pos, Ark74/pos-addons, ArtyomLosev/pos-addons, Banetese/pos-addons, BayarkhuuBataa/pos-addons, BradooTech/pos-addons, BrayhanJC/pos-addons, CarlosZea/pos-addons, ClearCorp/it-projects-pos-addons, Communities-Communications/pos-addons, Confidere/pos-addons, ConsciousGroup/pos-addons, CustomOdoo/pos-addons, CybroOdoo/pos-addons, DITIntl/pos-addons, Denzeland/pos-addons, Dobtor-it-projects-llc/pos-addons, DudhatShivam/pos-addons, ERPLibre/pos-addons, Elbagoury/pos-addons, ElvenStudio/pos-addons, EmilioBravo/pos-addons, Endika/pos-addons, Enghmed/pos-addons, Englishrain/pos-addons, Enigma228322/pos-addons, FabienAmiaud/pos-addons, Fareed443/pos-addons, Fitranugraha/pos-addons, FunHouseIL/pos-addons, GabbasovDinar/pos-addons, Gofekra/pos-addons, GrupoAlvamex/pos-addons, GuavanaUX/pos-addons, Guillon88/pos-addons, Guobower/pos-addons, HaiNguyen007/pos-addons, ICTSTUDIO/pos-addons, ImplantiSolucoes/pos-addons, Jeisonpernia/pos-addons, JorgeJuarezM/pos-addons, Jzano/pos-addons, Khwarizmiat/pos-addons, KolushovAlexandr/pos-addons, KonosCL/pos-addons, LSDevNoumea/pos-addons, MYRCONSULTING/pos-addons, MacManas/pos-addons, Mahmoud-Alaa-Eldeen/pos-addons, MediaJockey/pos-addons, MeetKD/pos-addons, MihranThalhath/pos-addons, MindAndGo/pos-addons, MjAbuz/pos-addons, ModSaeed/pos-addons, Muhammad105/pos-addons, NamaadIran/pos-addons, NeatNerdPrime/pos-addons, NigmatullinAN/pos-addons, Nikhilkrishnan0101/pos-addons, NilmarShereef/pos-addons, ORETEK/pos-addons, OctoComputer/pos-addons, Odoo-10-test/pos-addons, Odoo-Pakistan/pos-addons, OdooMod/pos-addons, Ommo73/pos-addons, PabloValdivia/pos-addons, Perpetualism/pos-addons, Posland/pos-addons, QubiQ/pos-addons, RL-OtherApps/pos-addons, Ramil-Mukhametzyanov/pos-addons, Raniani-lab/pos-addons, RealSolutionsLux/pos-addons, RubenWaterman/pos-addons, Rusllan/pos-addons, SantosJMM/pos-addons, SetRac/pos-addons, SeuMarco/pos-addons, SolutionSeekers/pos-addons, SouyiroZ/pos-addons, Stanadigme/pos-addons, Storegud/pos-addons, TestMergeBot/pos-addons, ThanhICSC/skit_odoo12, TheCloneMaster/pos-addons, TurBoss/pos-addons, Vanneri/pos-addons, VasiliyKorobatov/pos-addons, W360S/pos-addons, W360SCORP/pos-addons, YogeshMahera-SerpentCS/pos-addons, abassvoice/pos-addons, abdiiwan1841/pos-addons, abdo3247/pos-addons, abdounasser202/pos-addons, abdulrhmans/pos-addons, adeel982010/pos-addons, ahmedbahaa61/pos-addons, aipaperclip/pos-addons, ajaxangular/pos-addons, ajinvn2019/pos-addons, akekaphop/pos-addons, akhdaniel/pos-addons, akhif4u/pos-addons, akloptim/pos-addons, akretion/pos-addons, akshaynesm/pos-addons, alangwansui/pos-addons, albertkouemou/pos-addons, alcdigital/pos-addons, alcidesrivera/pos-addons, alhashash/pos-addons, allan225/pos-addons, amarildogolloshi/pos-addons, amendoncabh/pos-addons, amine05/pos-addons, anasallaham/pos-addons, anggadjava/pos-addons, anndream/pos-addons, anoirclere/pos-addons, antherkiv/pos-addons, arasty/pos-addons, ata2001/pos-addons, aymeperdomo/pos-addons, bduong06/pos-addons, benhenicraf/pos-addons, benoitlavorata/pos-addons, berpweb/pos-addons, bingika/pos-addons, bishalgit/pos-addons, bitodoo/pos-addons, bluedaemondev/pos-addons, bmya/pos-addons, bopo/pos-addons, borera/pos-addons, brmad175/pos-addons, c0debrain/pos-addons, carlware/pos-addons, cbaltodano90/pos-addons, cfljdfz/pos-addons, cglill/pos-addons, chafarleston/pos-addons, chenguoliang318/pos-addons, chjbbs/pos-addons, cholitoecuatoriano/pos-addons, ciptasoft/pos-addons, claro5/pos-addons, code-pack/pos-addons, coolzhoe/pos-addons, coopiteasy/pos-addons, cvinh/pos-addons, damendieta/pos-addons, detian08/pos-addons, dev-tanvir/pos-addons, diegobgl/pos-addons, diegogd/pos-addons, domedfd/pos-addons, don-systems/pos-addons, dong-z/pos-addons, dorucioclea/pos-addons, dpalominop/pos-addons, duyhnguyen/pos-addons, dvdhinesh/pos-addons, dynaz/pos-addons, eabellom/pos-addons, eddyrene/pos-addons, edsnet/pos-addons, ehtishamfaisal/pos-addons, ejbdev/pos-addons-fork, ekitsikpui5/pos-addons, elblasy33/pos-addons, elsemieni/pos-addons, em230418/pos-addons, eribowo/pos-addons, eribowo/skit_odoo12, factorlibre/pos-addons, fadeldamen/pos-addons, fanguloa/pos-addons, fauzi-tsani/pos-addons, fawadmazhar786/pos-addons, flybird2016/pos-addons, fnguena/pos-addons, fslibre/pos-addons, fuentes010/pos-addons, gaelTorrecillas/pos-addons, galcorta/pos-addons, gandad/pos-addons, garzadekoster/pos-addons, gastonfeng/pos-addons, gayanW/pos-addons, genuineaffairs/pos-addons, germanponce/pos-addons, giangle9695/pos-addons, gitlabuser/pos-addons, gokhancetiner/pos-addons, grethellgarcia/pos-addons, grottas/pos-addons, guohuadeng/pos-addons, gustavovalverde/pos-addons, gustotc/pos-addons, haroldtamo/pos-addons, harsh3547/pos-addons, haryoran04/pos-addons, haygcao/pos-addons, herry88/pos-addons, hinfo506/pos-addons, hoangpq/pos-addons, holacliente/pos-addons, hrazera/pos-addons, hunghn/pos-addons, huntergps/pos-addons, husseinAliPVG/pos-addons, iceship/pos-addons, id10tttt/pos-addons, iledarn/pos-addons, ilmir-k/pos-addons, ilyasProgrammer/pos-addons, indexa-git/pos-addons, infobit/pos-addons, initOS/pos-addons, innoving/pos-addons, itpp-labs/pos-addons, izzihector/pos-addons, jairuque/pos-addons, jason156/pos-addons, javaaid/pos-addons, javogiraldez/skit_odoo12, jayanowsky/pos-addons, jcsuscriptor/pos-addons, jeanabreu/pos-addons, jeffery9/pos-addons, jeffryjdelarosa/pos-addons, jhoengels/pos-addons, jimmyec/pos-addons, joycehuan/pos-addons, jupiterzhuo/pos-addons, jupiterzhuo/skit_odoo12, justuni/pos-addons, jviloria/pos-addons, kaadevelop/pos-addons, kaadevelopment/pos-addons, kalanso/pos-addons, kamasteve/pos-addons, keadanis/pos-addons, ketu/pos-addons, kit9/pos-addons, kit9/skit_odoo12, kmee/pos-addons, kossovo/pos-addons, krocket/pos-addons, lammh/pos-addons, lawrencekm/pos-addons, leangjia/it-projects-pos-addons, legalsylvain/pos-addons, leonidasthe300/pos-addons, lercloud/pos-addons, lindsaychung/pos-addons, lintoct/pos-addons, litnimax/pos-addons, ljacobo/pos-addons, llc-odoo/pos-addons, luis-rj/pos-addons, lxMBIT/pos-addons, makeplerc/pos-addons, manawi/pos-addons, manolain/pos-addons, manolo03cali/pos-addons, manu686/pos-addons, marcelomora/pos-addons, marcelsavegnago/pos-addons, marionumza/it-projects-llc-pos-addons, marionumza/skit_odoo12, mariovillagra/pos-addons, masterdungeon/pos-addons, mauricioff2015/pos-addons, maurolguin1/pos-addons, mbithub/pos-addons, mdark1001/pos-addons, meswapnilwagh/pos-addons, mhassanqureshi/pos-addons, mohamedhabibchallouf/pos-addons, molandtoxx/pos-addons, mrey37/pos-addons, mrezki/pos-addons, mrizqiariadi/pos-addons, msntop/pos-addons, muk-projects/pos-addons, mustafasahmed/pos-addons, myonnet/pos-addons, nabiforks/pos-addons, nathchan/pos-addons, navarromiguel/pos-addons, ncavalierm/pos-addons, nick2474/pos-addons, niulinlnc/pos-addons, niulinlnc/skit_odoo12, noorealam96/pos-addons, nsxsoft/pos-addons, odoo-modules/pos-addons, odoo-revisar/pos-addons, odoo-test-9/pos-addons, odoo247/pos-addons, odoobgorg/ITP-pos-addons, odoocn/pos-addons, odooerpperu/pos-addons, odoofans/pos-addons, ogyr/pos-addons, ohmmmo/pos-addons, ondrong/pos-addons, one2pret/pos-addons, onorua/pos-addons, open-synergy/pos-addons, ossvn/pos-addons, patrickpeng2091/pos-addons, paulpwo/pos-addons, pe03re/pos-addons, phuctranerp/pos-addons, poehlmann/pos-addons, popcomputadores-desenv/pos-addons, prihadi-r/pos-addons, pushnube/pos-addons, pythoner-3k/pos-addons, quantso/pos-addons, quevedin/pos-addons, rainbow-studio-solution/pos-addons, rashikkathuria/pos-addons, raulovallet/pos-addons, raycarnes/pos-addons, redouanbeg/pos-addons, repodevs/pos-addons, rkhalil1990/pos-addons, robelale/pos-addons, romendil/pos-addons, rossasa/yelizariev-pos-addons, rossasa/yelizariev-website-addons, roussel2nis/pos-addons, royalline1/pos-addons, rudisulistyo/pos-addons, sagar-developer-92/pos-addons, samirGuesmi/pos-addons, samjaninf/pos-addons, samsagaz/pos-addons, sc4you/pos-addons, sgeerish/pos-addons, sheelarajeshkumar/pos-addons, shouyejing/pos-addons, simmatica/pos-addons, sinandurgut07/pos-addons, sinomate/pos-addons, sisboca/pos-addons, sm2x/pos-addons, sm2x/skit_odoo12, softhealer/pos-addons, solbutec/pos-addons, songmonit/pos-addons, sopheak1/pos-addons, sreejithcybrosys/pos-addons, srikesh/skit_odoo12, ssaid/pos-addons, stark182/pos-addons, steingabelgaard/pos-addons, sum1201/pos-addons, sunflowerit/pos-addons, suningwz/pos-addons, tankisstank/pos-addons, tanoggy/pos-addons, tasmail/pos-addons, thaiodoo/pos-addons, thinkopensolutions/itprojectsllc-pos-addons, thomasbshop/pos-addons, timbze/pos-addons, toanthuan/pos-addons, tonitons/pos-addons, toolkt/pos-addons, tree33333/pos-addons, trojikman/pos-addons, tsk/pos-addons, tuanace/pos-addons, tuedang/pos-addons, tvtma/pos-addons, ufaks/pos-addons, umair-gujjar/pos-addons, valenciaricardos/pos-addons, valley51/pos-addons, vanthaiunghoa/pos-addons, vdedyukhin/pos-addons, vfa-huytq/pos-addons, vidtsindia/pos-addons, vinaybhawsar/pos-addons, vishalkpatel86/pos-addons, vkuldeep/pos-addons, vmcloudsolution/pos-addons, vniter/pos-addons, vsantosv/pos-addons, wanfgh/pos-addons, weddingjuma/pos-addons, westlyou/pos-addons, wuilfred/pos-addons, wwdxfa/pos-addons, x3noah/pos-addons, x620/pos-addons, xduran/pos-addons, xizqu/pos-addons, xoe-labs/pos-addons, xpansa/pos-addons, xuanyimin/pos-addons, xxvdragon/pos-addons, yannickbh/pos-addons, yasmanycastillo/pos-addons, yasr3mr96/pos-addons, yasserkaddour/pos-addons, yeeliz/pos-addons, yelizariev/pos-addons, yhetsantos/pos-addons, yoozeer/pos-addons, yuanerp/pos-addons, zamzamintl/pos-addons, zfis/skit_odoo12, zhangire/pos-addons, and zulfikarm27/pos-addons

<a class="reference external image-reference" href="https://itpp.dev"><img alt="Tested and maintained by IT Projects Labs" src="https://itpp.dev/images/infinity-readme.png" /></a> <a class="reference external image-reference" href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg"> </a> <a name="sync-pos-orders"></a> <h2>Sync POS orders</h2> <p>The module provides instant orders synchronization between POSes related to a common <em>multi session</em>.</p> <p>Server side of synchronization is handled by module <code>pos_multi_session_sync</code>. The role of <em>Sync Server</em> may have same odoo server as well as separate odoo server (e.g. server in local network).</p> <p>Instant data exchange are made via built-in longpolling feature extended by <code>pos_longpolling</code> module.</p> <p>When POS becomes offline, i.e. don't have connection to <em>Sync Server</em>, it is only able to create new orders and not allowed to modify exising orders to avoid synchronization problems.</p> <p>Some POSes may be configured to work without synchronization. In such case it will work just like without the module.</p> <p>We recommend using the module together with the <a class="reference external" href="https://www.odoo.com/apps/modules/12.0/pos_access_right/">pos_access_right</a> module.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">To synchronize orders correctly, you need a permanent connection to the server.</p> </div> <a name="modules-compatibility"></a> <h3>Modules compatibility</h3> <p>Some modules may not be compatible. It happens when a module adds additional data to the <code>Order</code> or <code>Orderline</code> JS model. In such cases it is necessary to add <code>apply_ms_data</code> and extend <code>export_as_JSON</code>, <code>init_from_JSON</code> methods in corresponding models.</p> <pre> <code lang="js">apply_ms_data: function(data) { // This methods is added for compatibility with module https://www.odoo.com/apps/modules/12.0/pos_multi_session/ /* It is necessary to check the presence of the super method in order to be able to inherit the apply_ms_data without calling require('pos_multi_session') and without adding pos_multi_session in dependencies in the manifest. At the time of loading, the super method may not exist. So, if the js file is loaded first among all inherited, then there is no super method and it is not called. If the file is not the first, then the super method is already created by other modules, and we call super method. &nbsp; */ &nbsp; if (_super_order.apply_ms_data) { _super_order.apply_ms_data.apply(this, arguments); } this.first_new_variable = data.first_new_variable; this.second_new_variable = data.second_new_variable; // etc ... /* Call renderElement direclty or trigger corresponding event if you need to rerender something after updating */ }, export_as_JSON: function() { // export new data as JSON var data = _super_order.export_as_JSON.apply(this, arguments); data.first_new_variable = this.first_new_variable; data.second_new_variable = this.second_new_variable; return data; }, init_from_JSON: function(json) { // import new data from JSON this.first_new_variable = json.first_new_variable; this.second_new_variable = json.second_new_variable; return _super_order.init_from_JSON.call(this, json); }</code> </pre> <p>The example above synchronizes <code>first_new_variable</code>, <code>second_new_variable</code> and other data of accross all POSes.</p> <p>The code below is a real example from module <a class="reference external" href="https://www.odoo.com/apps/modules/12.0/pos_order_note/">pos_order_note</a>:</p> <pre> <code lang="js">var _super_order = models.Order.prototype; models.Order = models.Order.extend({ apply_ms_data: function(data) { // This methods is added for compatibility with module https://www.odoo.com/apps/modules/12.0/pos_multi_session/ if (_super_order.apply_ms_data) { _super_order.apply_ms_data.apply(this, arguments); } this.note = data.note; this.old_note = data.old_note; this.custom_notes = data.custom_notes; this.old_custom_notes = data.old_custom_notes; // rerender Order Widget after updating data this.pos.gui.screen_instances.products.order_widget.renderElement(true); }, export_as_JSON: function() { var data = _super_order.export_as_JSON.apply(this, arguments); data.note = this.note; data.old_note = this.old_note; data.custom_notes = this.custom_notes; data.old_custom_notes = this.old_custom_notes; return data; }, init_from_JSON: function(json) { this.note = json.note; this.old_note = json.old_note; this.custom_notes = json.custom_notes; this.old_custom_notes = json.old_custom_notes; return _super_order.init_from_JSON.call(this, json); } }); var _super_orderline = models.Orderline.prototype; models.Orderline = models.Orderline.extend({ apply_ms_data: function(data) { // This methods is added for compatibility with module https://www.odoo.com/apps/modules/12.0/pos_multi_session/ if (_super_orderline.apply_ms_data) { _super_orderline.apply_ms_data.apply(this, arguments); } this.custom_notes = data.custom_notes; this.old_custom_notes = data.old_custom_notes; // rerender Orderline Widget after updating data this.trigger('change', this); }, export_as_JSON: function() { var data = _super_orderline.export_as_JSON.apply(this, arguments); data.custom_notes = this.custom_notes; data.old_custom_notes = this.old_custom_notes; return data; }, init_from_JSON: function(json) { this.custom_notes = json.custom_notes; this.old_custom_notes = json.old_custom_notes; return _super_orderline.init_from_JSON.call(this, json); } });</code> </pre> <p>Also it's possible to trigger <code>new_updates_to_send</code> event on data changes to force pos_multi_session module start syncronization process. Example code from <a class="reference external" href="https://www.odoo.com/apps/modules/12.0/pos_product_available/">pos_product_available</a>:</p> <pre> <code lang="js">update_product_qty_from_order_lines: function(order) { var self = this; order.orderlines.each(function(line){ var product = line.get_product(); product.qty_available -= line.get_quantity(); self.refresh_qty_available(product); }); // for pos_multi_session: send updates to other POSes order.trigger('new_updates_to_send'); },</code> </pre> <a name="questions"></a> <h2>Questions?</h2> <p>To get an assistance on this module contact us by email :arrow_right: <a class="reference external" href="mailto:help&#64;itpp.dev">help&#64;itpp.dev</a></p> <a name="contributors"></a> <h2>Contributors</h2> <ul class="simple"> <li><a class="reference external" href="https://it-projects.info/team/yelizariev">Ivan Yelizariev</a></li> <li><a class="reference external" href="https://it-projects.info/team/KolushovAlexandr">Kolushov Alexandr</a></li> <li><a class="reference external" href="https://it-projects.info/team/GabbasovDinar">Dinar Gabbasov</a></li> </ul> <a name="further-information"></a> <h2>Further information</h2> <p>Odoo Apps Store: <a class="reference external" href="https://apps.odoo.com/apps/modules/12.0/pos_multi_session/">https://apps.odoo.com/apps/modules/12.0/pos_multi_session/</a></p> <p>Notifications on updates: <a class="reference external" href="https://github.com/it-projects-llc/pos-addons/commits/12.0/pos_multi_session.atom">via Atom</a>, <a class="reference external" href="https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/pos-addons/commits/12.0/pos_multi_session.atom">by Email</a></p> <p>Tested on <a class="reference external" href="https://github.com/odoo/odoo/commit/b50f51207aa2b4c2d264fc47797a6c123a8ea15e">Odoo 12.0</a></p>