Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
1
sale_exception/wizard/__init__.py
Executable file
1
sale_exception/wizard/__init__.py
Executable file
@@ -0,0 +1 @@
|
||||
from . import sale_exception_confirm
|
||||
20
sale_exception/wizard/sale_exception_confirm.py
Executable file
20
sale_exception/wizard/sale_exception_confirm.py
Executable file
@@ -0,0 +1,20 @@
|
||||
# Copyright 2011 Akretion, Sodexis
|
||||
# Copyright 2018 Akretion
|
||||
# Copyright 2019 Camptocamp SA
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class SaleExceptionConfirm(models.TransientModel):
|
||||
_name = "sale.exception.confirm"
|
||||
_inherit = ["exception.rule.confirm"]
|
||||
_description = "Sale exception confirm wizard"
|
||||
|
||||
related_model_id = fields.Many2one("sale.order", "Sale")
|
||||
|
||||
def action_confirm(self):
|
||||
self.ensure_one()
|
||||
if self.ignore:
|
||||
self.related_model_id.action_ignore_exceptions()
|
||||
self.related_model_id.action_confirm()
|
||||
return super().action_confirm()
|
||||
43
sale_exception/wizard/sale_exception_confirm_view.xml
Executable file
43
sale_exception/wizard/sale_exception_confirm_view.xml
Executable file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="view_sale_exception_confirm" model="ir.ui.view">
|
||||
<field name="name">Sale Exceptions</field>
|
||||
<field name="model">sale.exception.confirm</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Blocked in draft due to exceptions">
|
||||
<group>
|
||||
<field name="exception_ids" nolabel="1" colspan="2">
|
||||
<list>
|
||||
<field name="name" />
|
||||
<field name="description" />
|
||||
</list>
|
||||
</field>
|
||||
<field
|
||||
name="ignore"
|
||||
widget="boolean_toggle"
|
||||
groups="sales_team.group_sale_manager"
|
||||
/>
|
||||
</group>
|
||||
<footer>
|
||||
<button
|
||||
name="action_confirm"
|
||||
string="Confirm"
|
||||
type="object"
|
||||
class="btn-primary"
|
||||
invisible="not ignore"
|
||||
/>
|
||||
<button class="oe_link" special="cancel" string="Cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_sale_exception_confirm" model="ir.actions.act_window">
|
||||
<field name="name">Blocked in draft due to exceptions</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sale.exception.confirm</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_sale_exception_confirm" />
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user