Merge pull request #2194 from expsa/fix_issues_inexpenses

Fix issues in expenses and accounting
This commit is contained in:
enagahh 2025-01-23 01:14:56 +02:00 committed by GitHub
commit 6eb9480588
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -6,7 +6,7 @@
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='ref']" position="before">
<xpath expr="//field[@name='payment_reference']" position="before">
<field name="seq" readonly="1" force_save="1"/>
</xpath>
</field>

View File

@ -58,9 +58,9 @@ class AccountMove(models.Model):
def action_submit_expenses(self):
for record in self:
if record.analytic_account_id.is_analytic_budget:
if record.state == 'draft':
record.write({'state': 'confirm'})
elif record.state == 'confirm' and not record.is_approve:
# if record.state == 'draft':
# record.write({'state': 'confirm'})
if record.state == 'confirm' and not record.is_approve:
raise UserError(_('Please Check Budget First'))
elif record.state == 'confirm' and record.is_approve:
break

View File

@ -27,8 +27,8 @@
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_date']" position="after">
<field name="is_petty_paid" readonly="1"/>
<field name="petty_employee_id" readonly="1"/>
<field name="is_petty_paid" readonly="1" attrs="{'invisible': [('move_type', '!=','in_invoice')]}"/>
<field name="petty_employee_id" readonly="1" attrs="{'invisible': [('move_type', '!=','in_invoice')]}"/>
</xpath>
</field>
</record>