Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1219 Vizualizări

Hi i want to make a wizard appears to select an order type before the quot/order form views.

from odoo import models, fields, api

class OrderTypeWizard(models.TransientModel):
    _name = 'order.type.wizard'
    _description = 'Select Order Type Wizard'
    order_type_id = fields.Many2one('sales.order.type', string='Order Type', required=True)

    def action_confirm(self):
        # Lakukan logika untuk menyimpan pilihan order_type_id
        self.env['sale.order'].create({
            'order_type_id': self.order_type_id.id,
            # Tambahkan field lainnya yang diperlukan
        })
        return {'type': 'ir.actions.act_window_close'}
from odoo import models, fields, api

class SaleOrder(models.Model):
    _inherit = 'sale.order'
    order_type_id = fields.Many2one('sales.order.type', string='Order Type')

    def action_create_quote(self):
        return {
            'name': 'Select Order Type',
            'type': 'ir.actions.act_window',
            'res_model': 'order.type.wizard',
            'view_mode': 'form',
            'target': 'new',
        }


How do i inherit the action with the + New button?


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
iun. 20
9262
3
iul. 25
2187
1
iun. 25
2758
2
mai 25
2161
1
mai 25
1335