Dtg base

From unclecatvn/agent-skills · View interactive version

Dtg base is an AI agent skill from the GitHub repository unclecatvn/agent-skills. Complete reference for DTG Base module utilities and helpers. DTGBase is an abstract model providing common utility methods for date/time handling, barcode generation, timezone conversion, file operations, and more.

How to use this skill

Skill file

DTG Base Skill

Complete reference for DTG Base module utilities and helpers in Odoo 18.

What is DTG Base?

DTG Base is a custom abstract model (dtg_base.DTGBase) that provides common utility methods for Odoo development. It's designed to be inherited by other models to gain access to helpful utilities.

Quick Reference

| Utility | Description |

|---------|-------------|

| Date & Period | Find first/last date of period, period iteration |

| Timezone | Convert local to UTC, UTC to local |

| Barcode | Check barcode exists, generate EAN13 |

| Batch Processing | Split large recordsets into batches |

| after_commit | Execute code after transaction commit |

| Vietnamese Text | Strip accents, convert to non-accent |

| File Utilities | Zip directories, get file size |

| Number Utilities | Round to decimal places |


Main Guide

File: odoo-18-dtg-base-guide.md

When to use this skill


DTGBase Abstract Model

Inherit from DTGBase

Location: addons_customs/erp/dtg_base/models/dtg_base.py

from odoo import models

class MyModel(models.Model):
    _name = 'my.model'
    _inherit = ['dtg_base.dtg_base']

    def my_method(self):
        # Now you have access to all DTGBase utilities
        first_date = self.find_first_date_of_period('2024-01-15', 'month')
        utc_date = self.convert_local_to_utc('2024-01-15 10:00:00')

File Structure

agent-skills/skills/dtg-base/
├── SKILL.md                       # This file - master index
├── odoo-18-dtg-base-guide.md      # Complete DTG Base utilities reference
└── README.md                      # Skill overview

Utilities Overview

Date & Period Utilities

Timezone Conversion

Barcode Utilities

Batch Processing

String & Text Utilities

File Utilities

Number Utilities


For detailed documentation, see odoo-18-dtg-base-guide.md

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.