mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[ADD] base_exception_user,sale_exception_user,stock_exception: backported from 13.0 to 12.0
H7287
This commit is contained in:
1
sale_exception_user/wizard/__init__.py
Normal file
1
sale_exception_user/wizard/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import sale_exception_confirm
|
||||
16
sale_exception_user/wizard/sale_exception_confirm.py
Normal file
16
sale_exception_user/wizard/sale_exception_confirm.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class SaleExceptionConfirm(models.TransientModel):
|
||||
_inherit = 'sale.exception.confirm'
|
||||
|
||||
def action_confirm(self):
|
||||
res = super().action_confirm()
|
||||
if self.ignore:
|
||||
self.related_model_id.action_confirm()
|
||||
return res
|
||||
|
||||
def _action_ignore(self):
|
||||
self.related_model_id.ignore_exception = True
|
||||
self.related_model_id.action_confirm()
|
||||
return super()._action_ignore()
|
||||
18
sale_exception_user/wizard/sale_exception_confirm_view.xml
Normal file
18
sale_exception_user/wizard/sale_exception_confirm_view.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="view_sale_exception_confirm" model="ir.ui.view">
|
||||
<field name="name">Sale Exceptions User</field>
|
||||
<field name="model">sale.exception.confirm</field>
|
||||
<field name="inherit_id" ref="sale_exception.view_sale_exception_confirm"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='ignore']" position="after">
|
||||
<field name="show_ignore_button" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_confirm']" position="after">
|
||||
<button name="action_ignore" string="Ignore" colspan="1" type="object" attrs="{'invisible': [('show_ignore_button', '=', False)]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user