Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

[Odoo 18e] Button to open Form without saving Open Record

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
webclientjavascriptactiondevelopmentsystemfunctionwizard
383 Rodiniai
Portretas
Jeremy Gritz

I am struggling with Odoo implementing a module for a small business:

Sale Order - Standard Model and Views, added fields not relevant to this issue

Sale Order Line - Standard Views, add field for batch ID on appropriate items

Panel Job - Contains definition of cut-to-length manufacturing job including list of pieces and lengths

I need to add a button to the Sale Order form view to open the form view for Panel Job without saving Sale Order. Panel Job's Form view has a button that then creates a Sale Order Line referencing the Panel Job. At this point I would not like to permanently commit Panel Job either. When the Sale Order is saved manually or otherwise acted upon (e.g. emailed), it can save normally, both Panel Job and Sale Order.

I have attempted object and action buttons defining the ir.action.act_window, and this works minus the saving when I don't want it to.

Research has pointed me toward client actions and javascript buttons, but I have been unsuccessful in having these actually work, in that I can't even get the templates to show on the sales order. This is what I currently have:

views/sales_order_updated_views.xml

<odoo>
    <record id="module_sale_order" model="ir.ui.view">
        <field name="name">Sales Order</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">


            <xpath expr="//field[@name='order_line']" position="before">
                <div id="addNewPanelJobButton"/>
            </xpath>
  
...
  
</record>
</odoo>

views/client_actions.xml

<odoo>    
  <record id="act_new_panel_job" model="ir.actions.client">
        <field name="name">Add New Panel Job</field>
        <field name="tag">module.NewPanelJob</field>
        <field name="target">new</field>
    </record>
</odoo>

static/src/xml/newpaneljobtemplate.xml

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <template xml:space="preserve">
        <xpath expr="//@div[id=addNewPanelJobButton]" position="replace">
            <t t-name="module.NewPanelJobTemplate" t-inherit="web.FormView">
                <p t-on-click="module.NewPanelJob">Template Works</p>
            </t>
        </xpath>
    </template>
</odoo>

static/src/js/client_actions.js

import { registry } from "@web/core/registry";
import { Component } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";


export class NewPanelJobComponent extends Component {
    setup() {
        super.setup();
        this.action = useService("action");
    };


    addNewPanelJob() {
        this.action.doAction({
        type: 'ir.actions.act_window',
        res_model: 'module.panel_job',
        views: [[false, 'form']],
        target: 'new',
        });
    }
}


NewPanelJobComponent.template = "module.NewPanelJobTemplate";


registry.category("actions").add("module.NewPanelJob",NewPanelJobComponent);

Am I even going down the right path with this?

I'm not sure what standard practices are and finding examples in the code has been less than helpful.

Thanks in advance for any insight.

0
Portretas
Atmesti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registracija
Related Posts Replies Rodiniai Veikla
Missing products in zpl report from wizard
action development wizard
Portretas
0
liep. 25
989
Sekcja opinii i komentarz
action development function
Portretas
0
kov. 25
1337
Product images are frequently disappearing from the POS device
action development configuration function
Portretas
0
lapkr. 25
156
Error with rpc call
javascript development function debug
Portretas
Portretas
Portretas
2
liep. 25
1948
How to add a text over an image in my website.
javascript action development configuration
Portretas
0
kov. 25
1977
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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