mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-29 03:46:29 -06:00
[MIG] document_url: Migration to 15.0
This commit is contained in:
parent
21562efab2
commit
c81e4bb429
@ -2,13 +2,18 @@
|
||||
# Copyright 2020 Tecnativa - Manuel Calero
|
||||
{
|
||||
"name": "URL attachment",
|
||||
"version": "13.0.1.0.1",
|
||||
"version": "15.0.1.0.0",
|
||||
"category": "Tools",
|
||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/knowledge",
|
||||
"license": "AGPL-3",
|
||||
"depends": ["mail"],
|
||||
"data": ["view/document_url_view.xml"],
|
||||
"qweb": ["static/src/xml/url.xml"],
|
||||
"assets": {
|
||||
"web.assets_backend": [
|
||||
"document_url/static/src/js/url.js",
|
||||
],
|
||||
"web.assets_qweb": ["document_url/static/src/xml/url.xml"],
|
||||
},
|
||||
"installable": True,
|
||||
}
|
||||
|
@ -7,14 +7,12 @@ class TestDocumentUrl(common.TransactionCase):
|
||||
def setUp(self):
|
||||
super(TestDocumentUrl, self).setUp()
|
||||
wizard_add_url = self.env["ir.attachment.add_url"]
|
||||
ctx = {
|
||||
"active_model": "res.users",
|
||||
"active_id": self.env.ref("base.user_demo").id,
|
||||
"active_ids": [self.env.ref("base.user_demo").id],
|
||||
}
|
||||
self.wizard_add_url = wizard_add_url.with_context(ctx).create(
|
||||
{"name": "Demo User (Website)", "url": "http://www.odoodemouser.com"}
|
||||
)
|
||||
|
||||
self.wizard_add_url = wizard_add_url.with_context(
|
||||
active_model="res.users",
|
||||
active_id=self.env.ref("base.user_demo").id,
|
||||
active_ids=[self.env.ref("base.user_demo").id],
|
||||
).create({"name": "Demo User (Website)", "url": "http://www.odoodemouser.com"})
|
||||
|
||||
def test_add_url_attachment(self):
|
||||
self.wizard_add_url.action_add_url()
|
||||
|
@ -1,14 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<template
|
||||
id="assets_backend"
|
||||
name="document_url assets"
|
||||
inherit_id="web.assets_backend"
|
||||
>
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/document_url/static/src/js/url.js" />
|
||||
</xpath>
|
||||
</template>
|
||||
<record model='ir.actions.act_window' id='action_ir_attachment_add_url'>
|
||||
<field name='name'>Add URL</field>
|
||||
<field name='res_model'>ir.attachment.add_url</field>
|
||||
|
@ -10,7 +10,7 @@ class AddUrlWizard(models.TransientModel):
|
||||
_name = "ir.attachment.add_url"
|
||||
_description = "Wizard to add URL attachment"
|
||||
|
||||
name = fields.Char("Name", required=True)
|
||||
name = fields.Char(required=True)
|
||||
url = fields.Char("URL", required=True)
|
||||
|
||||
def action_add_url(self):
|
||||
|
Loading…
Reference in New Issue
Block a user