Register Sale and Purchase models only if the corresponding modules are activated.

This commit is contained in:
Albert Cervera i Areny 2018-08-24 18:08:53 +02:00
parent fdd6d592d1
commit a7ddf22c3b
1 changed files with 8 additions and 2 deletions

View File

@ -17,8 +17,6 @@ def register():
party.Party,
company.Company,
invoice.Invoice,
invoice.Sale,
invoice.Purchase,
load_pkcs12.LoadPKCS12Start,
aeat.SIIReport,
aeat.SIIReportLine,
@ -26,6 +24,14 @@ def register():
aeat_mapping.IssuedTrytonInvoiceMapper,
aeat_mapping.RecievedTrytonInvoiceMapper,
module='aeat_sii', type_='model')
Pool.register(
invoice.Sale,
depends=['sale'],
module='aeat_sii', type_='model')
Pool.register(
invoice.Purchase,
depends=['purchase'],
module='aeat_sii', type_='model')
Pool.register(
load_pkcs12.LoadPKCS12,
module='aeat_sii', type_='wizard')