updates
This commit is contained in:
51
_archived_fusion_faxes/models/account_move.py
Normal file
51
_archived_fusion_faxes/models/account_move.py
Normal file
@@ -0,0 +1,51 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
x_ff_fax_ids = fields.One2many(
|
||||
'fusion.fax',
|
||||
'account_move_id',
|
||||
string='Faxes',
|
||||
)
|
||||
x_ff_fax_count = fields.Integer(
|
||||
string='Fax Count',
|
||||
compute='_compute_fax_count',
|
||||
)
|
||||
|
||||
@api.depends('x_ff_fax_ids')
|
||||
def _compute_fax_count(self):
|
||||
for move in self:
|
||||
move.x_ff_fax_count = len(move.x_ff_fax_ids)
|
||||
|
||||
def action_send_fax(self):
|
||||
"""Open the Send Fax wizard pre-filled with this invoice."""
|
||||
self.ensure_one()
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': 'Send Fax',
|
||||
'res_model': 'fusion_faxes.send.fax.wizard',
|
||||
'view_mode': 'form',
|
||||
'target': 'new',
|
||||
'context': {
|
||||
'active_model': 'account.move',
|
||||
'active_id': self.id,
|
||||
},
|
||||
}
|
||||
|
||||
def action_view_faxes(self):
|
||||
"""Open fax history for this invoice."""
|
||||
self.ensure_one()
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': 'Faxes',
|
||||
'res_model': 'fusion.fax',
|
||||
'view_mode': 'list,form',
|
||||
'domain': [('account_move_id', '=', self.id)],
|
||||
'context': {'default_account_move_id': self.id},
|
||||
}
|
||||
Reference in New Issue
Block a user