diff --git a/awesome_dashboard/__init__.py b/awesome_dashboard/__init__.py deleted file mode 100644 index b0f26a9a602..00000000000 --- a/awesome_dashboard/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import controllers diff --git a/awesome_dashboard/__manifest__.py b/awesome_dashboard/__manifest__.py deleted file mode 100644 index a1cd72893d7..00000000000 --- a/awesome_dashboard/__manifest__.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -{ - 'name': "Awesome Dashboard", - - 'summary': """ - Starting module for "Discover the JS framework, chapter 2: Build a dashboard" - """, - - 'description': """ - Starting module for "Discover the JS framework, chapter 2: Build a dashboard" - """, - - 'author': "Odoo", - 'website': "https://www.odoo.com/", - 'category': 'Tutorials', - 'version': '0.1', - 'application': True, - 'installable': True, - 'depends': ['base', 'web', 'mail', 'crm'], - - 'data': [ - 'views/views.xml', - ], - 'assets': { - 'web.assets_backend': [ - 'awesome_dashboard/static/src/**/*', - ], - }, - 'license': 'AGPL-3' -} diff --git a/awesome_dashboard/controllers/__init__.py b/awesome_dashboard/controllers/__init__.py deleted file mode 100644 index 457bae27e11..00000000000 --- a/awesome_dashboard/controllers/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import controllers \ No newline at end of file diff --git a/awesome_dashboard/controllers/controllers.py b/awesome_dashboard/controllers/controllers.py deleted file mode 100644 index 05977d3bd7f..00000000000 --- a/awesome_dashboard/controllers/controllers.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- - -import logging -import random - -from odoo import http -from odoo.http import request - -logger = logging.getLogger(__name__) - -class AwesomeDashboard(http.Controller): - @http.route('/awesome_dashboard/statistics', type='jsonrpc', auth='user') - def get_statistics(self): - """ - Returns a dict of statistics about the orders: - 'average_quantity': the average number of t-shirts by order - 'average_time': the average time (in hours) elapsed between the - moment an order is created, and the moment is it sent - 'nb_cancelled_orders': the number of cancelled orders, this month - 'nb_new_orders': the number of new orders, this month - 'total_amount': the total amount of orders, this month - """ - - return { - 'average_quantity': random.randint(4, 12), - 'average_time': random.randint(4, 123), - 'nb_cancelled_orders': random.randint(0, 50), - 'nb_new_orders': random.randint(10, 200), - 'orders_by_size': { - 'm': random.randint(0, 150), - 's': random.randint(0, 150), - 'xl': random.randint(0, 150), - }, - 'total_amount': random.randint(100, 1000) - } - diff --git a/awesome_dashboard/static/src/dashboard.js b/awesome_dashboard/static/src/dashboard.js deleted file mode 100644 index c4fb245621b..00000000000 --- a/awesome_dashboard/static/src/dashboard.js +++ /dev/null @@ -1,8 +0,0 @@ -import { Component } from "@odoo/owl"; -import { registry } from "@web/core/registry"; - -class AwesomeDashboard extends Component { - static template = "awesome_dashboard.AwesomeDashboard"; -} - -registry.category("actions").add("awesome_dashboard.dashboard", AwesomeDashboard); diff --git a/awesome_dashboard/static/src/dashboard.xml b/awesome_dashboard/static/src/dashboard.xml deleted file mode 100644 index 1a2ac9a2fed..00000000000 --- a/awesome_dashboard/static/src/dashboard.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - hello dashboard - - - diff --git a/awesome_dashboard/views/views.xml b/awesome_dashboard/views/views.xml deleted file mode 100644 index 47fb2b6f258..00000000000 --- a/awesome_dashboard/views/views.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - Dashboard - awesome_dashboard.dashboard - - - - - - diff --git a/awesome_owl/__init__.py b/awesome_owl/__init__.py deleted file mode 100644 index 457bae27e11..00000000000 --- a/awesome_owl/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import controllers \ No newline at end of file diff --git a/awesome_owl/__manifest__.py b/awesome_owl/__manifest__.py deleted file mode 100644 index 55002ab81de..00000000000 --- a/awesome_owl/__manifest__.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -{ - 'name': "Awesome Owl", - - 'summary': """ - Starting module for "Discover the JS framework, chapter 1: Owl components" - """, - - 'description': """ - Starting module for "Discover the JS framework, chapter 1: Owl components" - """, - - 'author': "Odoo", - 'website': "https://www.odoo.com", - - # Categories can be used to filter modules in modules listing - # Check https://github.com/odoo/odoo/blob/15.0/odoo/addons/base/data/ir_module_category_data.xml - # for the full list - 'category': 'Tutorials', - 'version': '0.1', - - # any module necessary for this one to work correctly - 'depends': ['base', 'web'], - 'application': True, - 'installable': True, - 'data': [ - 'views/templates.xml', - ], - 'assets': { - 'awesome_owl.assets_playground': [ - ('include', 'web._assets_helpers'), - ('include', 'web._assets_backend_helpers'), - 'web/static/src/scss/pre_variables.scss', - 'web/static/lib/bootstrap/scss/_variables.scss', - 'web/static/lib/bootstrap/scss/_maps.scss', - ('include', 'web._assets_bootstrap'), - ('include', 'web._assets_core'), - 'web/static/src/libs/fontawesome/css/font-awesome.css', - 'awesome_owl/static/src/**/*', - ], - }, - 'license': 'AGPL-3' -} diff --git a/awesome_owl/controllers/__init__.py b/awesome_owl/controllers/__init__.py deleted file mode 100644 index 457bae27e11..00000000000 --- a/awesome_owl/controllers/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import controllers \ No newline at end of file diff --git a/awesome_owl/controllers/controllers.py b/awesome_owl/controllers/controllers.py deleted file mode 100644 index bccfd6fe283..00000000000 --- a/awesome_owl/controllers/controllers.py +++ /dev/null @@ -1,10 +0,0 @@ -from odoo import http -from odoo.http import request, route - -class OwlPlayground(http.Controller): - @http.route(['/awesome_owl'], type='http', auth='public') - def show_playground(self): - """ - Renders the owl playground page - """ - return request.render('awesome_owl.playground') diff --git a/awesome_owl/static/src/main.js b/awesome_owl/static/src/main.js deleted file mode 100644 index 1aaea902b55..00000000000 --- a/awesome_owl/static/src/main.js +++ /dev/null @@ -1,12 +0,0 @@ -import { whenReady } from "@odoo/owl"; -import { mountComponent } from "@web/env"; -import { Playground } from "./playground"; - -const config = { - dev: true, - name: "Owl Tutorial" -}; - -// Mount the Playground component when the document.body is ready -whenReady(() => mountComponent(Playground, document.body, config)); - diff --git a/awesome_owl/static/src/playground.js b/awesome_owl/static/src/playground.js deleted file mode 100644 index 4ac769b0aa5..00000000000 --- a/awesome_owl/static/src/playground.js +++ /dev/null @@ -1,5 +0,0 @@ -import { Component } from "@odoo/owl"; - -export class Playground extends Component { - static template = "awesome_owl.playground"; -} diff --git a/awesome_owl/static/src/playground.xml b/awesome_owl/static/src/playground.xml deleted file mode 100644 index 4fb905d59f9..00000000000 --- a/awesome_owl/static/src/playground.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - -
- hello world -
-
- -
diff --git a/awesome_owl/views/templates.xml b/awesome_owl/views/templates.xml deleted file mode 100644 index aa54c1a7241..00000000000 --- a/awesome_owl/views/templates.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/bom_forecast/__init__.py b/bom_forecast/__init__.py new file mode 100644 index 00000000000..9186ee3ad24 --- /dev/null +++ b/bom_forecast/__init__.py @@ -0,0 +1 @@ +from . import model diff --git a/bom_forecast/__manifest__.py b/bom_forecast/__manifest__.py new file mode 100644 index 00000000000..6ee320ce17e --- /dev/null +++ b/bom_forecast/__manifest__.py @@ -0,0 +1,16 @@ +{ + "name": "bom_forecast", + "version": "1.0", + "depends": ["mrp", "purchase"], + "author": "soham", + "category": "Tutorials", + "license": "LGPL-3", + 'installable': True, + 'auto_install': True, + 'application': True, + "assets": { + "web.assets_backend": [ + "bom_forecast/static/src/**/*", + ], + }, +} diff --git a/bom_forecast/model/__init__.py b/bom_forecast/model/__init__.py new file mode 100644 index 00000000000..98974148e0e --- /dev/null +++ b/bom_forecast/model/__init__.py @@ -0,0 +1 @@ +from . import report_mrp_bom_structure diff --git a/bom_forecast/model/report_mrp_bom_structure.py b/bom_forecast/model/report_mrp_bom_structure.py new file mode 100644 index 00000000000..a406162251c --- /dev/null +++ b/bom_forecast/model/report_mrp_bom_structure.py @@ -0,0 +1,15 @@ +from odoo import _, models + + +class ReportMrpReportBomStructure(models.AbstractModel): + _inherit = "report.mrp.report_bom_structure" + + def _get_bom_data(self, *args, **kwargs): + result = super()._get_bom_data(*args, **kwargs) + if result.get("level") == 0: + qty = int(result.get("producible_qty") or 0) + if qty > 0: + result["status"] = _("%(qty)s Ready To Produce", qty=qty) + else: + result["status"] = _("No Ready To Produce") + return result diff --git a/bom_forecast/static/src/bom_overview_line.js b/bom_forecast/static/src/bom_overview_line.js new file mode 100644 index 00000000000..058723a2187 --- /dev/null +++ b/bom_forecast/static/src/bom_overview_line.js @@ -0,0 +1,28 @@ +import { patch } from "@web/core/utils/patch"; +import { BomOverviewLine } from "@mrp/components/bom_overview_line/mrp_bom_overview_line"; + +patch(BomOverviewLine.prototype, { + + get statusBackgroundColor() { + switch (this.data.availability_state) { + case "available": return "text-bg-success"; + case "expected": + case "estimated": + if (this.data.level === 0) return "text-bg-dark"; + return "border border-warning text-warning"; + case "unavailable": return "text-bg-danger"; + default: return "text-bg-dark"; + } + }, + + get statusDisplay() { + if (this.data.level > 0 && + this.data.availability_display && + this.data.availability_display.includes("Estimated")) { + return this.data.availability_display.replace( + "Estimated", "Expected" + ); + } + return this.data.availability_display; + } +}); diff --git a/bom_forecast/static/src/bom_overview_line.xml b/bom_forecast/static/src/bom_overview_line.xml new file mode 100644 index 00000000000..c3dc59fb628 --- /dev/null +++ b/bom_forecast/static/src/bom_overview_line.xml @@ -0,0 +1,38 @@ + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+
+
+
diff --git a/bom_forecast/static/src/mrp_bom_overview_table.xml b/bom_forecast/static/src/mrp_bom_overview_table.xml new file mode 100644 index 00000000000..151a81b4662 --- /dev/null +++ b/bom_forecast/static/src/mrp_bom_overview_table.xml @@ -0,0 +1,7 @@ + + + + + + +