mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-19 20:32:03 +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,25 @@
|
|||
# Copyright 2024 Tecnativa - Víctor Martínez
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class WizardDmsFileMove(models.TransientModel):
|
||||
_name = "wizard.dms.file.move"
|
||||
_description = "Wizard Dms File Move"
|
||||
|
||||
count_files = fields.Integer(readonly=True)
|
||||
directory_id = fields.Many2one(
|
||||
comodel_name="dms.directory", required=True, string="Directory"
|
||||
)
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields):
|
||||
vals = super().default_get(fields)
|
||||
if self.env.context.get("active_ids"):
|
||||
vals.update({"count_files": len(self.env.context.get("active_ids"))})
|
||||
return vals
|
||||
|
||||
def process(self):
|
||||
items = self.env["dms.file"].browse(self.env.context.get("active_ids"))
|
||||
items.write({"directory_id": self.directory_id})
|
||||
Loading…
Add table
Add a link
Reference in a new issue