Merge pull request #580 from expsa/dev_odex25_accounting

Dev odex25 accounting
This commit is contained in:
Mostafa 2024-08-07 15:24:38 +03:00 committed by GitHub
commit d06c94be4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 3 additions and 78 deletions

View File

@ -85,9 +85,6 @@
<field name="date_from" type="col"/>
<field name="date_to" type="col"/>
<field name="planned_amount" type="measure"/>
<field name="provide" type="measure"/>
<field name="pull_out" type="measure"/>
<field name="final_amount" type="measure"/>
<field name="practical_amount" type="measure"/>
<field name="theoritical_amount" type="measure"/>
<field name="percentage" type="measure"/>
@ -103,9 +100,6 @@
<field name="crossovered_budget_id"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" type="row"/>
<field name="planned_amount" type="measure"/>
<field name="provide" type="measure"/>
<field name="pull_out" type="measure"/>
<field name="final_amount" type="measure"/>
<field name="practical_amount" type="measure"/>
<field name="theoritical_amount" type="measure"/>
<field name="percentage" type="measure"/>

View File

@ -26,42 +26,5 @@
</field>
</record>
<record id="view_crossovered_budget_line_tree" model="ir.ui.view">
<field name="name">crossovered.budget.lines.tree</field>
<field name="model">crossovered.budget.lines</field>
<field name="inherit_id" ref="account_budget_custom.view_crossovered_budget_line_tree"/>
<field name="arch" type="xml">
<field name="final_amount" position="after">
<field name="reserve" optional="show"/>
<field name="confirm" optional="show"/>
</field>
</field>
</record>
<record id="view_crossovered_budget_line_pivot" model="ir.ui.view">
<field name="name">crossovered.budget.lines.tree</field>
<field name="model">crossovered.budget.lines</field>
<field name="inherit_id" ref="account_budget_custom.view_crossovered_budget_line_pivot"/>
<field name="arch" type="xml">
<field name="final_amount" position="after">
<field name="reserve" optional="show"/>
<field name="confirm" optional="show"/>
</field>
</field>
</record>
<record id="view_crossovered_budget_line_graph" model="ir.ui.view">
<field name="name">crossovered.budget.lines.tree</field>
<field name="model">crossovered.budget.lines</field>
<field name="inherit_id" ref="account_budget_custom.view_crossovered_budget_line_graph"/>
<field name="arch" type="xml">
<field name="final_amount" position="after">
<field name="reserve" optional="show"/>
<field name="confirm" optional="show"/>
</field>
</field>
</record>
</data>
</odoo>

View File

@ -6,8 +6,6 @@ from odoo.exceptions import UserError
class AccountPayment(models.Model):
_inherit = "account.payment"
analytic_account_id = fields.Many2one('account.analytic.account', string='Analytic Account', copy=False)
def action_open_manual_reconciliation_widget(self):
''' Open the manual reconciliation widget for the current payment.
:return: A dictionary representing an action.
@ -32,31 +30,4 @@ class AccountPayment(models.Model):
'type': 'ir.actions.client',
'tag': 'manual_reconciliation_view',
'context': action_context,
}
def action_post(self):
res = super(AccountPayment, self).action_post()
for payment in self:
payment.state= 'posted'
if payment.analytic_account_id and payment.move_id:
for line in payment.move_id.line_ids:
line.analytic_account_id = payment.analytic_account_id.id
return res
def action_cancel(self):
res = super(AccountPayment, self).action_cancel()
for payment in self:
payment.state= 'cancel'
if payment.analytic_account_id and payment.move_id:
for line in payment.move_id.line_ids:
line.analytic_account_id = payment.analytic_account_id.id
return res
def action_draft(self):
res = super(AccountPayment, self).action_draft()
for payment in self:
payment.state= 'draft'
if payment.analytic_account_id and payment.move_id:
for line in payment.move_id.line_ids:
line.analytic_account_id = payment.analytic_account_id.id
return res
}

View File

@ -8,10 +8,6 @@
<xpath expr="//field[@name='move_id']" position="attributes">
<attribute name="groups">account.group_account_manager</attribute>
</xpath>
<xpath expr="//field[@name='move_id']" position="after">
<field name="analytic_account_id"/>
</xpath>
<!-- Stat button to open the manual reconciliation widget -->
<xpath expr="//div[@name='button_box']" position="inside">
<button name="action_open_manual_reconciliation_widget" type="object"

View File

@ -43,6 +43,7 @@ class AccountBudgetPost(models.Model):
for budget in self:
if self.env['crossovered.budget.lines'].search_count([('general_budget_id', '=', budget.id)]):
raise ValidationError(_('You cannot delete a budget that is used in a budget line.'))
return super(AccountBudgetPost, self).unlink()
@api.constrains('account_ids')
def check_account_only_exist_in_one_budget(self):
for budget in self.search([]):

View File

@ -40,4 +40,4 @@ class AccountPayment(models.Model):
if res.analytic_account_id and res.move_id:
for line in res.move_id.line_ids:
line.analytic_account_id = res.analytic_account_id.id
return res
return res