1 Commits

Author SHA1 Message Date
7d081ee7c0 fix: Machete Calzabana 2025-07-27 00:13:08 -03:00
5 changed files with 173 additions and 88 deletions

View File

@@ -0,0 +1,28 @@
from trytond.pool import Pool
from . import (
product, sale, production, invoice, user, report_close_statement, report)
__all__ = ['register']
def register():
Pool.register(
product.Product,
invoice.InvoiceLine,
sale.Sale,
sale.Line,
sale.SaleLineDeletedLog,
user.User,
production.Production,
report_close_statement.ReportCloseStatementStart,
report.ReportSaleProduct,
report.ReportSaleByUser,
report.ReportSaleByZone,
report.ReportSaleContext,
module='sale_fast_food', type_='model')
Pool.register(
report_close_statement.PrintReportCloseStatement,
module='sale_fast_food', type_='wizard')
Pool.register(
report_close_statement.CashRegister,
module='sale_fast_food', type_='report')

View File

@@ -1,62 +0,0 @@
[build-system]
requires = ['hatchling >= 1', 'hatch-tryton']
build-backend = 'hatchling.build'
[project]
name = 'trytondo_sale_fast_food'
dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme']
requires-python = '>=3.10'
maintainers = [
{name = "OneCluster", email = "info@onecluster.org"},
]
description = "Fast food point of sale management (products, sales and closing reports)"
license = 'GPL-3.0-or-later'
license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT']
keywords = ["tryton", "sale", "point of sale", "fast food", "restaurant"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Plugins",
"Framework :: Tryton",
"Topic :: Office/Business",
"Topic :: Office/Business :: Financial :: Point-Of-Sale",
"Topic :: Software Development :: Libraries :: Python Modules",
]
[project.entry-points.'trytond.modules']
sale_fast_food = 'trytond.modules.sale_fast_food'
[project.urls]
homepage = "https://www.onecluster.org/"
documentation = "https://docs.tryton.org/"
forum = "https://www.tryton.org/forum"
issues = "https://bugs.tryton.org/tryton"
funding = "https://www.tryton.org/donate"
[tool.hatch.build]
include = [
'**/tryton.cfg',
'**/*.py',
'**/*.xml',
'view/**/*.xml',
'locale/**/*.po',
'**/*.fodt',
'icons/**/*.svg',
'tests/**/*.rst',
'tests/**/*.json',
]
exclude = ['doc']
[tool.hatch.build.targets.wheel.sources]
"" = "trytond/modules/sale_fast_food"
[tool.hatch.metadata.hooks.tryton]
dependencies = [
'python-sql >= 1.8',
'qrcode',
'requests',
]
copyright = 'COPYRIGHT'
readme = 'README.rst'
[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies]
test = ['proteus']

View File

@@ -151,8 +151,8 @@ class Sale(metaclass=PoolMeta):
invoice = record.invoices[0] invoice = record.invoices[0]
data = {} data = {}
data['invoice_number'] = invoice.number data['invoice_number'] = invoice.number
subtype = invoice.subtype #subtype = invoice.subtype
data['resolution'] = cls.get_invoice_resolution(subtype) #data['resolution'] = cls.get_invoice_resolution(subtype)
return data return data
@@ -171,8 +171,8 @@ class Sale(metaclass=PoolMeta):
data["shop_nit"] = shop.company.party.tax_identifier.code data["shop_nit"] = shop.company.party.tax_identifier.code
data["shop_address"] = shop.address.street data["shop_address"] = shop.address.street
data['invoice'] = cls.get_invoice(record) data['invoice'] = cls.get_invoice(record)
data['fe_cufe'] = record.fe_qrcode # data['fe_cufe'] = record.fe_qrcode
data['cufe'] = record.fe_cufe # data['cufe'] = record.fe_cufe
data["party"] = record.party.name data["party"] = record.party.name
data["tax_identifier_type"] = record.party.tax_identifier.type_string data["tax_identifier_type"] = record.party.tax_identifier.type_string
data["tax_identifier_code"] = record.party.tax_identifier.code data["tax_identifier_code"] = record.party.tax_identifier.code

140
setup.py Executable file
View File

@@ -0,0 +1,140 @@
#!/usr/bin/env python3
import io
import os
import re
from configparser import ConfigParser
from setuptools import find_packages, setup
MODULE2PREFIX = {}
def read(fname):
content = io.open(
os.path.join(os.path.dirname(__file__), fname),
'r', encoding='utf-8').read()
content = re.sub(
r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content)
return content
def get_require_version(name):
if minor_version % 2:
require = '%s >= %s.%s.dev0, < %s.%s'
else:
require = '%s >= %s.%s, < %s.%s'
require %= (name, major_version, minor_version,
major_version, minor_version + 1)
return require
config = ConfigParser()
config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg')))
info = dict(config.items('tryton'))
for key in ('depends', 'extras_depend', 'xml'):
if key in info:
info[key] = info[key].strip().splitlines()
version = info.get('version', '0.0.1')
major_version, minor_version, _ = version.split('.', 2)
major_version = int(major_version)
minor_version = int(minor_version)
name = 'trytondo-sale_fast_food'
local_version = []
if os.environ.get('CI_JOB_ID'):
local_version.append(os.environ['CI_JOB_ID'])
else:
for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']:
if os.environ.get(build):
local_version.append(os.environ[build])
else:
local_version = []
break
if local_version:
version += '+' + '.'.join(local_version)
requires = []
for dep in info.get('depends', []):
if not re.match(r'(ir|res)(\W|$)', dep):
prefix = MODULE2PREFIX.get(dep, 'trytond')
requires.append(get_require_version('%s_%s' % (prefix, dep)))
requires.append(get_require_version('trytond'))
tests_require = []
dependency_links = []
if minor_version % 2:
dependency_links.append(
'https://trydevpi.tryton.org/?local_version='
+ '.'.join(local_version)
+ '&mirror=github')
setup(name=name,
version=version,
description='This module allowed admin product and sale with fast food',
long_description=read('README.rst'),
author='One Cluster S.A.S',
author_email='info@onecluster.org',
url='http://www.tryton.org/',
keywords='',
package_dir={'trytond.modules.sale_fast_food': '.'},
packages=(
['trytond.modules.sale_fast_food']
+ ['trytond.modules.sale_fast_food.%s' % p
for p in find_packages()]
),
package_data={
'trytond.modules.sale_fast_food': (info.get('xml', [])
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt',
'icons/*.svg', 'tests/*.rst']),
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Plugins',
'Framework :: Tryton',
'Intended Audience :: Developers',
'Intended Audience :: Financial and Insurance Industry',
'Intended Audience :: Legal Industry',
'License :: OSI Approved :: '
'GNU General Public License v3 or later (GPLv3+)',
'Natural Language :: Bulgarian',
'Natural Language :: Catalan',
'Natural Language :: Chinese (Simplified)',
'Natural Language :: Czech',
'Natural Language :: Dutch',
'Natural Language :: English',
'Natural Language :: Finnish',
'Natural Language :: French',
'Natural Language :: German',
'Natural Language :: Hungarian',
'Natural Language :: Indonesian',
'Natural Language :: Italian',
'Natural Language :: Persian',
'Natural Language :: Polish',
'Natural Language :: Portuguese (Brazilian)',
'Natural Language :: Romanian',
'Natural Language :: Russian',
'Natural Language :: Slovenian',
'Natural Language :: Spanish',
'Natural Language :: Turkish',
'Natural Language :: Ukrainian',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Office/Business',
],
license='GPL-3',
python_requires='>=3.7',
# install_requires=requires,
extras_require={
'test': tests_require,
},
dependency_links=dependency_links,
zip_safe=False,
entry_points="""
[trytond.modules]
sale_fast_food = trytond.modules.sale_fast_food
""", # noqa: E501
)

View File

@@ -1,5 +1,5 @@
[tryton] [tryton]
version=8.0.0 version=7.6.0
depends: depends:
ir ir
res res
@@ -19,24 +19,3 @@ xml:
user.xml user.xml
report_close_statement.xml report_close_statement.xml
report.xml report.xml
[register]
model:
product.Product
invoice.InvoiceLine
sale.Sale
sale.Line
sale.SaleLineDeletedLog
user.User
production.Production
report_close_statement.ReportCloseStatementStart
report.ReportSaleProduct
report.ReportSaleByUser
report.ReportSaleByZone
report.ReportSaleContext
wizards:
report_close_statement.PrintReportCloseStatement
report:
report_close_statement.CashRegister