Skip to content

Commit d990377

Browse files
author
Michael Michot
committed
[ADD] module disable_quick_create
1 parent 91742b3 commit d990377

File tree

7 files changed

+44
-0
lines changed

7 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2020 Pharmasimple (https://www.pharmasimple.be)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Disable quick create by default",
5+
"category": "Tools",
6+
"summary": """
7+
Based on base_optional_quick_create,
8+
this module add a default value on avoid_quick_create
9+
to disable all quick create by default""",
10+
"version": "14.0.1.0.0",
11+
"author": "Pharmasimple",
12+
"license": "AGPL-3",
13+
"website": "https://github.com/akretion/phs-addons",
14+
"depends": [
15+
"base_optional_quick_create",
16+
],
17+
"data": ["data/setup.xml"],
18+
"installable": True,
19+
"application": False,
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<function model="ir.model" name="disable_all_quick_create" />
4+
</odoo>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import ir_model
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from odoo import api, fields, models
2+
3+
4+
class IrModel(models.Model):
5+
_inherit = "ir.model"
6+
7+
avoid_quick_create = fields.Boolean(default=True)
8+
9+
@api.model
10+
def disable_all_quick_create(self):
11+
self.search([]).write({"avoid_quick_create": True})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../disable_quick_create_by_default
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)

0 commit comments

Comments
 (0)