Loading...
Loading...
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.
npx skill4agent add unclecatvn/agent-skills dtg-basedtg_base.DTGBase| 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 |
odoo-18-dtg-base-guide.mdaddons_customs/erp/dtg_base/models/dtg_base.pyfrom 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')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 overviewfind_first_date_of_period(date, period_type)find_last_date_of_period(date, period_type)period_iter(start_date, end_date, period_type)convert_local_to_utc(local_dt, tz=None)convert_utc_to_local(utc_dt, tz=None)barcode_exists(barcode, exclude_id=0)get_ean13 barcode)splittor(limit=None)strip_accents(text)_no_accent_vietnamese(text)zip_dir(source_dir, output_file)zip_dirs(dirs, output_file)_get_file_size(file_path)round_decimal(value, decimal_places)