[REF][REM]GOLEM Resource Account : remove useless methods on wizard for adding on invoice
This commit is contained in:
parent
5e27186939
commit
4104fbace9
@ -17,7 +17,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
""" GOLEM Reservation's Adding to invoice wizard"""
|
""" GOLEM Reservation's Adding to invoice wizard"""
|
||||||
|
|
||||||
from odoo import models, fields, api, _
|
from odoo import models, fields
|
||||||
|
|
||||||
class GolemReservationAddToInvoiceWizard(models.TransientModel):
|
class GolemReservationAddToInvoiceWizard(models.TransientModel):
|
||||||
"""GOLEM Reservation Add to Invoice Wizard """
|
"""GOLEM Reservation Add to Invoice Wizard """
|
||||||
@ -25,30 +25,3 @@ class GolemReservationAddToInvoiceWizard(models.TransientModel):
|
|||||||
|
|
||||||
invoice_ids = fields.Many2many('account.invoice', string="Partner invoice list")
|
invoice_ids = fields.Many2many('account.invoice', string="Partner invoice list")
|
||||||
reservation_id = fields.Many2one('golem.resource.reservation')
|
reservation_id = fields.Many2one('golem.resource.reservation')
|
||||||
|
|
||||||
keyword = fields.Char(required=True)
|
|
||||||
member_ids = fields.Many2many('golem.member', string='Members')
|
|
||||||
contact_ids = fields.Many2many('res.partner', string='Contacts')
|
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def action(self):
|
|
||||||
""" Returns action window with current model and instance """
|
|
||||||
self.ensure_one()
|
|
||||||
return {'name' : _('Search results'),
|
|
||||||
'type' : 'ir.actions.act_window',
|
|
||||||
'res_model' : self._name,
|
|
||||||
'res_id': self[0].id,
|
|
||||||
'view_mode': 'form',
|
|
||||||
'target': 'new'}
|
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def search_partners(self):
|
|
||||||
""" Searches partners in name, email """
|
|
||||||
self.ensure_one()
|
|
||||||
domain = ['|',
|
|
||||||
('name', 'ilike', self[0].keyword),
|
|
||||||
('email', 'ilike', self[0].keyword)]
|
|
||||||
partner_ids = self.env['res.partner'].search(domain)
|
|
||||||
self[0].write({'contact_ids': [(6, False, partner_ids.ids)],
|
|
||||||
'member_ids': [(6, False, partner_ids.mapped('member_id').ids)]})
|
|
||||||
return self[0].action()
|
|
||||||
|
@ -24,16 +24,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<field name="model">golem.reservation.add.to.invoice.wizard</field>
|
<field name="model">golem.reservation.add.to.invoice.wizard</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form>
|
<form>
|
||||||
<field name="reservation_id" readonly="1" />
|
<sheet>
|
||||||
<field name="invoice_ids" widget="many2many"
|
<group>
|
||||||
context="{'reservation_id': reservation_id}"
|
<field name="reservation_id" readonly="1" />
|
||||||
readonly="1">
|
<field name="invoice_ids" widget="many2many" readonly="1">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="partner_id" />
|
<field name="partner_id" />
|
||||||
<field name="amount_total" />
|
<field name="amount_total" />
|
||||||
<button name="add_to_invoice" type="object" icon="fa fa-plus-square" />
|
<field name="state" />
|
||||||
</tree>
|
<button name="add_to_invoice" type="object" icon="fa fa-plus-square" />
|
||||||
</field>
|
</tree>
|
||||||
|
</field>
|
||||||
|
</group>
|
||||||
|
</sheet>
|
||||||
<footer>
|
<footer>
|
||||||
<button string="Close" special="cancel" />
|
<button string="Close" special="cancel" />
|
||||||
</footer>
|
</footer>
|
||||||
|
Loading…
Reference in New Issue
Block a user