Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
1
purchase_unreconciled/wizards/__init__.py
Executable file
1
purchase_unreconciled/wizards/__init__.py
Executable file
@@ -0,0 +1 @@
|
||||
from . import purchase_unreconciled_exceeded
|
||||
36
purchase_unreconciled/wizards/purchase_unreconciled_exceeded.py
Executable file
36
purchase_unreconciled/wizards/purchase_unreconciled_exceeded.py
Executable file
@@ -0,0 +1,36 @@
|
||||
from odoo import _, fields, models
|
||||
|
||||
|
||||
class PurchaseUnreconciledExceededWiz(models.TransientModel):
|
||||
_name = "purchase.unreconciled.exceeded.wiz"
|
||||
_description = "Purchase Unreconciled Exceeded Wizard"
|
||||
|
||||
purchase_id = fields.Many2one(
|
||||
comodel_name="purchase.order", readonly=True, string="Order Number"
|
||||
)
|
||||
exception_msg = fields.Text(readonly=True)
|
||||
origin_reference = fields.Reference(
|
||||
lambda self: [
|
||||
(m.model, m.name) for m in self.env["ir.model"].sudo().search([])
|
||||
],
|
||||
string="Object",
|
||||
)
|
||||
continue_method = fields.Char()
|
||||
|
||||
def action_show(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"name": _("Purchase unreconciled exceeded"),
|
||||
"res_model": self._name,
|
||||
"res_id": self.id,
|
||||
"view_mode": "form",
|
||||
"target": "new",
|
||||
}
|
||||
|
||||
def button_continue(self):
|
||||
self.ensure_one()
|
||||
return getattr(
|
||||
self.origin_reference.with_context(bypass_unreconciled=True),
|
||||
self.continue_method,
|
||||
)()
|
||||
26
purchase_unreconciled/wizards/purchase_unreconciled_exceeded_view.xml
Executable file
26
purchase_unreconciled/wizards/purchase_unreconciled_exceeded_view.xml
Executable file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="purchase_unreconciled_exceeded_wizard" model="ir.ui.view">
|
||||
<field name="name">purchase unreconciled exceeded</field>
|
||||
<field name="model">purchase.unreconciled.exceeded.wiz</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Amount Unreconciled exceeded">
|
||||
<p>The order has exceeded its amount unreconciled</p>
|
||||
<field name="exception_msg" colspan="2" nolabel="1" />
|
||||
<group>
|
||||
<field name="purchase_id" />
|
||||
</group>
|
||||
<footer>
|
||||
<button
|
||||
string="Lock and Reconcile"
|
||||
class="oe_highlight"
|
||||
name="button_continue"
|
||||
type="object"
|
||||
groups="account.group_account_user"
|
||||
/>
|
||||
<button string="Cancel" class="oe_link" special="cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user