Skip to content

Commit

Permalink
[IMP] _pro_receiptbook: archived receiptboks use cases
Browse files Browse the repository at this point in the history
1. Mejoramos para que si el talonario esta archivado no deje consumir número (es para caso de uruguay donde los talonarios de recibos manuales existen y son legales y tienen que tener control de la numeración)
2. Agregamos el open de receipbook para poder ir rápidamente al mismo si es necesario
  • Loading branch information
jjscarafia committed Jan 2, 2025
1 parent 2d59e55 commit 9646b04
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions account_payment_pro_receiptbook/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def action_post(self):
(x.move_id and not x.move_id._get_last_sequence())
)
):
if not rec.receiptbook_id.active:
raise ValidationError(_(
'Error! The receiptbook "%s" is archived. Please use a differente receipbook.'
) % rec.receiptbook_id.name)
if not rec.receiptbook_id.sequence_id:
raise ValidationError(_(
'Error!. Please define sequence on the receiptbook related documents to this payment.'))
Expand Down
2 changes: 1 addition & 1 deletion account_payment_pro_receiptbook/views/account_payment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<field name="inherit_id" ref="account.view_account_payment_form"/>
<field name="arch" type="xml">
<field name="memo" position="after">
<field name="receiptbook_id" invisible="is_internal_transfer or not use_payment_pro" readonly="state != 'draft'" required="state == 'draft'" options='{"no_open": True, "no_create": True}'/>
<field name="receiptbook_id" invisible="is_internal_transfer or not use_payment_pro" readonly="state != 'draft'" required="state == 'draft'" options='{"no_create": True}'/>
</field>
</field>
</record>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<field name="partner_type"/>
<field name="document_type_id"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<separator/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
<separator/>
</search>
</field>
</record>
Expand All @@ -37,6 +40,8 @@
<form string="Receipt Books">
<field name="company_id" invisible="True"/>
<sheet string="Receipt Books">
<widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
<field name="active" invisible="1"/>
<group>
<group>
<field name="name"/>
Expand All @@ -50,7 +55,6 @@
<field name="sequence_id"/>
<field name="next_number"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="active"/>
</group>
</group>
</sheet>
Expand Down

0 comments on commit 9646b04

Please sign in to comment.