Merge pull request #580 from expsa/dev_odex25_accounting
Dev odex25 accounting
This commit is contained in:
commit
d06c94be4e
|
|
@ -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"/>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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([]):
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue