mirror of
https://gitlab.com/datalifeit/trytond-aeat_sii
synced 2023-12-13 20:30:37 +01:00
Remove reset_sii_keys button from account invoice views. And update tests
This commit is contained in:
parent
bd0c4e8578
commit
91edea5316
|
@ -404,7 +404,6 @@ class Invoice(metaclass=PoolMeta):
|
||||||
return 'R1' if self.untaxed_amount < Decimal('0.0') else 'F1'
|
return 'R1' if self.untaxed_amount < Decimal('0.0') else 'F1'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ModelView.button
|
|
||||||
def reset_sii_keys(cls, invoices):
|
def reset_sii_keys(cls, invoices):
|
||||||
to_write = []
|
to_write = []
|
||||||
for invoice in invoices:
|
for invoice in invoices:
|
||||||
|
|
|
@ -140,9 +140,9 @@ Create invoice::
|
||||||
|
|
||||||
>>> invoice.sii_book_key == 'I'
|
>>> invoice.sii_book_key == 'I'
|
||||||
True
|
True
|
||||||
>>> invoice.click('reset_sii_keys')
|
>>> reset_sii_keys = Wizard('aeat.sii.reset.keys', models=[invoice])
|
||||||
|
>>> reset_sii_keys.execute('reset')
|
||||||
>>> invoice.reload()
|
>>> invoice.reload()
|
||||||
|
|
||||||
>>> invoice.sii_book_key == 'E'
|
>>> invoice.sii_book_key == 'E'
|
||||||
True
|
True
|
||||||
>>> invoice.click('post')
|
>>> invoice.click('post')
|
||||||
|
@ -181,9 +181,9 @@ Create Credit invoice::
|
||||||
>>> invoice.sii_issued_key = '02'
|
>>> invoice.sii_issued_key = '02'
|
||||||
>>> invoice.save()
|
>>> invoice.save()
|
||||||
>>> invoice.reload()
|
>>> invoice.reload()
|
||||||
>>> invoice.click('reset_sii_keys')
|
>>> reset_sii_keys = Wizard('aeat.sii.reset.keys', models=[invoice])
|
||||||
|
>>> reset_sii_keys.execute('reset')
|
||||||
>>> invoice.reload()
|
>>> invoice.reload()
|
||||||
|
|
||||||
>>> invoice.sii_book_key == 'E'
|
>>> invoice.sii_book_key == 'E'
|
||||||
True
|
True
|
||||||
>>> invoice.sii_operation_key == 'R1'
|
>>> invoice.sii_operation_key == 'R1'
|
||||||
|
@ -214,7 +214,7 @@ Credit invoice with refund::
|
||||||
>>> credit.execute('credit')
|
>>> credit.execute('credit')
|
||||||
>>> invoice.reload()
|
>>> invoice.reload()
|
||||||
>>> invoice.state
|
>>> invoice.state
|
||||||
'cancel'
|
'paid'
|
||||||
>>> credit, = Invoice.find([('total_amount', '<', 0)])
|
>>> credit, = Invoice.find([('total_amount', '<', 0)])
|
||||||
>>> credit.sii_operation_key
|
>>> credit.sii_operation_key
|
||||||
'R1'
|
'R1'
|
||||||
|
|
|
@ -25,7 +25,6 @@ contains the full copyright notices and license terms. -->
|
||||||
<field name="sii_state"/>
|
<field name="sii_state"/>
|
||||||
<label name="sii_pending_sending"/>
|
<label name="sii_pending_sending"/>
|
||||||
<field name="sii_pending_sending"/>
|
<field name="sii_pending_sending"/>
|
||||||
<button name="reset_sii_keys" colspan="4"/>
|
|
||||||
</page>
|
</page>
|
||||||
</xpath>
|
</xpath>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -8,6 +8,5 @@ contains the full copyright notices and license terms. -->
|
||||||
<field name="sii_communication_type"/>
|
<field name="sii_communication_type"/>
|
||||||
<field name="sii_state"/>
|
<field name="sii_state"/>
|
||||||
<field name="sii_pending_sending"/>
|
<field name="sii_pending_sending"/>
|
||||||
<button name="reset_sii_keys" tree_invisible="1"/>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
</data>
|
</data>
|
||||||
|
|
Loading…
Reference in a new issue