mirror of
https://github.com/bringout/oca-workflow-process.git
synced 2026-04-23 04:52:02 +02:00
Initial commit: OCA Workflow Process packages (456 packages)
This commit is contained in:
commit
d366e42934
18799 changed files with 1284507 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
from . import sale_exception_confirm
|
||||
|
|
@ -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()
|
||||
exceptions_blocking = self.exception_ids.filtered("is_blocking")
|
||||
if self.ignore and not exceptions_blocking:
|
||||
self.related_model_id.ignore_exception = True
|
||||
return super().action_confirm()
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?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">
|
||||
<tree>
|
||||
<field name="name" />
|
||||
<field name="description" />
|
||||
</tree>
|
||||
</field>
|
||||
<newline />
|
||||
<field name="ignore" groups='sales_team.group_sale_manager' />
|
||||
</group>
|
||||
<footer>
|
||||
<button
|
||||
name="action_confirm"
|
||||
string="Confirm"
|
||||
colspan="1"
|
||||
type="object"
|
||||
/>
|
||||
<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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue