mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-19 01:32:06 +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,3 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import copy_verification_lines
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class CopyVerificationLines(models.TransientModel):
|
||||
"""Copy Verification Lines."""
|
||||
|
||||
_name = "copy.verification.lines"
|
||||
_description = "Copy Verification Lines"
|
||||
|
||||
audit_src = fields.Many2one("mgmtsystem.audit", "Choose audit")
|
||||
|
||||
def copyVerificationLines(self):
|
||||
# Copy verification lines from the chosen audit to the current one
|
||||
audit_proxy = self.env[self._context.get("active_model")]
|
||||
verification_line_proxy = self.env["mgmtsystem.verification.line"]
|
||||
audit_id = self._context.get("active_id")
|
||||
src_id = self.read(["audit_src"])[0]["audit_src"][0]
|
||||
for line in audit_proxy.browse(src_id).line_ids:
|
||||
verification_line_proxy.create(
|
||||
{
|
||||
"seq": line.seq,
|
||||
"name": line.name,
|
||||
"audit_id": audit_id,
|
||||
"procedure_id": line.procedure_id.id,
|
||||
"is_conformed": False,
|
||||
}
|
||||
)
|
||||
return {"type": "ir.actions.act_window_close"}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="copy_verification_lines_form_view" model="ir.ui.view">
|
||||
<field name="name">copy.verification.lines.form</field>
|
||||
<field name="model">copy.verification.lines</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Copy Verification Lines">
|
||||
<field name="audit_src" domain="[('state','=','done')]" />
|
||||
<group colspan="2" col="3">
|
||||
<button string="_Cancel" special="cancel" />
|
||||
<button string="_Copy" name="copyVerificationLines" type="object" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="copy_verification_lines_act_window" model="ir.actions.act_window">
|
||||
<field name="name">Copy Verification Lines</field>
|
||||
<field name="res_model">copy.verification.lines</field>
|
||||
<field name="binding_model_id" ref="model_mgmtsystem_audit" />
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="binding_view_types">form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue