minor fixes + default
This commit is contained in:
parent
f4096f87c1
commit
a29993fce7
4
aeat.py
4
aeat.py
|
@ -337,7 +337,7 @@ class SIIReport(Workflow, ModelSQL, ModelView):
|
|||
return Transaction().context.get('company')
|
||||
|
||||
@fields.depends('company')
|
||||
def on_change_with_currency(self, name):
|
||||
def on_change_with_currency(self, name=None):
|
||||
if self.company:
|
||||
return self.company.currency.id
|
||||
|
||||
|
@ -664,7 +664,7 @@ class BaseTrytonInvoiceMapper(object):
|
|||
issue_date = attrgetter('invoice_date')
|
||||
invoice_kind = attrgetter('sii_operation_key')
|
||||
rectified_invoice_kind = callback_utils.fixed_value('I')
|
||||
not_exempt_kind = attrgetter('sii_subjected')
|
||||
not_exempt_kind = attrgetter('sii_subjected_key')
|
||||
counterpart_name = attrgetter('party.name')
|
||||
counterpart_nif = attrgetter('party.sii_vat_code')
|
||||
counterpart_id_type = attrgetter('party.identifier_type')
|
||||
|
|
|
@ -54,6 +54,13 @@ class Invoice:
|
|||
'sii_received_key', 'sii_issued_key', 'sii_subjected_key',
|
||||
'sii_excemption_key', 'sii_intracomunity_key']
|
||||
|
||||
@staticmethod
|
||||
def default_sii_operation_key():
|
||||
type_ = Transaction().context.get('type', 'out_invoice')
|
||||
if type_ in ('in_credit_note', 'out_credit_note'):
|
||||
return 'R1'
|
||||
return 'F1'
|
||||
|
||||
@classmethod
|
||||
def search_sii_state(cls, name, clause):
|
||||
pool = Pool()
|
||||
|
|
Loading…
Reference in New Issue