### Integrate with SII for Real-time VAT Reporting (Python) Source: https://context7.com/oca/l10n-spain/llms.txt This Python code illustrates how to integrate with the Spanish Tax Agency's SII (Immediate Supply of Information) system using Odoo. It covers automatic invoice submission upon posting, checking submission status, manual batch processing, cancelling registrations, and configuring company settings for SII. ```python # Automatic SII submission is triggered on invoice posting invoice = env['account.move'].create({ 'move_type': 'out_invoice', 'partner_id': partner.id, 'invoice_line_ids': [(0, 0, { 'name': 'Professional Services', 'quantity': 1, 'price_unit': 1000.00, 'tax_ids': [(6, 0, [vat_21_tax.id])], })], }) # When invoice is posted, SII submission is automatic (if auto mode enabled) invoice.action_post() # invoice.aeat_state will be 'sent' or 'sent_w_errors' # Check SII submission status print(f"SII State: {invoice.aeat_state}") print(f"SII CSV: {invoice.sii_csv}") # AEAT confirmation code print(f"SII Return: {invoice.sii_return}") # Full response # Manual SII submission for batch processing invoices_to_send = env['account.move'].search([ ('state', '=', 'posted'), ('aeat_state', '=', 'not_sent'), ('sii_enabled', '=', True), ]) invoices_to_send._process_sii_send() # Cancel SII registration for cancelled invoices cancelled_invoice.cancel_sii() # Configure company for SII company = env.company company.write({ 'sii_enabled': True, 'sii_method': 'auto', # 'auto', 'manual', or 'delayed' 'sii_start_date': '2024-01-01', 'sii_description_method': 'auto', # 'auto', 'fixed', or 'manual' }) ``` -------------------------------- ### Configure and Use Redsys Payment Provider (Python) Source: https://context7.com/oca/l10n-spain/llms.txt Configures the Redsys payment provider for online transactions, including setting up merchant details and API keys. It also prepares payment parameters, generates signatures, and defines form data for submitting payments to Redsys. Supports card payments, bank transfers, and Bizum. ```python # Configure Redsys payment provider provider = env['payment.provider'].create({ 'name': 'Redsys', 'code': 'redsys', 'state': 'enabled', # 'enabled' for production, 'test' for sandbox 'redsys_merchant_name': 'My Company', 'redsys_merchant_code': '123456789', 'redsys_merchant_description': 'Online Store Payment', 'redsys_secret_key': 'your-secret-key-here', 'redsys_terminal': '1', 'redsys_currency': '978', # EUR 'redsys_transaction_type': '0', 'redsys_merchant_lang': '001', # Spanish 'redsys_pay_method': 'T', # T=Card, R=Transfer, D=Direct Debit, z=Bizum }) # Prepare payment parameters for form submission tx_values = { 'amount': 150.00, 'reference': 'SO00123', 'billing_partner': partner, } # Get merchant parameters (base64 encoded JSON) merchant_params = provider._prepare_merchant_parameters(tx_values) # Sign parameters for secure submission signature = provider.sign_parameters( provider.redsys_secret_key, merchant_params ) # Payment form data for HTML submission form_data = { 'Ds_SignatureVersion': provider.redsys_signature_version, 'Ds_MerchantParameters': merchant_params, 'Ds_Signature': signature, } # API endpoints production_url = 'https://sis.redsys.es/sis/realizarPago/' test_url = 'https://sis-t.redsys.es:25443/sis/realizarPago/' ``` -------------------------------- ### Create and Calculate VAT Book Report (Python) Source: https://context7.com/oca/l10n-spain/llms.txt This snippet demonstrates how to create a VAT book report, calculate its entries, and access details for issued and received invoices. It also shows how to export the report to an Excel file. This functionality is part of the l10n-spain localization package. ```python vat_book = env['l10n.es.vat.book'].create({ 'company_id': env.company.id, 'year': 2024, 'period_type': '1T', # First quarter 'date_start': '2024-01-01', 'date_end': '2024-03-31', }) vat_book.button_calculate() # Access issued invoices book for line in vat_book.issued_line_ids: print(f"Invoice: {line.invoice_id.name}") print(f"Partner: {line.partner_id.name}") print(f"Base: {line.base_amount}") print(f"VAT: {line.tax_amount}") # Access received invoices book for line in vat_book.received_line_ids: print(f"Invoice: {line.ref}") print(f"Supplier: {line.partner_id.name}") print(f"Base: {line.base_amount}") # Export to Excel vat_book.export_xlsx() # Downloads Excel file with formatted VAT book ``` -------------------------------- ### Generate Facturae XML and Submit via FACe (Python) Source: https://context7.com/oca/l10n-spain/llms.txt Generates Facturae XML content for an invoice and provides methods to submit it via the FACe platform. Requires the 'l10n_es_facturae' module for XML generation and optionally 'l10n_es_facturae_face' for FACe submission. ```python facturae_report = env.ref('l10n_es_facturae.report_facturae') xml_content, content_type = facturae_report._render(invoice.ids) invoice.send_facturae_face() print(f"FACe Number: {invoice.face_number}") print(f"FACe State: {invoice.face_state}") ``` -------------------------------- ### Generate Facturae Electronic Invoices (Python) Source: https://context7.com/oca/l10n-spain/llms.txt This Python code demonstrates how to generate Facturae compliant XML electronic invoices for submission to Spanish public administrations. It covers configuring partners with Facturae details, creating invoices with specific Facturae fields, and validating the invoice before generation. ```python # Configure partner for Facturae partner = env['res.partner'].browse(partner_id) partner.write({ 'facturae': True, 'facturae_version': '3_2_2', # '3_2', '3_2_1', or '3_2_2' 'organo_gestor': 'P00000010', 'unidad_tramitadora': 'P00000010', 'oficina_contable': 'P00000010', 'attach_invoice_as_annex': True, }) # Create invoice with Facturae fields invoice = env['account.move'].create({ 'move_type': 'out_invoice', 'partner_id': partner.id, 'payment_mode_id': payment_mode.id, 'facturae_start_date': '2024-01-01', 'facturae_end_date': '2024-01-31', 'invoice_line_ids': [(0, 0, { 'name': 'Consulting Services', 'quantity': 10, 'price_unit': 150.00, 'tax_ids': [(6, 0, [vat_21_tax.id])], })], }) invoice.action_post() # Validate Facturae requirements before generation invoice.validate_facturae_fields() ``` -------------------------------- ### Configure and Use GLS ASM Delivery Carrier (Python) Source: https://context7.com/oca/l10n-spain/llms.txt This code demonstrates the integration with GLS Spain (formerly ASM) for shipping services. It covers configuring the carrier with API credentials, sending shipments by referencing a stock picking, updating shipment status via tracking, canceling shipments, and generating manifests. This integration facilitates parcel delivery management within Odoo. ```python # Configure GLS ASM carrier carrier = env['delivery.carrier'].create({ 'name': 'GLS Spain', 'delivery_type': 'gls_asm', 'gls_asm_uid': 'user_id', 'gls_asm_password': 'password', 'gls_asm_service': '1', # Service type 'gls_asm_horario': 'H', # Schedule type }) # Send shipment picking = env['stock.picking'].browse(picking_id) result = carrier.gls_asm_send_shipping(picking) # Track shipment status carrier.gls_asm_tracking_state_update(picking) # Cancel shipment carrier.gls_asm_cancel_shipment(picking) # Generate manifest carrier.action_open_manifest() # Opens manifest wizard ``` -------------------------------- ### Line Block and Sidebar Styling (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_partner_mercantil/static/description/index.html Styles for line blocks, controlling their display and margins, and for sidebar elements, including borders, padding, background color, width, and float. ```CSS 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 } ``` -------------------------------- ### Import Bank Statement in N43 Format (Python) Source: https://context7.com/oca/l10n-spain/llms.txt This code snippet shows how to import bank statements using the Spanish Norma 43 (N43) format. It involves reading the N43 file, encoding its content, and using a wizard to process the import, which then creates bank statement records with parsed transactions. The module supports multiple accounts, Spanish date formats, concept codes, and auto-detects encoding. ```python # Import N43 bank statement file import base64 # Read N43 file content with open('/path/to/statement.n43', 'rb') as f: n43_content = base64.b64encode(f.read()) # Create import wizard wizard = env['account.statement.import'].create({ 'statement_file': n43_content, 'statement_filename': 'statement.n43', }) # Process import wizard.import_file() # Creates bank statement with parsed transactions ``` -------------------------------- ### Definition List Term Styling (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_account_statement_import_n43/static/description/index.html Optional CSS rule to make definition list terms bold. This improves readability by visually separating terms from their descriptions. Uncomment to enable. ```css /* Uncomment (and remove this text!) to get bold-faced definition list terms */ dl.docutils dt { font-weight: bold } ``` -------------------------------- ### Search Spanish Provinces (Python) Source: https://context7.com/oca/l10n-spain/llms.txt This Python snippet shows how to retrieve a list of Spanish provinces using the `res.country.state` model. It filters records by the country ID for Spain and iterates through the results to print the province code and name. Common province references like Madrid, Barcelona, and Valencia are also demonstrated. ```python # Install module and load data # Provinces are loaded as res.country.state records # Search Spanish provinces provinces = env['res.country.state'].search([ ('country_id', '=', env.ref('base.es').id) ]) for province in provinces: print(f"{province.code}: {province.name}") # Common province references: madrid = env.ref('base.state_es_m') # Madrid barcelona = env.ref('base.state_es_b') # Barcelona valencia = env.ref('base.state_es_v') # Valencia ``` -------------------------------- ### CSS: Topic Title Styling Source: https://github.com/oca/l10n-spain/blob/18.0/account_promissory_note_caixabank/static/description/index.html Sets a bold font-weight for topic titles, making them stand out. ```css p.topic-title { font-weight: bold } ``` -------------------------------- ### Create AEAT Model 303 VAT Declaration (Python) Source: https://context7.com/oca/l10n-spain/llms.txt This Python code illustrates the creation and calculation of the AEAT Model 303, a quarterly/monthly VAT self-assessment declaration for Spain. It allows setting declaration parameters, calculating values from invoices and tax lines, and accessing key computed fields like output VAT, deductible VAT, and the final result. The snippet also mentions specific boxes for detailed reporting and the option to export to BOE format. ```python # Create Model 303 declaration mod303 = env['l10n.es.aeat.mod303'].create({ 'company_id': env.company.id, 'year': 2024, 'period_type': '1T', # 1T, 2T, 3T, 4T for quarterly 'statement_type': 'N', # N=Normal, C=Complementary, S=Substitutive 'contact_name': 'Tax Contact', 'contact_phone': '912345678', }) # Calculate from invoices and tax lines mod303.button_calculate() # Key computed fields after calculation: print(f"VAT Output (Base): {mod303.total_devengado}") print(f"VAT Input (Deductible): {mod303.total_deducir}") print(f"Difference: {mod303.diferencia}") print(f"Result (To Pay/Refund): {mod303.resultado}") # Specific boxes available: # casilla_01 - Base imponible al 21% # casilla_02 - Cuota al 21% # casilla_03 - Base imponible al 10% # casilla_04 - Cuota al 10% # casilla_07 - Base imponible al 4% # casilla_08 - Cuota al 4% # ... and many more # Export to BOE format mod303.button_export() ``` -------------------------------- ### CSS: Topic Styling Source: https://github.com/oca/l10n-spain/blob/18.0/account_promissory_note_caixabank/static/description/index.html Basic styling for generic topic elements, applying a default margin for spacing. ```css div.topic { margin: 2em } ``` -------------------------------- ### Extend Partner Records with Spanish Fields (Python) Source: https://context7.com/oca/l10n-spain/llms.txt Enhances the 'res.partner' model with Spanish-specific fields such as trade names ('comercial'), and mercantile registry details. It also covers configuring display name patterns and searching partners by commercial name. ```python # Create partner with Spanish fields partner = env['res.partner'].create({ 'name': 'Empresa Ejemplo S.L.', 'comercial': 'Ejemplo', # Trade name 'vat': 'ESB12345678', 'street': 'Calle Mayor 123', 'city': 'Madrid', 'zip': '28001', 'state_id': env.ref('base.state_es_m').id, # Madrid 'country_id': env.ref('base.es').id, }) # Configure display name pattern (system parameter) env['ir.config_parameter'].set_param( 'l10n_es_partner.name_pattern', '%(name)s (%(comercial_name)s)' ) # Search by commercial name partners = env['res.partner'].name_search('Ejemplo') # Finds partners by name, complete_name, or comercial fields # With l10n_es_partner_mercantil module - Mercantile Registry data partner.write({ 'registry_office': 'Registro Mercantil de Madrid', 'registry_volume': '12345', 'registry_book': '0', 'registry_section': '8', 'registry_sheet': 'M-123456', 'registry_inscription': '1', }) ``` -------------------------------- ### Abstract and Topic Title Styling (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_partner_mercantil/static/description/index.html Styles for abstract sections and topic titles within abstracts. It sets margins for the abstract div and defines bold, centered text for the topic title. ```CSS div.abstract { margin: 2em 5em } div.abstract p.topic-title { font-weight: bold ; text-align: center } ``` -------------------------------- ### CSS: Address Styling for Preformatted Text Source: https://github.com/oca/l10n-spain/blob/18.0/account_promissory_note_caixabank/static/description/index.html Applies default margin settings for preformatted address blocks. ```css pre.address { m ``` -------------------------------- ### CSS: Definition List Term Styling (Commented Out) Source: https://github.com/oca/l10n-spain/blob/18.0/account_promissory_note_caixabank/static/description/index.html A commented-out CSS rule that would make definition list terms bold. This is provided as an option for users to uncomment if they prefer this styling. ```css /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } */ ``` -------------------------------- ### Address Preformatted Text Styling (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_sii_oca/static/description/index.html Applies margin settings to preformatted address text, ensuring consistent spacing. ```css pre.address { margin: 0 ``` -------------------------------- ### CSS: Simple List Styling Source: https://github.com/oca/l10n-spain/blob/18.0/account_promissory_note_caixabank/static/description/index.html Default styling for simple ordered and unordered lists, setting a bottom margin for spacing. ```css ol.simple, ul.simple { margin-bottom: 1em } ``` -------------------------------- ### Validate Partner VAT with AEAT (Python) Source: https://context7.com/oca/l10n-spain/llms.txt This code snippet demonstrates how to validate Spanish VAT numbers against the AEAT census database. It shows how to check a single partner's VAT validity and how to perform a batch validation for multiple partners. The `check_vat_aeat()` method returns a boolean indicating the validity of the VAT number. ```python # Check partner VAT validity with AEAT partner = env['res.partner'].browse(partner_id) # Validate VAT number result = partner.check_vat_aeat() # Returns True if VAT is valid in AEAT census # Batch validation partners = env['res.partner'].search([ ('country_id', '=', env.ref('base.es').id), ('vat', '!=', False), ]) partners.check_vat_aeat() ``` -------------------------------- ### Generate and Process AEAT Tax Reports (Python) Source: https://context7.com/oca/l10n-spain/llms.txt This snippet demonstrates how to create, calculate, confirm, and export AEAT tax reports (e.g., Model 303) using Odoo's l10n_es_aeat module. It covers report creation with specific period and type, calculation from invoices, confirmation, and BOE file export. ```python from odoo import fields class L10nEsAeatMod303(models.Model): _name = "l10n.es.aeat.mod303" _inherit = "l10n.es.aeat.report" _description = "AEAT Model 303 Report" _aeat_number = "303" _period_quarterly = True _period_monthly = True # Create a new VAT declaration (Model 303) report = env['l10n.es.aeat.mod303'].create({ 'company_id': env.company.id, 'company_vat': 'B12345678', 'year': 2024, 'period_type': '1T', # First quarter 'statement_type': 'N', # Normal declaration 'contact_name': 'John Doe', 'contact_phone': '912345678', }) # Calculate the report values from invoices report.button_calculate() # State changes to 'calculated' # Confirm the report report.button_confirm() # State changes to 'done' # Export to BOE format for submission report.button_export() # Generates the official BOE file format # Post accounting entries if applicable report.button_post() # Creates regularization journal entries ``` -------------------------------- ### Margin and Display Styling (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_partner_mercantil/static/description/index.html These CSS rules manage margins for elements like the first/last items in a list or those with subtitles, ensuring proper spacing. It also defines styles for hidden elements. ```CSS .first { margin-top: 0 ! important } .last, .with-subtitle { margin-bottom: 0 ! important } .hidden { display: none } ``` -------------------------------- ### CSS: Abstract and Topic Styling Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_toponyms/static/description/index.html Styles the abstract section with margins and centers the topic title. Also styles various admonition boxes (note, warning, etc.) with borders and padding. ```css 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 } ``` -------------------------------- ### CSS: Styling for Individual System Messages Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod390/static/description/index.html Styles individual system message blocks, including their border, padding, and the styling of their titles, which are typically red and bold. ```css div.system-message { border: medium outset ; padding: 1em } div.system-message p.system-message-title { color: red ; font-weight: bold } ``` -------------------------------- ### CSS: Lists and Attributions Source: https://github.com/oca/l10n-spain/blob/18.0/delivery_gls_asm/static/description/index.html Styles for ordered and unordered lists, including specific list style types. It also styles attributions, captions, credits, labels, rubrics, and topic titles. ```css 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 } ``` -------------------------------- ### CSS: Blockquote and Definition List Styling Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_intrastat_report/static/description/index.html This CSS snippet styles blockquotes and definition lists. It sets margins for epigraph blockquotes and bottom margins for definition list descriptions. It also includes commented-out CSS for making definition list terms bold. ```css blockquote.epigraph { margin: 2em 5em ; } dl.docutils dd { margin-bottom: 0.5em } /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } */ ``` -------------------------------- ### CSS: Credits and Label Styling Source: https://github.com/oca/l10n-spain/blob/18.0/account_promissory_note_caixabank/static/description/index.html Styles for credits (often italicized and smaller) and labels (preserving whitespace). ```css p.credits { font-style: italic ; font-size: smaller } p.label { white-space: nowrap } ``` -------------------------------- ### CSS: Title and Subtitle Alignment Source: https://github.com/oca/l10n-spain/blob/18.0/account_promissory_note_caixabank/static/description/index.html Styles for main titles and subtitles, centering them on the page. This is common for document or report headings. ```css h1.title { text-align: center } h2.subtitle { text-align: center } ``` -------------------------------- ### Definition Term Styling (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_partner_mercantil/static/description/index.html This commented-out CSS rule provides an option to make definition list terms (dt) bold. It's currently inactive but can be enabled by uncommenting. ```CSS /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } */ ``` -------------------------------- ### Style Definition List Descriptions (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/delivery_dhl_parcel/static/description/index.html Sets the bottom margin for description list items ('dd') within definition lists ('dl.docutils'). This ensures consistent spacing between definition terms and their descriptions. ```css dl.docutils dd { margin-bottom: 0.5em } ``` -------------------------------- ### CSS: Styling for Sidebar Titles and Subtitles Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod390/static/description/index.html Defines styles for sidebar titles and subtitles, using sans-serif font and bold weight. ```css p.sidebar-title { font-family: sans-serif ; font-weight: bold ; font-size: larger } p.sidebar-subtitle { font-family: sans-serif ; font-weight: bold } ``` -------------------------------- ### CSS: Styling for System Messages Container Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod390/static/description/index.html Styles the main container for system messages, setting margins and the color of the main heading. ```css div.system-messages { margin: 5em } div.system-messages h1 { color: red } ``` -------------------------------- ### Alignment Styling for Images, Figures, Objects, and Tables (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_partner_mercantil/static/description/index.html This CSS defines how elements like images, figures, objects, and tables are aligned (left, right, center). It uses float and clear properties for left/right alignment and margin auto for centering. ```CSS 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; } ``` -------------------------------- ### Configure and Use DHL Parcel Delivery Carrier (Python) Source: https://context7.com/oca/l10n-spain/llms.txt Integrates with the DHL Parcel Spain API for managing shipments. This includes configuring carrier details, sending shipments, retrieving tracking information and labels, updating tracking states, canceling shipments, and performing end-of-day processing. ```python # Configure DHL Parcel carrier carrier = env['delivery.carrier'].create({ 'name': 'DHL Parcel Spain', 'delivery_type': 'dhl_parcel', 'dhl_parcel_customer_code': 'CUSTOMER123', 'dhl_parcel_uid': 'api_user', 'dhl_parcel_password': 'api_password', 'dhl_parcel_incoterm': 'CPT', # CPT=paid, EXW=owed 'dhl_parcel_product': 'B2B', # B2B or B2C 'dhl_parcel_label_format': 'PDF', # PDF, ZPL, or EPL 'dhl_parcel_cash_on_delivery': False, }) # Send shipment and get tracking picking = env['stock.picking'].browse(picking_id) result = carrier.dhl_parcel_send_shipping(picking) # Returns: [{'tracking_number': 'JJD000123456789', 'exact_price': 0}] # Get tracking URL for customer tracking_url = carrier.dhl_parcel_get_tracking_link(picking) # Returns: https://clientesparcel.dhl.es/seguimientoenvios/... # Update tracking state from DHL carrier.dhl_parcel_tracking_state_update(picking) print(f"State: {picking.tracking_state}") print(f"History: {picking.tracking_state_history}") print(f"Delivery State: {picking.delivery_state}") # Get shipping label label_base64 = carrier.dhl_parcel_get_label(picking.carrier_tracking_ref) # Cancel shipment carrier.dhl_parcel_cancel_shipment(picking) # Hold/Release shipment carrier.dhl_parcel_hold_shipment(picking.carrier_tracking_ref) carrier.dhl_parcel_release_shipment(picking.carrier_tracking_ref) # End of day processing carrier.action_open_end_day() # Opens wizard ``` -------------------------------- ### CSS: Styling for Document Title and Subtitle Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod390/static/description/index.html Centers the main document title and subtitle for a standard document presentation. ```css h1.title { text-align: center } h2.subtitle { text-align: center } ``` -------------------------------- ### Preformatted Text Styling (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_partner_mercantil/static/description/index.html This CSS rule targets preformatted text, specifically for addresses, likely to ensure consistent display and spacing. ```CSS pre.addr ``` -------------------------------- ### CSS: Attribution, Caption, Credits, and Label Styling Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod303_vat_prorate/static/description/index.html Styles for various text elements like attributions (right-aligned), captions (italic), credits (italic, smaller font), and labels (no wrapping). ```css 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 } ``` -------------------------------- ### CSS: Admonition and System Message Styling Source: https://github.com/oca/l10n-spain/blob/18.0/account_promissory_note_caixabank/static/description/index.html Defines styles for various admonition types (note, warning, etc.) and system messages. These include borders, padding, and specific font styles for titles. ```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.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 } ``` -------------------------------- ### Style Document Titles (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/delivery_dhl_parcel/static/description/index.html Styles the main document title (h1) and subtitle (h2) by centering them on the page. ```css h1.title { text-align: center } h2.subtitle { text-align: center } ``` -------------------------------- ### Style Definition List Terms (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/delivery_seur_atlas/static/description/index.html This commented-out CSS rule provides styling for definition list terms ('dl.docutils dt') to make them bold. Uncommenting this rule would apply bold formatting to the terms. ```css /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } */ ``` -------------------------------- ### Style Address Block (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/delivery_dhl_parcel/static/description/index.html Preserves the formatting of address blocks, ensuring that whitespace and line breaks are maintained as written. ```css pre.address { m ``` -------------------------------- ### Style Sidebar Titles and Subtitles (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_vat_book/static/description/index.html CSS for styling titles and subtitles within sidebars. It sets font family and weight for emphasis. ```css div.sidebar p.rubric { font-family: sans-serif ; font-size: medium } p.sidebar-title { font-family: sans-serif ; font-weight: bold ; font-size: larger } p.sidebar-subtitle { font-family: sans-serif ; font-weight: bold } ``` -------------------------------- ### CSS: Topic and Section Subtitle Styling Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod390_oss/static/description/index.html Styles for general topics and section subtitles. It sets margins for topics and adjusts the top margin for section subtitles to ensure proper spacing. ```css 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 } ``` -------------------------------- ### CSS: Spacing and Visibility Control Source: https://github.com/oca/l10n-spain/blob/18.0/account_promissory_note_caixabank/static/description/index.html Styles for controlling margins and visibility of elements. `.first` and `.last` classes manage top and bottom margins respectively, while `.hidden` completely hides elements. ```css .first { /* Override more specific margin styles with "! important". */ margin-top: 0 ! important } .last, .with-subtitle { margin-bottom: 0 ! important } .hidden { display: none } ``` -------------------------------- ### CSS: Epigraph and Definition List Styling Source: https://github.com/oca/l10n-spain/blob/18.0/account_promissory_note_caixabank/static/description/index.html Styles for blockquotes used as epigraphs and for definition lists. Epigraphs are indented, and definition list descriptions have adjusted bottom margins. ```css blockquote.epigraph { margin: 2em 5em ; } dl.docutils dd { margin-bottom: 0.5em } ``` -------------------------------- ### CSS: Styling for Definition List Terms (Optional) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod390/static/description/index.html This is a commented-out CSS rule that can be enabled to make definition list terms bold. It's currently inactive but demonstrates a styling option. ```css /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold }*/ ``` -------------------------------- ### Style Definition List Terms (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_vat_book/static/description/index.html CSS to make definition list terms (dt) bold. This is commented out by default but can be enabled to visually distinguish terms from their definitions. ```css /* Uncomment (and remove this text!) to get bold-faced definition list terms */ dl.docutils dt { font-weight: bold } ``` -------------------------------- ### CSS: Definition Lists and Objects Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_pos_sii/static/description/index.html Styles for definition lists ('dl.docutils') adjust bottom margin for descriptions. It also handles styling for SVG and Flash objects, ensuring they overflow correctly. A commented-out section shows how to make definition terms bold. ```css 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 } */ ``` -------------------------------- ### CSS: System Messages Styling Source: https://github.com/oca/l10n-spain/blob/18.0/account_promissory_note_caixabank/static/description/index.html Styles for system messages, including a red border and title color for emphasis. This helps to highlight important system-generated information. ```css 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 } ``` -------------------------------- ### CSS: Header, Footer, and Line Block Styling Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod216/static/description/index.html Defines styles for document headers and footers, ensuring they are cleared and have smaller font sizes. It also styles line blocks for preserving line breaks and indentation. ```css 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 } ``` -------------------------------- ### Styling for Definition Lists (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod130/static/description/index.html This CSS targets definition list descriptions ('dd') to control their bottom margin. It also includes a commented-out rule to make definition list terms ('dt') bold. ```css dl.docutils dd { margin-bottom: 0.5em } /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt */ /* dl.docutils dt { font-weight: bold } */ ``` -------------------------------- ### CSS: Alignment for Images, Figures, Objects, and Tables Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod390/static/description/index.html Provides styles for aligning images, figures, objects, and tables to the left or right, including clearing floats and setting margins. Also includes centering for images, figures, and objects. ```css 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; } ``` -------------------------------- ### CSS: Abstract and Admonition Styling Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_account_asset/static/description/index.html This CSS snippet styles abstract sections and various admonition boxes (note, warning, etc.). It sets margins, borders, and padding for these elements, and defines specific styles for admonition titles, including color for error messages. ```css 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 } ``` -------------------------------- ### Attribution, Caption, Credits, and Label Styling (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_atc/static/description/index.html Styles for various paragraph types. Attributions are right-aligned with an indent, captions are italicized, credits are smaller and italicized, and labels have nowrap. ```css 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 } ``` -------------------------------- ### CSS: Sidebar Title and System Message Styling Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_toponyms/static/description/index.html Styles titles and subtitles within sidebars. Also styles system message containers and their titles, highlighting errors in red. ```css 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 } ``` -------------------------------- ### CSS: Abstract, Dedication, and Figure Styling Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod216/static/description/index.html Styles for document sections like abstract, dedication, and figures. This includes setting margins, text alignment, font styles, and handling of embedded figures. ```css div.abstract { margin: 2em 5em } div.abstract p.topic-title { font-weight: bold ; text-align: center } 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 } ``` -------------------------------- ### CSS: List Styling and Attribution Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod216/static/description/index.html Styles for ordered and unordered lists, including different list style types (decimal, alpha, roman). It also styles paragraph attribution with right alignment and a left margin. ```css 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% } ``` -------------------------------- ### CSS: Styling for Simple Ordered and Unordered Lists Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod390/static/description/index.html Sets a bottom margin for simple ordered and unordered lists to ensure spacing. ```css ol.simple, ul.simple { margin-bottom: 1em } ``` -------------------------------- ### CSS: Header and Footer Styling Source: https://github.com/oca/l10n-spain/blob/18.0/account_promissory_note_caixabank/static/description/index.html Styles for page headers and footers. These elements are cleared to ensure they appear correctly and are styled with a smaller font size. ```css div.footer, div.header { clear: both; font-size: smaller } ``` -------------------------------- ### Style System Messages (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/delivery_dhl_parcel/static/description/index.html Styles system message sections, including margins, borders, padding, and colors for titles and messages. Error messages are highlighted in red. ```css 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 } ``` -------------------------------- ### CSS: Styling for Figures Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod390/static/description/index.html Sets margins for figure elements, providing consistent spacing around them. ```css div.figure { margin-left: 2em ; margin-right: 2em } ``` -------------------------------- ### Style Individual System Message Blocks (CSS) Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_cnae/static/description/index.html This CSS rule styles individual system message blocks ('div.system-message'). It applies a medium outset border and '1em' padding, visually separating each message. The title of a system message ('p.system-message-title') is styled in red and bold. ```css div.system-message { border: medium outset ; padding: 1em } div.system-message p.system-message-title { color: red ; font-weight: bold } ``` -------------------------------- ### CSS: Admonition and Related Block Styling Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_verifactu_oca/static/description/index.html This CSS styles various admonition blocks (note, warning, etc.) with a margin of 2em and an outset border. It also styles the titles of these blocks, making them bold and sans-serif. ```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.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 } ``` -------------------------------- ### CSS: Styling for Definition Lists and Abstract Sections Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_pos_oca/static/description/index.html This CSS provides styling for definition lists (dl.docutils) by adjusting the bottom margin for definition descriptions (dd). It also styles abstract sections (div.abstract), centering the topic title and setting margins. ```CSS 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 } ``` -------------------------------- ### CSS: Attribution, Caption, and Credits Styling Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod303/static/description/index.html Styles for attributions, captions, and credits. Attributions are right-aligned, captions are italicized, and credits are smaller and italicized. ```css p.attribution { text-align: right ; margin-left: 50% } p.caption { font-style: italic } p.credits { font-style: italic ; font-size: smaller } ``` -------------------------------- ### CSS: Document Title and Section Styling Source: https://github.com/oca/l10n-spain/blob/18.0/l10n_es_aeat_mod216/static/description/index.html Styles for document titles, subtitles, and section headings. This includes centering for titles and subtitles, and adjusting top margins for section subtitles. ```css h1.title { text-align: center } h2.subtitle { text-align: center } h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { margin-top: 0.4em } ```