configuration - add erechnung default report
This commit is contained in:
parent
042e1b9a56
commit
695e60dea8
4 changed files with 146 additions and 3 deletions
|
@ -7,11 +7,15 @@
|
|||
from trytond.pool import PoolMeta, Pool
|
||||
from trytond.model import ModelSQL, fields
|
||||
from trytond.modules.company.model import CompanyValueMixin
|
||||
from .wizard_runreport import sel_edocument
|
||||
|
||||
|
||||
class Configuration(metaclass=PoolMeta):
|
||||
__name__ = 'account.configuration'
|
||||
|
||||
xrechn_default = fields.MultiValue(fields.Selection(
|
||||
string='Export mode', selection=sel_edocument,
|
||||
help='Pre-set export format for e-invoices.'))
|
||||
xrechn_zugferd_report = fields.MultiValue(fields.Many2One(
|
||||
model_name='ir.action.report',
|
||||
domain=[
|
||||
|
@ -25,11 +29,14 @@ class Configuration(metaclass=PoolMeta):
|
|||
""" select table
|
||||
"""
|
||||
pool = Pool()
|
||||
if field in {
|
||||
'xrechn_zugferd_report'}:
|
||||
if field in {'xrechn_zugferd_report', 'xrechn_default'}:
|
||||
return pool.get('account_invoice_xrechnung.configuration')
|
||||
return super(Configuration, cls).multivalue_model(field)
|
||||
|
||||
@classmethod
|
||||
def default_xrechn_default(cls, **pattern):
|
||||
return cls.multivalue_model('xrechn_default').default_xrechn_default()
|
||||
|
||||
# end Configuration
|
||||
|
||||
|
||||
|
@ -37,6 +44,9 @@ class ConfigurationXRechnungexport(ModelSQL, CompanyValueMixin):
|
|||
"Account Configuration XRechnung Export"
|
||||
__name__ = 'account_invoice_xrechnung.configuration'
|
||||
|
||||
xrechn_default = fields.Selection(
|
||||
string='Export mode', selection=sel_edocument,
|
||||
help='Pre-set export format for e-invoices.')
|
||||
xrechn_zugferd_report = fields.Many2One(
|
||||
model_name='ir.action.report',
|
||||
string='ZUGFeRD-Report',
|
||||
|
@ -45,4 +55,8 @@ class ConfigurationXRechnungexport(ModelSQL, CompanyValueMixin):
|
|||
('extension', '=', 'pdf')],
|
||||
help='Report that is to be used to generate the ZUGFeRD PDF.')
|
||||
|
||||
@classmethod
|
||||
def default_xrechn_default(cls, **pattern):
|
||||
return 'edocument.facturxext.invoice-ferd'
|
||||
|
||||
# end ConfigurationXRechnungexport
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue