Migrate package ownership to Fundación Un País Mejor
Publish Package / publish (push) Failing after 2m38s
Publish Package / publish (push) Failing after 2m38s
This commit is contained in:
@@ -75,7 +75,7 @@ jobs:
|
||||
|
||||
OWNER = 'tryton-do'
|
||||
PACKAGE_TYPE = 'pypi'
|
||||
API_ROOT = 'https://gitea.joseagrc.com/api/v1'
|
||||
API_ROOT = 'https://code.unpaismejor.org.do/api/v1'
|
||||
|
||||
def normalize(name):
|
||||
return re.sub(r'[-_.]+', '-', name).lower()
|
||||
@@ -187,5 +187,5 @@ jobs:
|
||||
TWINE_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
run: |
|
||||
python -m twine upload \
|
||||
--repository-url https://gitea.joseagrc.com/api/packages/tryton-do/pypi \
|
||||
--repository-url https://code.unpaismejor.org.do/api/packages/tryton-do/pypi \
|
||||
dist/*
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
Version 8.0.1 - 2026-08-14
|
||||
* Maintain the module under Fundación Un País Mejor.
|
||||
* Publish it as unpaismejor_account_credit_note.
|
||||
* Delegate full credit notes and refunds entirely to Tryton core.
|
||||
* Restrict custom line and tax adjustments to partial credit notes.
|
||||
* Reject a fixed partial amount applied to multiple source invoices.
|
||||
* Update repository and package publication URLs.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Copyright (C) 2026 Solutema SRL
|
||||
Copyright (C) 2026 Fundación Un País Mejor
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
+5
-1
@@ -8,12 +8,16 @@ The module keeps the core credit workflow for full credit notes and only adjusts
|
||||
generated invoice lines when a partial credit is requested. Taxes are recomputed
|
||||
from the adjusted lines using Tryton's invoice logic.
|
||||
|
||||
The package is maintained by Fundación Un País Mejor. Full credit notes and
|
||||
refunds are delegated unchanged to Tryton's ``account_invoice`` module. A fixed
|
||||
partial amount may only be applied to one source invoice at a time.
|
||||
|
||||
Installing
|
||||
**********
|
||||
|
||||
Install the package and activate the module in the database::
|
||||
|
||||
pip install trytond_account_credit_note
|
||||
pip install unpaismejor_account_credit_note
|
||||
trytond-admin -d <database> -u account_credit_note
|
||||
|
||||
Publishing
|
||||
|
||||
+5
-10
@@ -8,8 +8,7 @@ trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/'
|
||||
def get_info():
|
||||
import configparser
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import tomllib
|
||||
|
||||
module_dir = os.path.dirname(os.path.dirname(__file__))
|
||||
|
||||
@@ -17,15 +16,11 @@ def get_info():
|
||||
config.read_file(open(os.path.join(module_dir, 'tryton.cfg')))
|
||||
info = dict(config.items('tryton'))
|
||||
|
||||
result = subprocess.run(
|
||||
[sys.executable, 'setup.py', '--name'],
|
||||
stdout=subprocess.PIPE, check=True, cwd=module_dir)
|
||||
info['name'] = result.stdout.decode('utf-8').strip()
|
||||
with open(os.path.join(module_dir, 'pyproject.toml'), 'rb') as stream:
|
||||
project = tomllib.load(stream)['project']
|
||||
info['name'] = project['name']
|
||||
|
||||
result = subprocess.run(
|
||||
[sys.executable, 'setup.py', '--version'],
|
||||
stdout=subprocess.PIPE, check=True, cwd=module_dir)
|
||||
version = result.stdout.decode('utf-8').strip()
|
||||
version = info['version']
|
||||
if 'dev' in version:
|
||||
info['series'] = 'latest'
|
||||
else:
|
||||
|
||||
+4
-1
@@ -8,12 +8,15 @@ The module keeps the core credit workflow for full credit notes and only adjusts
|
||||
generated invoice lines when a partial credit is requested. Taxes are recomputed
|
||||
from the adjusted lines using Tryton's invoice logic.
|
||||
|
||||
The package is maintained by Fundación Un País Mejor. Full credit notes and
|
||||
refunds are delegated unchanged to Tryton core.
|
||||
|
||||
Installing
|
||||
**********
|
||||
|
||||
Install the package and activate the module in the database::
|
||||
|
||||
pip install trytond_account_credit_note
|
||||
pip install unpaismejor_account_credit_note
|
||||
trytond-admin -d <database> -u account_credit_note
|
||||
|
||||
Publishing
|
||||
|
||||
+11
-15
@@ -313,11 +313,21 @@ class Invoice(metaclass=PoolMeta):
|
||||
workflow cancels the original invoice, which is not correct for a
|
||||
partial credit note.
|
||||
"""
|
||||
invoices = list(invoices)
|
||||
credit_mode = values.pop('credit_mode', None) or 'full'
|
||||
credit_percent = values.pop('credit_percent', None)
|
||||
credit_amount = values.pop('credit_amount', None)
|
||||
credit_amount_basis = values.pop('credit_amount_basis', None) or 'total'
|
||||
|
||||
# Preserve the official account_invoice behavior without custom line,
|
||||
# tax, posting or cancellation logic for a full credit note.
|
||||
if credit_mode == 'full':
|
||||
return super().credit(invoices, refund=refund, **values)
|
||||
|
||||
if credit_mode == 'amount' and len(invoices) != 1:
|
||||
raise UserError(gettext(
|
||||
'account_credit_note.msg_amount_multiple_invoices'))
|
||||
|
||||
factors = [
|
||||
cls._credit_partial_compute_factor(
|
||||
origin, credit_mode, credit_percent, credit_amount,
|
||||
@@ -325,8 +335,7 @@ class Invoice(metaclass=PoolMeta):
|
||||
for origin in invoices
|
||||
]
|
||||
|
||||
is_partial = any(factor != _ONE for factor in factors)
|
||||
if refund and is_partial:
|
||||
if refund:
|
||||
raise UserError(gettext(
|
||||
'account_credit_note.msg_partial_refund_not_allowed'))
|
||||
|
||||
@@ -351,19 +360,6 @@ class Invoice(metaclass=PoolMeta):
|
||||
|
||||
cls.save(new_invoices)
|
||||
|
||||
if refund:
|
||||
# Same behavior as account_invoice.Invoice.credit(refund=True), but
|
||||
# executed after possible edits to the generated credit note.
|
||||
cls.post(new_invoices)
|
||||
for invoice, new_invoice in zip(invoices, new_invoices):
|
||||
if invoice.state != 'posted':
|
||||
raise UserError(gettext(
|
||||
'account_invoice.msg_invoice_credit_refund_not_posted',
|
||||
invoice=invoice.rec_name))
|
||||
invoice.cancel_move = new_invoice.move
|
||||
cls.save(invoices)
|
||||
cls.cancel(invoices)
|
||||
|
||||
return new_invoices
|
||||
|
||||
|
||||
|
||||
+6
-2
@@ -2,8 +2,8 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: account_credit_note 8.0\n"
|
||||
"PO-Revision-Date: 2026-07-23 00:00-0400\n"
|
||||
"Last-Translator: Automatically generated\n"
|
||||
"PO-Revision-Date: 2026-08-14 00:00-0400\n"
|
||||
"Last-Translator: Fundación Un País Mejor\n"
|
||||
"Language-Team: Spanish\n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -58,6 +58,10 @@ msgctxt "model:ir.message,text:msg_partial_refund_not_allowed"
|
||||
msgid "Partial credit notes can not be posted as refunds automatically."
|
||||
msgstr "Las notas de crédito parciales no pueden contabilizarse automáticamente como devoluciones."
|
||||
|
||||
msgctxt "model:ir.message,text:msg_amount_multiple_invoices"
|
||||
msgid "A fixed credit amount can only be applied to one source invoice at a time."
|
||||
msgstr "Un importe fijo de crédito solo puede aplicarse a una factura origen a la vez."
|
||||
|
||||
msgctxt "model:ir.ui.view,name:credit_start_view_form"
|
||||
msgid "credit_start_form"
|
||||
msgstr "credit_start_form"
|
||||
|
||||
+7
-3
@@ -1,9 +1,9 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: account_credit_note 7.0\n"
|
||||
"PO-Revision-Date: 2026-07-15 00:00-0400\n"
|
||||
"Last-Translator: Automatically generated\n"
|
||||
"Project-Id-Version: account_credit_note 8.0\n"
|
||||
"PO-Revision-Date: 2026-08-14 00:00-0400\n"
|
||||
"Last-Translator: Fundación Un País Mejor\n"
|
||||
"Language-Team: Spanish (Latin America)\n"
|
||||
"Language: es_419\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -58,6 +58,10 @@ msgctxt "model:ir.message,text:msg_partial_refund_not_allowed"
|
||||
msgid "Partial credit notes can not be posted as refunds automatically."
|
||||
msgstr "Las notas de crédito parciales no se pueden contabilizar automáticamente como reembolsos."
|
||||
|
||||
msgctxt "model:ir.message,text:msg_amount_multiple_invoices"
|
||||
msgid "A fixed credit amount can only be applied to one source invoice at a time."
|
||||
msgstr "Un monto fijo de crédito solo puede aplicarse a una factura origen a la vez."
|
||||
|
||||
msgctxt "model:ir.ui.view,name:credit_start_view_form"
|
||||
msgid "credit_start_form"
|
||||
msgstr "credit_start_form"
|
||||
|
||||
@@ -25,5 +25,8 @@
|
||||
<record model="ir.message" id="msg_partial_refund_not_allowed">
|
||||
<field name="text">Partial credit notes can not be posted as refunds automatically.</field>
|
||||
</record>
|
||||
<record model="ir.message" id="msg_amount_multiple_invoices">
|
||||
<field name="text">A fixed credit amount can only be applied to one source invoice at a time.</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
||||
+4
-4
@@ -3,11 +3,11 @@ requires = ['hatchling >= 1', 'hatch-tryton']
|
||||
build-backend = 'hatchling.build'
|
||||
|
||||
[project]
|
||||
name = 'trytond_account_credit_note'
|
||||
name = 'unpaismejor_account_credit_note'
|
||||
dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme']
|
||||
requires-python = '>=3.10'
|
||||
maintainers = [
|
||||
{name = "Solutema"},
|
||||
{name = "Fundación Un País Mejor"},
|
||||
]
|
||||
description = "Partial credit notes for Tryton invoices"
|
||||
license = 'GPL-3.0-or-later'
|
||||
@@ -26,8 +26,8 @@ classifiers = [
|
||||
account_credit_note = 'trytond.modules.account_credit_note'
|
||||
|
||||
[project.urls]
|
||||
homepage = "https://www.tryton.org/"
|
||||
repository = "https://gitea.joseagrc.com/tryton-do/account_credit_note"
|
||||
homepage = "https://www.unpaismejor.org.do"
|
||||
repository = "https://code.unpaismejor.org.do/tryton-do/account_credit_note"
|
||||
|
||||
[tool.hatch.build]
|
||||
include = [
|
||||
|
||||
@@ -50,5 +50,13 @@ class AccountCreditNoteLogicTestCase(unittest.TestCase):
|
||||
Invoice._credit_partial_compute_factor(
|
||||
MockInvoice(), 'amount', None, Decimal('119'), 'total')
|
||||
|
||||
def test_fixed_amount_rejects_multiple_invoices(self):
|
||||
with self.assertRaises(UserError):
|
||||
Invoice.credit(
|
||||
[MockInvoice(), MockInvoice()],
|
||||
credit_mode='amount',
|
||||
credit_amount=Decimal('10'),
|
||||
credit_amount_basis='total')
|
||||
|
||||
|
||||
del ModuleTestCase
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
[tryton]
|
||||
version=8.0.0
|
||||
version=8.0.1
|
||||
depends:
|
||||
account_invoice
|
||||
xml:
|
||||
|
||||
Reference in New Issue
Block a user