build: configurar herramientas de verificación OCA
- Instalar pre-commit con 25 hooks configurados - Configurar black 26.1.0 para formateo de código Python - Configurar isort 7.0.0 para ordenación de imports - Configurar flake8 7.3.0 con flake8-bugbear - Configurar pylint 3.1.1 con pylint-odoo 9.1.2 - Añadir autoflake y pyupgrade para mejoras automáticas - Configurar prettier para formateo de XML/JSON/YAML - Crear .editorconfig para consistencia de editor - Crear Makefile con comandos útiles - Crear check_addon.sh para verificación rápida de addons - Actualizar configuración de VS Code con extensiones recomendadas - Añadir documentación completa de uso - Aplicar formateo automático a archivos existentes - Deshabilitar setuptools-odoo (no soporta Odoo 18.0 aún) - Deshabilitar fix-encoding-pragma (obsoleto, usar pyupgrade)
This commit is contained in:
parent
5b9c6e3211
commit
fe137dc265
224 changed files with 18376 additions and 0 deletions
13
product_get_price_helper/utils.py
Normal file
13
product_get_price_helper/utils.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Copyright 2021 Camptocamp (http://www.camptocamp.com).
|
||||
# @author Simone Orsi <simahawk@gmail.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo.tools import float_repr
|
||||
|
||||
|
||||
def float_round(value, dp):
|
||||
# be carefull odoo rounding implementation do not return the shortest
|
||||
# representation of a float this mean if the price_unit is 211.70
|
||||
# you will have 211.70000000000002
|
||||
# Odony exemple: https://gist.github.com/odony/5269a695545902e7e23e761e20a9ec8c
|
||||
return float(float_repr(value, dp))
|
||||
Loading…
Add table
Add a link
Reference in a new issue