mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-18 06:32:00 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
from . import attachement_queue_reschedule
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
# Copyright 2013-2020 Camptocamp SA
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AttachmentQueueReschedule(models.TransientModel):
|
||||
_name = "attachment.queue.reschedule"
|
||||
_description = "Wizard to reschedule a selection of attachments"
|
||||
|
||||
def _default_attachment_ids(self):
|
||||
res = False
|
||||
context = self.env.context
|
||||
if context.get("active_model") == "attachment.queue" and context.get(
|
||||
"active_ids"
|
||||
):
|
||||
res = context["active_ids"]
|
||||
return res
|
||||
|
||||
attachment_ids = fields.Many2many(
|
||||
comodel_name="attachment.queue",
|
||||
string="Attachments",
|
||||
default=lambda r: r._default_attachment_ids(),
|
||||
)
|
||||
|
||||
def reschedule(self):
|
||||
attachments = self.attachment_ids
|
||||
attachments.button_reschedule()
|
||||
return {"type": "ir.actions.act_window_close"}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
|
||||
<record id="view_reschedule_attachment" model="ir.ui.view">
|
||||
<field name="name">Reschedule Attachments</field>
|
||||
<field name="model">attachment.queue.reschedule</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Requeue Attachments">
|
||||
<group string="The selected attachments will be rescheduled.">
|
||||
<field name="attachment_ids" nolabel="1" colspan="2" />
|
||||
</group>
|
||||
<footer>
|
||||
<button
|
||||
name="reschedule"
|
||||
string="Reschedule"
|
||||
type="object"
|
||||
class="oe_highlight"
|
||||
/>
|
||||
<button string="Cancel" class="oe_link" special="cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_reschedule_attachment" model="ir.actions.act_window">
|
||||
<field name="name">Reschedule Attachment</field>
|
||||
<field name="res_model">attachment.queue.reschedule</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_reschedule_attachment" />
|
||||
<field name="target">new</field>
|
||||
<field name="binding_model_id" ref="attachment_queue.model_attachment_queue" />
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue