Compare commits

..

6 commits

Author SHA1 Message Date
Frederik Jaeckel
f42cf06662 Version 6.0.3 2025-01-27 16:33:45 +01:00
Frederik Jaeckel
e688664c55 Merge branch 'main' into 6.0 2025-01-27 16:30:03 +01:00
Frederik Jaeckel
592405e2fc Version 6.0.2 2025-01-24 09:36:12 +01:00
Frederik Jaeckel
df9ff9c47c Merge branch 'main' into 6.0 2025-01-24 09:32:12 +01:00
Frederik Jaeckel
3711df3a8f Version 6.0.1 2025-01-23 17:28:17 +01:00
Frederik Jaeckel
f6d110081c compatibility to Tryton 6.0 2025-01-23 17:27:20 +01:00
8 changed files with 50 additions and 30 deletions

View file

@ -1,5 +1,6 @@
Copyright (C) 2024-2025 martin-data services.
Copyright (C) 2025 Mathias Behrle <mathiasb@m9s.biz>
Copyright (C) 2015-2025 Cédric Krier.
Copyright (C) 2015-2025 B2CK SPRL.
Copyright (C) 2021-2025 martin-data services.
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

View file

@ -9,12 +9,21 @@ pip install mds-document-incoming-invoice-xml
Requires
========
- Tryton 7.0
- Tryton 6.0
Changes
=======
*7.0.0 - 19.12.2024*
*6.0.3 - 27.01.2025*
- init
- filter product-categories in configuration
*6.0.2 - 24.01.2025*
- fix: limit content-check to supplier-invoices
*6.0.1 - 23.01.2025*
- import of Factur-X (Basic, EN16931, Extended), CrossIndustryInvoice-D22
- with/without PDF-Container

View file

@ -20,7 +20,6 @@ from trytond.i18n import gettext
from trytond.model import fields
from trytond.pyson import Eval
from trytond.protocols.jsonrpc import JSONEncoder
from trytond.modules.product import round_price
xml_types = [
@ -720,15 +719,12 @@ class Incoming(metaclass=PoolMeta):
if units:
xml_uom = units[0]
unitprice = line_data.get('unit_net_price', {}).pop('amount', None)
line = Line(
invoice=invoice,
type='line',
unit=xml_uom,
quantity=xml_uom.round(
line_data.get('quantity', {}).pop('billed', None)),
unit_price=round_price(unitprice)
if unitprice is not None else Decimal('0.0'))
quantity=line_data.get('quantity', {}).pop('billed', None),
unit_price=line_data.get('unit_net_price', {}).pop('amount', None))
line_no = line_data.pop('line_no', None)
# description
@ -967,9 +963,9 @@ class Incoming(metaclass=PoolMeta):
result['quantity'] = self._readxml_read_listdata(
xmldata, xpath_line, [
'ram:SpecifiedLineTradeDelivery'], [
('ram:BilledQuantity', 'billed', float),
('ram:ChargeFreeQuantity', 'chargefree', float),
('ram:PackageQuantity', 'package', float),
('ram:BilledQuantity', 'billed', Decimal),
('ram:ChargeFreeQuantity', 'chargefree', Decimal),
('ram:PackageQuantity', 'package', Decimal),
])[0]
result['quantity']['unit_code'] = self._readxml_getattrib(
xmldata, xpath_quantity + ['ram:BilledQuantity'], 'unitCode')

View file

@ -34,7 +34,7 @@ with open(path.join(here, 'versiondep.txt'), encoding='utf-8') as f:
modversion[l2[0]] = {'min': l2[1], 'max': l2[2], 'prefix': l2[3]}
# tryton-version
major_version = 7
major_version = 6
minor_version = 0
requires = ['pypdf', 'factur-x', 'lxml']
@ -85,8 +85,6 @@ setup(
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
keywords='tryton account invoice xrechnung edocument incoming',

View file

@ -2,3 +2,18 @@
# This file is part of the document-incoming-invoice-xml-module
# from m-ds for Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import trytond.tests.test_tryton
import unittest
from .test_module import XmlIncomingTestCase
__all__ = ['suite']
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
XmlIncomingTestCase))
return suite

View file

@ -23,7 +23,7 @@ parsed_data_ci_invoice = {
'total': {'amount': Decimal('1350.00')},
'line_no': '1',
'quantity': {
'billed': 1.0,
'billed': Decimal('1.0'),
'unit_code': 'KGM'},
'unit_net_price': {'amount': Decimal('1350.00')},
}, {
@ -34,7 +34,7 @@ parsed_data_ci_invoice = {
'total': {'amount': Decimal('1200.00')},
'line_no': '2',
'quantity': {
'billed': 1.5,
'billed': Decimal('1.5'),
'unit_code': 'KGM'},
'unit_net_price': {'amount': Decimal('800.00')},
}, {
@ -42,7 +42,7 @@ parsed_data_ci_invoice = {
'total': {'amount': Decimal('300.00')},
'line_no': '3',
'quantity': {
'billed': 2.0,
'billed': Decimal('2.0'),
'unit_code': 'MTR'},
'unit_net_price': {'amount': Decimal('150.00')}}],
'note_list': [{
@ -101,7 +101,7 @@ parsed_data_facturx_en16931 = {
'description': 'Description of Product 1',
'unit_net_price': {'amount': Decimal('1350.00')},
'quantity': {
'billed': 1.0, 'unit_code': 'KGM'},
'billed': Decimal('1.0'), 'unit_code': 'KGM'},
'taxes': [{
'type': 'VAT',
'category_code': 'S',
@ -127,7 +127,7 @@ parsed_data_facturx_en16931 = {
'amount': Decimal('950.00'),
'basequantity': Decimal('1.0')},
'quantity': {
'billed': 1.5,
'billed': Decimal('1.5'),
'unit_code': 'KGM'},
'taxes': [{
'type': 'VAT',
@ -141,7 +141,7 @@ parsed_data_facturx_en16931 = {
'description': 'Description of Product 3',
'unit_net_price': {'amount': Decimal('150.00')},
'quantity': {
'billed': 2.0,
'billed': Decimal('2.0'),
'unit_code': 'MTR'},
'taxes': [{
'type': 'VAT',
@ -213,7 +213,7 @@ parsed_data_facturx_basic = {
'line_no': '1',
'name': 'Name of Product 1',
'unit_net_price': {'amount': Decimal('1350.00')},
'quantity': {'billed': 1.0, 'unit_code': 'KGM'},
'quantity': {'billed': Decimal('1.0'), 'unit_code': 'KGM'},
'taxes': [{
'type': 'VAT',
'category_code': 'S',
@ -231,7 +231,7 @@ parsed_data_facturx_basic = {
'amount': Decimal('950.00'),
'basequantity': Decimal('1.0')},
'quantity': {
'billed': 1.5,
'billed': Decimal('1.5'),
'unit_code': 'KGM'},
'taxes': [{
'type': 'VAT',
@ -243,7 +243,7 @@ parsed_data_facturx_basic = {
'name': 'Name of Product 3',
'unit_net_price': {'amount': Decimal('150.00')},
'quantity': {
'billed': 2.0,
'billed': Decimal('2.0'),
'unit_code': 'MTR'},
'taxes': [{
'type': 'VAT',
@ -328,7 +328,7 @@ parsed_data_facturx_extended = {
'name': 'Name of Product 1',
'description': 'Description of Product 1',
'unit_net_price': {'amount': Decimal('1350.00')},
'quantity': {'billed': 1.0, 'unit_code': 'KGM'},
'quantity': {'billed': Decimal('1.0'), 'unit_code': 'KGM'},
'taxes': [{
'type': 'VAT',
'category_code': 'S',
@ -379,7 +379,7 @@ parsed_data_facturx_extended = {
'amount': Decimal('950.00'),
'basequantity': Decimal('1.0')},
'quantity': {
'billed': 1.5,
'billed': Decimal('1.5'),
'unit_code': 'KGM',
'package': Decimal('1.5')},
'taxes': [{
@ -392,7 +392,7 @@ parsed_data_facturx_extended = {
'name': 'Name of Product 3',
'description': 'Description of Product 3',
'unit_net_price': {'amount': Decimal('150.00')},
'quantity': {'billed': 2.0, 'unit_code': 'MTR'},
'quantity': {'billed': Decimal('2.0'), 'unit_code': 'MTR'},
'taxes': [{
'type': 'VAT',
'category_code': 'S',

View file

@ -1,5 +1,5 @@
[tryton]
version=7.0.0
version=6.0.3
depends:
document_incoming_invoice
edocument_unece

View file

@ -0,0 +1 @@
document_incoming_invoice;6.0.0;6.0.999;mds