parent
dc1b7387b2
commit
8e31f4eff0
|
@ -28,6 +28,11 @@ class Configuration(metaclass=PoolMeta):
|
|||
'invisible': ~Eval('aeat_received_sii', False),
|
||||
}, depends=['aeat_received_sii'],
|
||||
help='Automatically send AEAT Received SII reports by cron')
|
||||
max_sii_lines = fields.Integer('Max SII lines', help='Indicates the '
|
||||
'maximum number of invoices to be included in each SII book.',
|
||||
domain=['OR',
|
||||
[('max_sii_lines', '=', None)],
|
||||
[('max_sii_lines', '>', 0)]])
|
||||
|
||||
@staticmethod
|
||||
def default_aeat_pending_sii():
|
||||
|
|
9
aeat.py
9
aeat.py
|
@ -1070,16 +1070,17 @@ class SIIReport(Workflow, ModelSQL, ModelView):
|
|||
pool = Pool()
|
||||
SIIReport = pool.get('aeat.sii.report')
|
||||
SIIReportLine = pool.get('aeat.sii.report.lines')
|
||||
Company = Pool().get('company.company')
|
||||
Company = pool.get('company.company')
|
||||
Configuration = pool.get('account.configuration')
|
||||
configuration = Configuration(1)
|
||||
|
||||
company = Transaction().context.get('company')
|
||||
company = Company(company)
|
||||
company_vat = company.party.sii_vat_code
|
||||
max_sii_lines = configuration.max_sii_lines or MAX_SII_LINES
|
||||
|
||||
cursor = Transaction().connection.cursor()
|
||||
report_line_table = SIIReportLine.__table__()
|
||||
|
||||
reports = []
|
||||
reports = []
|
||||
for company, book_invoices in company_invoices.items():
|
||||
company = Company(company)
|
||||
|
@ -1088,7 +1089,7 @@ class SIIReport(Workflow, ModelSQL, ModelView):
|
|||
values = book_invoices[operation]
|
||||
delete = True if operation == 'D0' else False
|
||||
for period, invoices in values.items():
|
||||
for invs in grouped_slice(invoices, MAX_SII_LINES):
|
||||
for invs in grouped_slice(invoices, max_sii_lines):
|
||||
report = SIIReport()
|
||||
report.company = company
|
||||
report.company_vat = company_vat
|
||||
|
|
10
locale/es.po
10
locale/es.po
|
@ -1866,4 +1866,12 @@ msgstr "Confirmado"
|
|||
|
||||
msgctxt "model:ir.action.act_window.domain,name:act_aeat_sii_issued_reports_all"
|
||||
msgid "All"
|
||||
msgstr "Todo"
|
||||
msgstr "Todo"
|
||||
|
||||
msgctxt "field:account.configuration,max_sii_lines:"
|
||||
msgid "Max SII lines"
|
||||
msgstr "Máximo líneas SII"
|
||||
|
||||
msgctxt "help:account.configuration,max_sii_lines:"
|
||||
msgid "Indicates the maximum number of invoices to be included in each SII book."
|
||||
msgstr "Indica el número máximo de facturas a incluir por libro del SII."
|
|
@ -12,6 +12,8 @@ copyright notices and license types. -->
|
|||
<field name="aeat_received_sii"/>
|
||||
<label name="aeat_received_sii_send"/>
|
||||
<field name="aeat_received_sii_send"/>
|
||||
<label name="max_sii_lines"/>
|
||||
<field name="max_sii_lines"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
|
Loading…
Reference in New Issue