Skip to content

Commit

Permalink
FIX l10n_it_withholding_tax metadata
Browse files Browse the repository at this point in the history
FIX l10n_it_withholding_tax (OCA#416)

Gli oggetti withholding.tax.move, withholding.tax.statement e withholding.tax.move.payment si possono eliminare dalla vista elendo dei relativi menu
  • Loading branch information
eLBati authored and TheMule71 committed Jun 6, 2021
1 parent 9c213b6 commit dd5a273
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 64 deletions.
6 changes: 1 addition & 5 deletions l10n_it_withholding_tax_payment/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/l10n-italy/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed `feedback
<https://github.com/OCA/
l10n-italy/issues/new?body=module:%20
l10n_it_withholding_tax%0Aversion:%20
8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
help us smash it by providing detailed and welcomed feedback.

Credits
=======
Expand Down
2 changes: 1 addition & 1 deletion l10n_it_withholding_tax_payment/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright © 2015 Alessandro Camilli (<http://www.openforce.it>)
# Copyright 2015 Alessandro Camilli (<http://www.openforce.it>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models, wizard
2 changes: 1 addition & 1 deletion l10n_it_withholding_tax_payment/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright © 2015 Alessandro Camilli (<http://www.openforce.it>)
# Copyright 2015 Alessandro Camilli (<http://www.openforce.it>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
Expand Down
22 changes: 10 additions & 12 deletions l10n_it_withholding_tax_payment/data/sequence.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<odoo noupdate="1">

<record id="seq_wt_move_payment" model="ir.sequence">
<field name="name">Withholding Tax Move Payment Number</field>
<field name="code">withholding.tax.move.payment</field>
<field eval="4" name="padding"/>
<field name="prefix">WTMP/</field>
<field name="company_id" eval="False"/>
</record>

</data>
</odoo>
<record id="seq_wt_move_payment" model="ir.sequence">
<field name="name">Withholding Tax Move Payment Number</field>
<field name="code">withholding.tax.move.payment</field>
<field eval="4" name="padding"/>
<field name="prefix">WTMP/</field>
<field name="company_id" eval="False"/>
</record>

</odoo>
2 changes: 1 addition & 1 deletion l10n_it_withholding_tax_payment/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright © 2015 Alessandro Camilli (<http://www.openforce.it>)
# Copyright 2015 Alessandro Camilli (<http://www.openforce.it>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).


Expand Down
9 changes: 8 additions & 1 deletion l10n_it_withholding_tax_payment/models/withholding_tax.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright © 2015 Alessandro Camilli (<http://www.openforce.it>)
# Copyright 2015 Alessandro Camilli (<http://www.openforce.it>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).


Expand Down Expand Up @@ -157,3 +157,10 @@ def move_payment_confirmed(self):
# Wt move set to due
for wt_move in move.line_ids:
wt_move.action_paid()

@api.multi
def unlink(self):
for payment in self:
if payment.state != 'draft':
raise ValidationError(_("You can only delete draft payments"))
return super(WithholdingTaxMovePayment, self).unlink()
2 changes: 1 addition & 1 deletion l10n_it_withholding_tax_payment/views/withholding_tax.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<newline/>
<group>
<field name="line_ids" nolabel="1">
<tree>
<tree delete="false">
<field name="date"/>
<field name="partner_id"/>
<field name="withholding_tax_id"/>
Expand Down
2 changes: 1 addition & 1 deletion l10n_it_withholding_tax_payment/wizard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright © 2015 Alessandro Camilli (<http://www.openforce.it>)
# Copyright 2015 Alessandro Camilli (<http://www.openforce.it>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright © 2015 Alessandro Camilli (<http://www.openforce.it>)
# Copyright 2015 Alessandro Camilli (<http://www.openforce.it>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).


Expand Down
78 changes: 38 additions & 40 deletions l10n_it_withholding_tax_payment/workflow.xml
Original file line number Diff line number Diff line change
@@ -1,48 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- WT move -->
<!-- Workflow definition -->
<odoo>
<!-- WT move -->
<!-- Workflow definition -->

<record id="wkf_wt_move_payment" model="workflow">
<field name="name">withholding.tax.move.payment.wkf</field>
<field name="osv">withholding.tax.move.payment</field>
<field name="on_create">True</field>
</record>
<record id="wkf_wt_move_payment" model="workflow">
<field name="name">withholding.tax.move.payment.wkf</field>
<field name="osv">withholding.tax.move.payment</field>
<field name="on_create">True</field>
</record>

<record id="act_draft" model="workflow.activity">
<field name="wkf_id" ref="wkf_wt_move_payment"/>
<field name="name">draft</field>
<field name="kind">function</field>
<field name="action">
move_payment_to_draft()
</field>
<field name="flow_start">True</field>
</record>
<record id="act_draft" model="workflow.activity">
<field name="wkf_id" ref="wkf_wt_move_payment"/>
<field name="name">draft</field>
<field name="kind">function</field>
<field name="action">
move_payment_to_draft()
</field>
<field name="flow_start">True</field>
</record>

<record id="act_confirmed" model="workflow.activity">
<field name="wkf_id" ref="wkf_wt_move_payment"/>
<field name="name">confirmed</field>
<field name="kind">function</field>
<field name="action">
move_payment_confirmed()
</field>
</record>
<record id="act_confirmed" model="workflow.activity">
<field name="wkf_id" ref="wkf_wt_move_payment"/>
<field name="name">confirmed</field>
<field name="kind">function</field>
<field name="action">
move_payment_confirmed()
</field>
</record>


<!-- transitions -->
<record id="rec_move_payment_t1" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_confirmed"/>
<field name="signal">confirmed</field>
<field name="group_id" ref="base.group_user"/>
</record>
<!-- transitions -->
<record id="rec_move_payment_t1" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_confirmed"/>
<field name="signal">confirmed</field>
<field name="group_id" ref="base.group_user"/>
</record>

<record id="rec_move_payment_t3" model="workflow.transition">
<field name="act_from" ref="act_confirmed"/>
<field name="act_to" ref="act_draft"/>
<field name="signal">cancel</field>
</record>
</data>
<record id="rec_move_payment_t3" model="workflow.transition">
<field name="act_from" ref="act_confirmed"/>
<field name="act_to" ref="act_draft"/>
<field name="signal">cancel</field>
</record>

</openerp>
</odoo>

0 comments on commit dd5a273

Please sign in to comment.