Skip to content

Commit

Permalink
[REF] It is allowed to place draft state withholdings vat
Browse files Browse the repository at this point in the history
  • Loading branch information
egrivero committed Mar 21, 2016
1 parent e740a43 commit b6bf341
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions l10n_ve_withholding_iva/model/wh_iva.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,16 @@ def cancel_move(self):
move.unlink()
return True

@api.multi
def action_cancel_draft(self):
"""Restarting the workflow withholding vat.
The state is placed in draft.
"""
self.write({'state': 'draft'})
self.delete_workflow()
self.create_workflow()
return True

@api.model
def _get_valid_wh(self, amount_ret, amount, wh_iva_rate,
offset=0.5):
Expand Down
4 changes: 2 additions & 2 deletions l10n_ve_withholding_iva/view/wh_iva_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
<button name="wh_iva_done" states="confirmed" string="Done" icon="gtk-execute"/>
<button name="%(withholding_vat)d" type="action" colspan="2" states="done" string="Print VAT Withholding" icon="gtk-execute"/>
<button name="cancel" colspan="2" states="confirmed,draft,done" string="Cancel" icon="gtk-cancel"/>
<button name="set_to_draft" colspan="2" states="cancel" string="Set to draft" icon="terp-stock_effects-object-colorize"/>
<button name="action_cancel_draft" colspan="2" states="cancel" string="Set to draft" type="object" icon="terp-stock_effects-object-colorize"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" statusbar_colors="{&quot;confirmed&quot;:&quot;blue&quot;}"/>
</header>
<group colspan="4" col="6">
Expand Down Expand Up @@ -207,7 +207,7 @@
<button name="wh_iva_confirmed" states="draft" string="Confirm" icon="gtk-go-forward"/>
<button name="wh_iva_done" states="confirmed" string="Done" icon="gtk-execute"/>
<button name="cancel" states="confirmed,draft,done" string="Cancel" icon="gtk-cancel"/>
<button name="set_to_draft" states="cancel" string="Set to draft" icon="terp-stock_effects-object-colorize"/>
<button name="action_cancel_draft" colspan="2" states="cancel" string="Set to draft" type="object" icon="terp-stock_effects-object-colorize"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" statusbar_colors="{&quot;confirmed&quot;:&quot;blue&quot;}"/>
</header>
<group colspan="4" col="6">
Expand Down

0 comments on commit b6bf341

Please sign in to comment.