select target for incoming invoice number

This commit is contained in:
Frederik Jaeckel 2025-01-07 16:08:44 +01:00
parent a94c678d33
commit e8cceb75c1
6 changed files with 73 additions and 2 deletions

View file

@ -9,6 +9,11 @@ from trytond.pool import PoolMeta
from trytond.model import fields
sel_number_target = [
('reference', "in the 'Reference' field"),
('number', "in the 'Number' field")]
class Configuration(metaclass=PoolMeta):
__name__ = 'document.incoming.configuration'
@ -20,6 +25,19 @@ class Configuration(metaclass=PoolMeta):
string='Accept other company',
help='Accepts invoices created for a company other ' +
'than the current one.')
number_target = fields.Selection(
string='Invoice number',
help='Destination for the invoice number of the supplier invoice.',
selection=sel_number_target)
@classmethod
def default_number_target(cls):
""" targetfield for incoming invoice number
Returns:
str: field 'reference'
"""
return 'reference'
@classmethod
def default_create_supplier(cls):