[WIP] Views

This commit is contained in:
Dario Lodeiros
2019-03-12 18:02:40 +01:00
parent ef4bab656d
commit 5998d1898e
3 changed files with 14 additions and 30 deletions

View File

@@ -10,7 +10,7 @@ class PaymentReturn(models.Model):
@api.multi
def action_confirm(self):
pay = super(PaymentReturn,self).action_confirm()
pay = super(PaymentReturn, self).action_confirm()
if pay:
folio_ids = []
folios = self.env['hotel.folio'].browse(folio_ids)
@@ -20,6 +20,8 @@ class PaymentReturn(models.Model):
])
folios_line = self.env['hotel.folio'].browse(payments.mapped('folio_id.id'))
for folio in folios_line:
if self.id not in folio.return_ids.ids:
folio.update({'return_ids': [(4, self.id)]})
msg = _("Return of %s registered") % (line.amount)
folio.message_post(subject=_('Payment Return'), body=msg)
folios += folios_line

View File

@@ -39,20 +39,6 @@
<sheet>
<div class=" oe_button_box">
<button type="object" class="oe_stat_button"
id="invoices_smart_button"
icon="fa-thumbs-up"
name="action_payments"
attrs="{'invisible': [('invoices_paid','&lt;=',0)]}">
<div class="o_form_field o_stat_info">
<span class="o_stat_value">
<field name="invoices_paid" nolabel="1"
widget="monetary" options="{'currency_field': 'currency_id'}"/>
</span>
<span class="o_stat_text">Paid out</span>
</div>
</button>
<button type="object" class="oe_stat_button"
id="payment_smart_button"
icon="fa-money"
@@ -67,20 +53,6 @@
</div>
</button>
<button type="object" class="oe_stat_button"
id="refunds_smart_button"
icon="fa-undo"
name="action_return_payments"
attrs="{'invisible': [('refund_amount','&lt;=',0)]}">
<div class="o_form_field o_stat_info">
<span class="o_stat_value">
<field name="refund_amount" nolabel="1"
widget="monetary" options="{'currency_field': 'currency_id'}"/>
</span>
<span class="o_stat_text">Refunds</span>
</div>
</button>
<button type="object" class="oe_stat_button" id="invoice_button"
icon="fa-pencil-square-o" name="open_invoices_folio"
attrs="{'invisible': [('invoice_count', '=', 0)]}"
@@ -140,6 +112,8 @@
<field name="invoice_ids" invisible="1"/>
<field name="invoice_status" invisible="1" />
<field name="currency_id" invisible="1"/>
<field name="refund_amount" invisible="1" />
<field name="invoices_paid" invisible="1" />
</group>
<notebook colspan="4" col="1">
<page string="Reservation Rooms">
@@ -194,6 +168,14 @@
</group>
</group>
</page>
<page name="payments" string="Payments" attrs="{'invisible': [('invoices_paid','&lt;=',0)]}">
<field name="payment_ids"
options="{'no_create': True,'no_edit': True}" />
</page>
<page name="returns" string="Retun Payments" attrs="{'invisible': [('refund_amount','&lt;=',0)]}">
<field name="return_ids"
options="{'no_create': True,'no_edit': True}" />
</page>
<page string="Other data" invisible="1">
<group>
<field name="user_id" />

View File

@@ -21,7 +21,7 @@
/> -->
</xpath>
<xpath expr="//page[@name='days']" position="after">
<page name="connector" string="Channel Connector">
<page name="connector" string="Channel Connector" groups="connector.group_connector_manager">
<group string="Hotel Channel Bindings">
<field name="channel_bind_ids" nolabel="1">
<tree>