### Create Procurement Orders from Buffers Source: https://context7.com/oca/ddmrp/llms.txt Demonstrates how to use the make.procurement.buffer wizard to generate purchase, manufacturing, or transfer orders based on buffer recommendations. It also shows how to inspect the resulting order lines or manufacturing orders. ```python wizard = env['make.procurement.buffer'].with_context(active_model='stock.buffer', active_ids=[buffer.id], active_id=buffer.id).create({}) for item in wizard.item_ids: print(f"Buffer: {item.buffer_id.name}") print(f"Product: {item.product_id.name}") print(f"Recommended Qty: {item.recommended_qty}") print(f"Qty to Order: {item.qty}") print(f"Planned Date: {item.date_planned}") print(f"UoM: {item.uom_id.name}") wizard.make_procurement() pol = env['purchase.order.line'].search([('buffer_ids', 'in', buffer.id)]) print(f"PO Line created: {pol.order_id.name} - Qty: {pol.product_qty}") mos = buffer.mrp_production_ids for mo in mos: print(f"MO created: {mo.name} - Qty: {mo.product_qty}") ``` -------------------------------- ### Configure ADU Calculation Methods Source: https://context7.com/oca/ddmrp/llms.txt Shows how to define different Average Daily Usage (ADU) calculation strategies, such as blended past/future demand or purely historical data, and apply them to a buffer. ```python adu_method = env['product.adu.calculation.method'].create({ 'name': 'Blended 120 days (50/50)', 'method': 'blended', 'source_past': 'actual', 'horizon_past': 120, 'factor_past': 0.5, 'source_future': 'estimates', 'horizon_future': 120, 'factor_future': 0.5, 'company_id': env.company.id, }) adu_past_method = env['product.adu.calculation.method'].create({ 'name': 'Past 90 days actual', 'method': 'past', 'source_past': 'actual', 'horizon_past': 90, 'company_id': env.company.id, }) buffer.adu_calculation_method = adu_method.id buffer._calc_adu() print(f"Calculated ADU: {buffer.adu} units/day") ``` -------------------------------- ### Apply DDMRP Buffer Adjustments Source: https://context7.com/oca/ddmrp/llms.txt Shows how to create various adjustment factors (Demand, Lead Time, Red Zone, Green Zone) to modify buffer behavior temporarily for events like seasonality or supply disruptions. ```python from datetime import date, timedelta daf = env['ddmrp.adjustment'].create({'buffer_id': buffer.id, 'adjustment_type': 'DAF', 'value': 1.5, 'manual_date_start': date.today(), 'manual_date_end': date.today() + timedelta(days=30)}) ltaf = env['ddmrp.adjustment'].create({'buffer_id': buffer.id, 'adjustment_type': 'LTAF', 'value': 1.25, 'manual_date_start': date.today(), 'manual_date_end': date.today() + timedelta(days=60)}) rzaf = env['ddmrp.adjustment'].create({'buffer_id': buffer.id, 'adjustment_type': 'RZAF', 'value': 1.2, 'manual_date_start': date.today(), 'manual_date_end': date.today() + timedelta(days=90)}) gzaf = env['ddmrp.adjustment'].create({'buffer_id': buffer.id, 'adjustment_type': 'GZAF', 'value': 0.8, 'manual_date_start': date.today(), 'manual_date_end': date.today() + timedelta(days=14)}) ``` -------------------------------- ### Configure Distributed Buffer Replenishment Source: https://context7.com/oca/ddmrp/llms.txt Shows how to set up a distributed buffer for inter-warehouse replenishment and how to limit procurement quantities based on available stock at the source location. ```python distributed_buffer = env['stock.buffer'].create({ 'buffer_profile_id': env.ref('ddmrp.stock_buffer_profile_replenish_distributed_medium_medium').id, 'product_id': product.id, 'location_id': warehouse2.lot_stock_id.id, 'warehouse_id': warehouse2.id, 'lead_days': 3.0, }) distributed_buffer.cron_actions() distributed_buffer.buffer_profile_id.replenish_distributed_limit_to_free_qty = True qty_to_order = distributed_buffer._procure_qty_to_order() ``` -------------------------------- ### Define Buffer Profiles Source: https://context7.com/oca/ddmrp/llms.txt Explains how to create buffer profiles to standardize replenishment characteristics, including item types, lead time factors, and variability settings for purchased or distributed items. ```python profile = env['stock.buffer.profile'].create({ 'replenish_method': 'replenish', 'item_type': 'purchased', 'lead_time_id': env.ref('ddmrp.stock_buffer_profile_lead_time_medium').id, 'variability_id': env.ref('ddmrp.stock_buffer_profile_variability_medium').id, 'company_id': env.company.id, }) distributed_profile = env['stock.buffer.profile'].create({ 'replenish_method': 'replenish', 'item_type': 'distributed', 'lead_time_id': env.ref('ddmrp.stock_buffer_profile_lead_time_short').id, 'variability_id': env.ref('ddmrp.stock_buffer_profile_variability_low').id, 'replenish_distributed_limit_to_free_qty': True, 'distributed_reschedule_max_proc_time': 60.0, }) ``` -------------------------------- ### Manage Stock Buffer Models in Odoo Source: https://context7.com/oca/ddmrp/llms.txt Demonstrates how to programmatically create a stock buffer for a manufactured product, trigger recalculations for ADU and priorities, and retrieve computed buffer zones and net flow positions. ```python buffer = env['stock.buffer'].create({ 'buffer_profile_id': env.ref('ddmrp.stock_buffer_profile_replenish_manufactured_medium_medium').id, 'product_id': product.id, 'location_id': env.ref('stock.stock_location_stock').id, 'warehouse_id': env.ref('stock.warehouse0').id, 'qty_multiple': 1.0, 'adu_calculation_method': env.ref('ddmrp.adu_calculation_method_fixed').id, 'adu_fixed': 10.0, 'lead_days': 5.0, 'order_spike_horizon': 10.0, 'minimum_order_quantity': 50.0, 'order_cycle': 7.0, }) buffer._calc_adu() buffer.cron_actions() print(f"Red Zone (TOR): {buffer.top_of_red}") print(f"Yellow Zone (TOY): {buffer.top_of_yellow}") print(f"Green Zone (TOG): {buffer.top_of_green}") print(f"Net Flow Position: {buffer.net_flow_position}") print(f"Recommended Qty: {buffer.procure_recommended_qty}") print(f"Planning Priority: {buffer.planning_priority_level}") ``` -------------------------------- ### POST /product.adu.calculation.method Source: https://context7.com/oca/ddmrp/llms.txt Configure methods for calculating Average Daily Usage (ADU) using historical data, estimates, or blended approaches. ```APIDOC ## POST /product.adu.calculation.method ### Description Defines how ADU is computed for buffers, supporting fixed, past, future, or blended calculation strategies. ### Method POST ### Endpoint /product.adu.calculation.method ### Request Body - **name** (string) - Required - Name of the calculation method - **method** (string) - Required - Strategy: 'fixed', 'past', 'future', or 'blended' - **horizon_past** (integer) - Optional - Look-back period in days - **horizon_future** (integer) - Optional - Look-ahead period in days ### Response #### Success Response (200) - **id** (integer) - The created ADU method ID ``` -------------------------------- ### Manage DDMRP Cron Jobs and Buffer Recalculation Source: https://context7.com/oca/ddmrp/llms.txt Covers scheduled actions for recalculating Average Daily Usage (ADU) and buffer parameters. It also demonstrates how to trigger manual refreshes and enable auto-procurement settings. ```python env['stock.buffer'].cron_ddmrp_adu() env['stock.buffer'].cron_ddmrp() env['stock.buffer'].cron_ddmrp_adu(domain=[('warehouse_id', '=', warehouse.id)]) env['stock.buffer'].cron_ddmrp(domain=[('product_id.categ_id', '=', category.id)]) buffer.refresh_buffer() buffer.auto_procure = True buffer.auto_procure_option = 'standard' buffer.cron_actions() ``` -------------------------------- ### Create DDMRP Adjustment with Date Range Source: https://context7.com/oca/ddmrp/llms.txt Demonstrates how to create a Demand Adjustment Factor (DAF) linked to a specific date range record. This is useful for time-phased inventory planning. ```python date_range = env['date.range'].search([('name', '=', 'Q1 2024')], limit=1) daf_with_range = env['ddmrp.adjustment'].create({ 'buffer_id': buffer.id, 'adjustment_type': 'DAF', 'value': 1.3, 'date_range_id': date_range.id, }) ``` -------------------------------- ### POST /stock.buffer Source: https://context7.com/oca/ddmrp/llms.txt Create and manage inventory decoupling points (buffers) to determine procurement recommendations based on Net Flow Position. ```APIDOC ## POST /stock.buffer ### Description Creates a new stock buffer record to manage inventory decoupling points and calculate replenishment needs. ### Method POST ### Endpoint /stock.buffer ### Request Body - **buffer_profile_id** (integer) - Required - ID of the buffer profile - **product_id** (integer) - Required - ID of the product - **location_id** (integer) - Required - ID of the stock location - **warehouse_id** (integer) - Required - ID of the warehouse - **adu_fixed** (float) - Optional - Fixed Average Daily Usage - **lead_days** (float) - Required - Lead time in days ### Response #### Success Response (200) - **id** (integer) - The created buffer ID - **net_flow_position** (float) - Calculated net flow position - **procure_recommended_qty** (float) - Recommended quantity to procure ``` -------------------------------- ### Compute Decoupled Lead Time (DLT) in BOMs Source: https://context7.com/oca/ddmrp/llms.txt Explains how to access and compute the Decoupled Lead Time for products within a Bill of Materials structure, considering specific warehouse locations and buffer statuses. ```python bom = env['mrp.bom'].search([('product_id', '=', product.id)], limit=1) bom_with_context = bom.with_context(location_id=stock_location.id) print(f"Is Buffered: {bom_with_context.is_buffered}") print(f"Buffer: {bom_with_context.buffer_id.name}") print(f"Decoupled Lead Time: {bom_with_context.dlt} days") for line in bom.bom_line_ids: line_with_ctx = line.with_context(location_id=stock_location.id) print(f"Component: {line.product_id.name}") print(f" Is Buffered: {line_with_ctx.is_buffered}") print(f" DLT: {line_with_ctx.dlt} days") action = bom.action_change_context_location() ``` -------------------------------- ### Retrieve Qualified Demand and Supply Metrics Source: https://context7.com/oca/ddmrp/llms.txt Provides methods to access qualified demand, order spikes, and incoming supply quantities. Requires calling cron_actions() to refresh buffer calculations before data retrieval. ```python buffer.cron_actions() print(f"Qualified Demand: {buffer.qualified_demand}") print(f"Order Spike Threshold: {buffer.order_spike_threshold}") for move in buffer.demand_stock_move_ids: print(f"Demand Move: {move.name} - Qty: {move.product_qty} - Date: {move.date}") print(f"Total Incoming: {buffer.incoming_total_qty}") ``` -------------------------------- ### POST /stock.buffer.profile Source: https://context7.com/oca/ddmrp/llms.txt Define replenishment characteristics for items, including item type and variability factors. ```APIDOC ## POST /stock.buffer.profile ### Description Creates a buffer profile to standardize replenishment settings across different product categories. ### Method POST ### Endpoint /stock.buffer.profile ### Request Body - **replenish_method** (string) - Required - 'replenish', 'replenish_override', or 'min_max' - **item_type** (string) - Required - 'manufactured', 'purchased', or 'distributed' - **lead_time_id** (integer) - Required - ID of the lead time configuration - **variability_id** (integer) - Required - ID of the variability configuration ### Response #### Success Response (200) - **id** (integer) - The created profile ID ``` -------------------------------- ### Calculate Net Flow Position and Priorities Source: https://context7.com/oca/ddmrp/llms.txt Calculates the Net Flow Position (NFP) and determines planning/execution priorities based on buffer zone thresholds. These metrics are critical for automated replenishment decisions. ```python buffer.cron_actions() print(f"Net Flow Position: {buffer.net_flow_position}") print(f"Planning Priority: {buffer.planning_priority_level}") print(f"Execution Priority: {buffer.execution_priority_level}") if buffer.procure_recommended_qty > 0: print(f"Recommended Order: {buffer.procure_recommended_qty}") ``` -------------------------------- ### Standard Docutils CSS Layout Rules Source: https://github.com/oca/ddmrp/blob/18.0/ddmrp_report_part_flow_index/static/description/index.html This CSS defines global styles for document elements such as tables, images, and admonitions. It ensures proper alignment, spacing, and visual hierarchy for generated documentation. ```css .borderless, table.borderless td, table.borderless th { border: 0 } table.borderless td, table.borderless th { padding: 0 0.5em 0 0 ! important } .first { margin-top: 0 ! important } .last, .with-subtitle { margin-bottom: 0 ! important } .hidden { display: none } .subscript { vertical-align: sub; font-size: smaller } .superscript { vertical-align: super; font-size: smaller } div.admonition { margin: 2em ; border: medium outset ; padding: 1em } img.align-left, .figure.align-left, object.align-left, table.align-left { clear: left ; float: left ; margin-right: 1em } ``` -------------------------------- ### CSS Styles for Docutils HTML Output Source: https://github.com/oca/ddmrp/blob/18.0/ddmrp_packaging/static/description/index.html This CSS code defines styles for various HTML elements generated by Docutils. It covers layout, typography, and specific elements like tables, figures, and admonitions, aiming for a clean and organized presentation of DDMRP packaging documentation. ```css /* :Author: David Goodger (goodger@python.org) :Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. */ /* used to remove borders from tables and images */ .borderless, table.borderless td, table.borderless th { border: 0 } table.borderless td, table.borderless th { /* Override padding for "table.docutils td" with "! important". The right padding separates the table cells. */ padding: 0 0.5em 0 0 ! important } .first { /* Override more specific margin styles with "! important". */ margin-top: 0 ! important } .last, .with-subtitle { margin-bottom: 0 ! important } .hidden { display: none } .subscript { vertical-align: sub; font-size: smaller } .superscript { vertical-align: super; font-size: smaller } a.toc-backref { text-decoration: none ; color: black } blockquote.epigraph { margin: 2em 5em ; } dl.docutils dd { margin-bottom: 0.5em } object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { overflow: hidden; } /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } */ div.abstract { margin: 2em 5em } div.abstract p.topic-title { font-weight: bold ; text-align: center } div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { margin: 2em ; border: medium outset ; padding: 1em } div.admonition p.admonition-title, div.hint p.admonition-title, div.important p.admonition-title, div.note p.admonition-title, div.tip p.admonition-title { font-weight: bold ; font-family: sans-serif } div.attention p.admonition-title, div.caution p.admonition-title, div.danger p.admonition-title, div.error p.admonition-title, div.warning p.admonition-title, .code .error { color: red ; font-weight: bold ; font-family: sans-serif } /* Uncomment (and remove this text!) to get reduced vertical space in compound paragraphs. div.compound .compound-first, div.compound .compound-middle { margin-bottom: 0.5em } div.compound .compound-last, div.compound .compound-middle { margin-top: 0.5em } */ div.dedication { margin: 2em 5em ; text-align: center ; font-style: italic } div.dedication p.topic-title { font-weight: bold ; font-style: normal } div.figure { margin-left: 2em ; margin-right: 2em } div.footer, div.header { clear: both; font-size: smaller } div.line-block { display: block ; margin-top: 1em ; margin-bottom: 1em } div.line-block div.line-block { margin-top: 0 ; margin-bottom: 0 ; margin-left: 1.5em } div.sidebar { margin: 0 0 0.5em 1em ; border: medium outset ; padding: 1em ; background-color: #ffffee ; width: 40% ; float: right ; clear: right } div.sidebar p.rubric { font-family: sans-serif ; font-size: medium } div.system-messages { margin: 5em } div.system-messages h1 { color: red } div.system-message { border: medium outset ; padding: 1em } div.system-message p.system-message-title { color: red ; font-weight: bold } div.topic { margin: 2em } h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { margin-top: 0.4em } h1.title { text-align: center } h2.subtitle { text-align: center } hr.docutils { width: 75% } img.align-left, .figure.align-left, object.align-left, table.align-left { clear: left ; float: left ; margin-right: 1em } img.align-right, .figure.align-right, object.align-right, table.align-right { clear: right ; float: right ; margin-left: 1em } img.align-center, .figure.align-center, object.align-center { display: block; margin-left: auto; margin-right: auto; } table.align-center { margin-left: auto; margin-right: auto; } .align-left { text-align: left } .align-center { clear: both ; text-align: center } .align-right { text-align: right } /* reset inner alignment in figures */ div.align-right { text-align: inherit } /* div.align-center * { text-align: left } */ .align-top { vertical-align: top } .align-middle { vertical-align: middle } .align-bottom { vertical-align: bottom } ol.simple, ul.simple { margin-bottom: 1em } ol.arabic { list-style: decimal } ol.loweralpha { list-style: lower-alpha } ol.upperalpha { list-style: upper-alpha } ol.lowerroman { list-style: lower-roman } ol.upperroman { list-style: upper-roman } p.attribution { text-align: right ; margin-left: 50% } p.caption { font-style: italic } p.credits { font-style: italic ; font-size: smaller } p.label { white-space: nowrap } p.rubric { font-weight: bold ; font-size: larger ; color: maroon ; text-align: center } p.sidebar-title { font-family: sans-serif ; font-weight: bold ; font-size: larger } p.sidebar-subtitle { font-family: sans-serif ; font-weight: bold } p.topic-title { font-weight: bold } pre.address ``` -------------------------------- ### Triggering Asynchronous DDMRP Warning Generation Source: https://github.com/oca/ddmrp/blob/18.0/ddmrp_warning_as_job/readme/DESCRIPTION.md This snippet demonstrates how to invoke the DDMRP warning generation method with the context flag enabled to ensure the task is processed as a background queue job. ```python context = dict(self.env.context) context['auto_delay_ddmrp_generate_ddmrp_warnings'] = True self.env['stock.buffer'].with_context(context)._generate_ddmrp_warnings() ``` -------------------------------- ### Define CSS Layout and Alignment Styles Source: https://github.com/oca/ddmrp/blob/18.0/ddmrp_cron_actions_as_job/static/description/index.html This snippet contains CSS rules for managing element alignment, table borders, and layout spacing. It provides utility classes for positioning images, tables, and text blocks within the document. ```css .borderless, table.borderless td, table.borderless th { border: 0 } table.borderless td, table.borderless th { padding: 0 0.5em 0 0 ! important } .hidden { display: none } img.align-left, .figure.align-left, object.align-left, table.align-left { clear: left ; float: left ; margin-right: 1em } img.align-center, .figure.align-center, object.align-center { display: block; margin-left: auto; margin-right: auto; } ``` -------------------------------- ### Docutils HTML CSS Stylesheet Source: https://github.com/oca/ddmrp/blob/18.0/ddmrp/static/description/index.html This CSS file provides default styling for HTML output generated by Docutils. It includes rules for tables, borders, typography, and various document elements like admonitions, figures, and sidebars. It aims for broad compatibility while allowing for customization. ```css /* :Author: David Goodger (goodger@python.org) :Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. */ /* used to remove borders from tables and images */ .borderless, table.borderless td, table.borderless th { border: 0 } table.borderless td, table.borderless th { /* Override padding for "table.docutils td" with "! important". The right padding separates the table cells. */ padding: 0 0.5em 0 0 ! important } .first { /* Override more specific margin styles with "! important". */ margin-top: 0 ! important } .last, .with-subtitle { margin-bottom: 0 ! important } .hidden { display: none } .subscript { vertical-align: sub; font-size: smaller } .superscript { vertical-align: super; font-size: smaller } a.toc-backref { text-decoration: none ; color: black } blockquote.epigraph { margin: 2em 5em ; } dl.docutils dd { margin-bottom: 0.5em } object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { overflow: hidden; } /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } */ div.abstract { margin: 2em 5em } div.abstract p.topic-title { font-weight: bold ; text-align: center } div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { margin: 2em ; border: medium outset ; padding: 1em } div.admonition p.admonition-title, div.hint p.admonition-title, div.important p.admonition-title, div.note p.admonition-title, div.tip p.admonition-title { font-weight: bold ; font-family: sans-serif } div.attention p.admonition-title, div.caution p.admonition-title, div.danger p.admonition-title, div.error p.admonition-title, div.warning p.admonition-title, .code .error { color: red ; font-weight: bold ; font-family: sans-serif } /* Uncomment (and remove this text!) to get reduced vertical space in compound paragraphs. div.compound .compound-first, div.compound .compound-middle { margin-bottom: 0.5em } div.compound .compound-last, div.compound .compound-middle { margin-top: 0.5em } */ div.dedication { margin: 2em 5em ; text-align: center ; font-style: italic } div.dedication p.topic-title { font-weight: bold ; font-style: normal } div.figure { margin-left: 2em ; margin-right: 2em } div.footer, div.header { clear: both; font-size: smaller } div.line-block { display: block ; margin-top: 1em ; margin-bottom: 1em } div.line-block div.line-block { margin-top: 0 ; margin-bottom: 0 ; margin-left: 1.5em } div.sidebar { margin: 0 0 0.5em 1em ; border: medium outset ; padding: 1em ; background-color: #ffffee ; width: 40% ; float: right ; clear: right } div.sidebar p.rubric { font-family: sans-serif ; font-size: medium } div.system-messages { margin: 5em } div.system-messages h1 { color: red } div.system-message { border: medium outset ; padding: 1em } div.system-message p.system-message-title { color: red ; font-weight: bold } div.topic { margin: 2em } h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { margin-top: 0.4em } h1.title { text-align: center } h2.subtitle { text-align: center } hr.docutils { width: 75% } img.align-left, .figure.align-left, object.align-left, table.align-left { clear: left ; float: left ; margin-right: 1em } img.align-right, .figure.align-right, object.align-right, table.align-right { clear: right ; float: right ; margin-left: 1em } img.align-center, .figure.align-center, object.align-center { display: block; margin-left: auto; margin-right: auto; } table.align-center { margin-left: auto; margin-right: auto; } .align-left { text-align: left } .align-center { clear: both ; text-align: center } .align-right { text-align: right } /* reset inner alignment in figures */ div.align-right { text-align: inherit } /* div.align-center * { text-align: left } */ .align-top { vertical-align: top } .align-middle { vertical-align: middle } .align-bottom { vertical-align: bottom } ol.simple, ul.simple { margin-bottom: 1em } ol.arabic { list-style: decimal } ol.loweralpha { list-style: lower-alpha } ol.upperalpha { list-style: upper-alpha } ol.lowerroman { list-style: lower-roman } ol.upperroman { list-style: upper-roman } p.attribution { text-align: right ; margin-left: 50% } p.caption { font-style: italic } p.credits { font-style: italic ; font-size: smaller } p.label { white-space: nowrap } p.rubric { font-weight: bold ; font-size: larger ; color: maroon ; text-align: center } p.sidebar-title { font-family: sans-serif ; font-weight: bold ; font-size: larger } p.sidebar-subtitle { font-family: sans-serif ; font-weight: bold } p.topic-title { font-weight: bold } pre.address { m ``` -------------------------------- ### Docutils HTML CSS Styling Source: https://github.com/oca/ddmrp/blob/18.0/ddmrp_adjustment/static/description/index.html This CSS file provides default styling for HTML output generated by Docutils. It covers a wide range of elements including tables, borders, typography, and specific Docutils components like admonitions and system messages. It aims for broad compatibility while using some CSS2 features. ```css /* :Author: David Goodger (goodger@python.org) :Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. */ /* used to remove borders from tables and images */ .borderless, table.borderless td, table.borderless th { border: 0 } table.borderless td, table.borderless th { /* Override padding for "table.docutils td" with "! important". The right padding separates the table cells. */ padding: 0 0.5em 0 0 ! important } .first { /* Override more specific margin styles with "! important". */ margin-top: 0 ! important } .last, .with-subtitle { margin-bottom: 0 ! important } .hidden { display: none } .subscript { vertical-align: sub; font-size: smaller } .superscript { vertical-align: super; font-size: smaller } a.toc-backref { text-decoration: none ; color: black } blockquote.epigraph { margin: 2em 5em ; } dl.docutils dd { margin-bottom: 0.5em } object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { overflow: hidden; } /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } */ div.abstract { margin: 2em 5em } div.abstract p.topic-title { font-weight: bold ; text-align: center } div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { margin: 2em ; border: medium outset ; padding: 1em } div.admonition p.admonition-title, div.hint p.admonition-title, div.important p.admonition-title, div.note p.admonition-title, div.tip p.admonition-title { font-weight: bold ; font-family: sans-serif } div.attention p.admonition-title, div.caution p.admonition-title, div.danger p.admonition-title, div.error p.admonition-title, div.warning p.admonition-title, .code .error { color: red ; font-weight: bold ; font-family: sans-serif } /* Uncomment (and remove this text!) to get reduced vertical space in compound paragraphs. div.compound .compound-first, div.compound .compound-middle { margin-bottom: 0.5em } div.compound .compound-last, div.compound .compound-middle { margin-top: 0.5em } */ div.dedication { margin: 2em 5em ; text-align: center ; font-style: italic } div.dedication p.topic-title { font-weight: bold ; font-style: normal } div.figure { margin-left: 2em ; margin-right: 2em } div.footer, div.header { clear: both; font-size: smaller } div.line-block { display: block ; margin-top: 1em ; margin-bottom: 1em } div.line-block div.line-block { margin-top: 0 ; margin-bottom: 0 ; margin-left: 1.5em } div.sidebar { margin: 0 0 0.5em 1em ; border: medium outset ; padding: 1em ; background-color: #ffffee ; width: 40% ; float: right ; clear: right } div.sidebar p.rubric { font-family: sans-serif ; font-size: medium } div.system-messages { margin: 5em } div.system-messages h1 { color: red } div.system-message { border: medium outset ; padding: 1em } div.system-message p.system-message-title { color: red ; font-weight: bold } div.topic { margin: 2em } h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { margin-top: 0.4em } h1.title { text-align: center } h2.subtitle { text-align: center } hr.docutils { width: 75% } img.align-left, .figure.align-left, object.align-left, table.align-left { clear: left ; float: left ; margin-right: 1em } img.align-right, .figure.align-right, object.align-right, table.align-right { clear: right ; float: right ; margin-left: 1em } img.align-center, .figure.align-center, object.align-center { display: block; margin-left: auto; margin-right: auto; } table.align-center { margin-left: auto; margin-right: auto; } .align-left { text-align: left } .align-center { clear: both ; text-align: center } .align-right { text-align: right } /* reset inner alignment in figures */ div.align-right { text-align: inherit } /* div.align-center * { text-align: left }*/ .align-top { vertical-align: top } .align-middle { vertical-align: middle } .align-bottom { vertical-align: bottom } ol.simple, ul.simple { margin-bottom: 1em } ol.arabic { list-style: decimal } ol.loweralpha { list-style: lower-alpha } ol.upperalpha { list-style: upper-alpha } ol.lowerroman { list-style: lower-roman } ol.upperroman { list-style: upper-roman } p.attribution { text-align: right ; margin-left: 50% } p.caption { font-style: italic } p.credits { font-style: italic ; font-size: smaller } p.label { white-space: nowrap } p.rubric { font-weight: bold ; font-size: larger ; color: maroon ; text-align: center } p.sidebar-title { font-family: sans-serif ; font-weight: bold ; font-size: larger } p.sidebar-subtitle { font-family: sans-serif ; font-weight: bold } p.topic-title { font-weight: bold } pre.address { margin: 0 ``` -------------------------------- ### CSS Styling for Docutils HTML Output Source: https://github.com/oca/ddmrp/blob/18.0/ddmrp_exclude_moves_adu_calc/static/description/index.html This CSS stylesheet is used by the Docutils project to format HTML output. It provides styles for various elements such as tables, images, admonitions, and structural components to ensure a consistent and readable presentation. The stylesheet uses standard CSS properties and is designed to be customizable. ```css /* :Author: David Goodger (goodger@python.org) :Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. */ /* used to remove borders from tables and images */ .borderless, table.borderless td, table.borderless th { border: 0 } table.borderless td, table.borderless th { /* Override padding for "table.docutils td" with "! important". The right padding separates the table cells. */ padding: 0 0.5em 0 0 ! important } .first { /* Override more specific margin styles with "! important". */ margin-top: 0 ! important } .last, .with-subtitle { margin-bottom: 0 ! important } .hidden { display: none } .subscript { vertical-align: sub; font-size: smaller } .superscript { vertical-align: super; font-size: smaller } a.toc-backref { text-decoration: none ; color: black } blockquote.epigraph { margin: 2em 5em ; } dl.docutils dd { margin-bottom: 0.5em } object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { overflow: hidden; } /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } */ div.abstract { margin: 2em 5em } div.abstract p.topic-title { font-weight: bold ; text-align: center } div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { margin: 2em ; border: medium outset ; padding: 1em } div.admonition p.admonition-title, div.hint p.admonition-title, div.important p.admonition-title, div.note p.admonition-title, div.tip p.admonition-title { font-weight: bold ; font-family: sans-serif } div.attention p.admonition-title, div.caution p.admonition-title, div.danger p.admonition-title, div.error p.admonition-title, div.warning p.admonition-title, .code .error { color: red ; font-weight: bold ; font-family: sans-serif } /* Uncomment (and remove this text!) to get reduced vertical space in compound paragraphs. div.compound .compound-first, div.compound .compound-middle { margin-bottom: 0.5em } div.compound .compound-last, div.compound .compound-middle { margin-top: 0.5em } */ div.dedication { margin: 2em 5em ; text-align: center ; font-style: italic } div.dedication p.topic-title { font-weight: bold ; font-style: normal } div.figure { margin-left: 2em ; margin-right: 2em } div.footer, div.header { clear: both; font-size: smaller } div.line-block { display: block ; margin-top: 1em ; margin-bottom: 1em } div.line-block div.line-block { margin-top: 0 ; margin-bottom: 0 ; margin-left: 1.5em } div.sidebar { margin: 0 0 0.5em 1em ; border: medium outset ; padding: 1em ; background-color: #ffffee ; width: 40% ; float: right ; clear: right } div.sidebar p.rubric { font-family: sans-serif ; font-size: medium } div.system-messages { margin: 5em } div.system-messages h1 { color: red } div.system-message { border: medium outset ; padding: 1em } div.system-message p.system-message-title { color: red ; font-weight: bold } div.topic { margin: 2em } h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { margin-top: 0.4em } h1.title { text-align: center } h2.subtitle { text-align: center } hr.docutils { width: 75% } img.align-left, .figure.align-left, object.align-left, table.align-left { clear: left ; float: left ; margin-right: 1em } img.align-right, .figure.align-right, object.align-right, table.align-right { clear: right ; float: right ; margin-left: 1em } img.align-center, .figure.align-center, object.align-center { display: block; margin-left: auto; margin-right: auto; } table.align-center { margin-left: auto; margin-right: auto; } .align-left { text-align: left } .align-center { clear: both ; text-align: center } .align-right { text-align: right } /* reset inner alignment in figures */ div.align-right { text-align: inherit } /* div.align-center * { text-align: left } */ .align-top { vertical-align: top } .align-middle { vertical-align: middle } .align-bottom { vertical-align: bottom } ol.simple, ul.simple { margin-bottom: 1em } ol.arabic { list-style: decimal } ol.loweralpha { list-style: lower-alpha } ol.upperalpha { list-style: upper-alpha } ol.lowerroman { list-style: lower-roman } ol.upperroman { list-style: upper-roman } p.attribution { text-align: right ; margin-left: 50% } p.caption { font-style: italic } p.credits { font-style: italic ; font-size: smaller } p.label { white-space: nowrap } p.rubric { font-weight: bold ; font-size: larger ; color: maroon ; text-align: center } p.sidebar-title { font-family: sans-serif ; font-weight: bold ; font-size: larger } p.sidebar-subtitle { font-family: sans-serif ; font-weight: bold } p.topic-title { font-weight: bold } pre.address { m ``` -------------------------------- ### Define Admonition and Sidebar Styling Source: https://github.com/oca/ddmrp/blob/18.0/ddmrp_cron_actions_as_job/static/description/index.html These CSS rules define the visual appearance of special content blocks like admonitions, warnings, and sidebars. They use distinct borders, padding, and colors to highlight specific information types. ```css div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { margin: 2em ; border: medium outset ; padding: 1em } div.sidebar { margin: 0 0 0.5em 1em ; border: medium outset ; padding: 1em ; background-color: #ffffee ; width: 40% ; float: right ; clear: right } ``` -------------------------------- ### CSS: Document Title and Subtitle Alignment Source: https://github.com/oca/ddmrp/blob/18.0/ddmrp_product_replace/static/description/index.html These rules center-align the main document title and subtitle, ensuring a prominent and centered presentation at the beginning of the document. ```css h1.title { text-align: center } h2.subtitle { text-align: center } ```