[WIP] Migration Basic Views and Inherited models

This commit is contained in:
Darío Lodeiros
2020-10-15 10:25:42 +02:00
parent d81ec9c6f1
commit 8b72e63b1f
5 changed files with 35 additions and 58 deletions

View File

@@ -102,7 +102,7 @@ class PmsReservationLine(models.Model):
].rooms_available(
checkin=line.date,
checkout=line.date + timedelta(1),
room_type_id=self.reservation_id.room_type_id.id or False,
room_type_id=line.reservation_id.room_type_id.id or False,
current_lines=line._origin.id,
)
if rooms_available:
@@ -115,7 +115,7 @@ class PmsReservationLine(models.Model):
line.room_id = False
raise ValidationError(
_("%s: No rooms available")
% (self.reservation_id.room_type_id.name)
% (line.reservation_id.room_type_id.name)
)
line._check_adults()
else:

View File

@@ -9,14 +9,6 @@
<field name="from_folio" invisible="1" />
<field name="pms_property_id" invisible="1" />
</xpath>
<xpath
expr="//button[@name='action_invoice_register_payment']"
position="attributes"
>
<attribute
name="attrs"
>{'invisible': ['|',('from_folio','=',True)]}</attribute>
</xpath>
<xpath
expr="//field[@name='invoice_outstanding_credits_debits_widget']"
position="before"

View File

@@ -4,7 +4,7 @@
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='communication']" position="after">
<xpath expr="//field[@name='date']" position="after">
<field name="folio_id" />
<field name="save_amount" invisible="1" />
<field name="save_journal_id" invisible="1" />
@@ -68,7 +68,7 @@
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button
<!-- <button
class="oe_stat_button"
name="button_journal_entries"
string="Journal Items"
@@ -76,26 +76,26 @@
groups="account.group_account_user"
attrs="{'invisible':[('move_line_ids','=',[])]}"
icon="fa-bars"
/>
<field name="move_line_ids" invisible="1" />
<button
/> -->
<!-- <field name="move_line_ids" invisible="1" /> -->
<!-- <button
class="oe_stat_button"
name="button_invoices"
string="Invoices"
type="object"
attrs="{'invisible':[('has_invoices','=',False)]}"
icon="fa-bars"
/>
<button
/> -->
<!-- <button
class="oe_stat_button"
name="open_payment_matching_screen"
string="Payment Matching"
type="object"
attrs="{'invisible':[('move_reconciled','=',True)]}"
icon="fa-university"
/>
<field name="has_invoices" invisible="1" />
<field name="move_reconciled" invisible="1" />
/> -->
<!-- <field name="has_invoices" invisible="1" />
<field name="move_reconciled" invisible="1" /> -->
</div>
<field name="id" invisible="1" />
<div
@@ -141,14 +141,14 @@
/>
</div>
<field name="journal_id" widget="selection" />
<field
<!-- <field
name="destination_journal_id"
widget="selection"
attrs="{
'required': [('payment_type', '=', 'transfer')],
'invisible': [('payment_type', '!=', 'transfer')],
'readonly': [('state', '!=', 'draft')]}"
/>
/> -->
<field name="hide_payment_method" invisible="1" />
<field
name="payment_method_id"
@@ -157,13 +157,15 @@
attrs="{'invisible': [('hide_payment_method', '=', True)]}"
/>
<field name="payment_method_code" invisible="1" />
<field name="suitable_journal_ids" invisible="1" />
<field name="available_payment_method_ids" invisible="1" />
</group>
<group>
<field name="payment_date" />
<field
<!-- <field name="payment_date" /> -->
<!-- <field
name="communication"
attrs="{'invisible': [('state', '!=', 'draft'), ('communication', '=', False)]}"
/>
/> -->
<field name="folio_id" readonly="1" force_save="1" />
</group>
</group>
@@ -192,7 +194,7 @@
decoration-muted="state in ['reconciled', 'cancelled']"
edit="false"
>
<field name="payment_date" />
<!-- <field name="payment_date" /> -->
<field name="name" />
<field name="journal_id" />
<field name="payment_method_id" />

View File

@@ -5,7 +5,7 @@
<field name="model">pms.folio</field>
<field name="arch" type="xml">
<form string="Folio">
<header>out_to_send" invisible="1" /> -->
<header>
<button
name="action_confirm"
states="draft"
@@ -61,14 +61,12 @@
<h1>
<field
name="partner_id"
default_focus="1"
placeholder="Guest"
attrs="{'invisible':[('reservation_type','in',('out'))]}"
/>
<field
name="closure_reason_id"
placeholder="Closure reason"
default_focus="1"
attrs="{'invisible':[('reservation_type','not in',('out'))]}"
/>
</h1>
@@ -142,7 +140,7 @@
<field name="move_ids" invisible="1" />
<field name="invoice_status" invisible="1" />
<field name="currency_id" invisible="1" />
<field name="refund_amount" invisible="1" />
<!--<field name="refund_amount" invisible="1" />-->
<field name="invoices_paid" invisible="1" />
</group>
<notebook colspan="4" col="1">
@@ -200,13 +198,13 @@
options="{'no_create': True}"
/>
</page>
<!-- <page
<!-- <page
name="returns"
string="Retun Payments"
attrs="{'invisible': [('refund_amount','&lt;=',0)]}"
> -->
>
<field name="return_ids" options="{'no_create': True}" />
</page>
</page> -->
<page string="Other data" invisible="1">
<group>
<field name="user_id" />
@@ -230,9 +228,9 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
@@ -270,7 +268,7 @@
<field name="reservation_ids" />
<field name="service_ids" />
<field name="pending_amount" />
<field name="refund_amount" />
<!-- <field name="refund_amount" /> -->
<field name="invoices_paid" />
<field name="booking_pending" />
<field name="checkin_partner_count" />
@@ -367,7 +365,7 @@
</field>
</record>
<!-- Add create invoice merge folio -->
<act_window
<!-- <act_window
name="Send Confirm Mail"
res_model="mail.compose.message"
binding_model="pms.folio"
@@ -383,7 +381,7 @@
'force_send': True,
'mark_so_as_sent': True,
}"
/>
/> -->
<record model="ir.actions.act_window" id="open_pms_folio1_form_tree_all">
<field name="name">Folio</field>
<field name="res_model">pms.folio</field>

View File

@@ -117,7 +117,7 @@
id="payment_smart_button"
icon="fa-money"
name="action_pay_folio"
attrs="{'invisible': ['|',('folio_pending_amount','&lt;=',0)]}"
attrs="{'invisible': [('folio_pending_amount','&lt;=',0)]}"
>
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
@@ -182,21 +182,6 @@
placeholder="Closure Reason"
attrs="{'invisible':[('reservation_type','not in',('out'))]}"
/>
<span
class="fa fa-user"
style="margin-left:20px;"
attrs="{'invisible': [('reservation_type','not in',('normal'))]}"
/>
<span
class="fa fa-black-tie"
style="margin-left:20px; color: #C67;"
attrs="{'invisible': [('reservation_type','not in',('staff'))]}"
/>
<span
class="fa fa-ban"
style="margin-left:20px; color: #9C4747;"
attrs="{'invisible': [('reservation_type','not in',('out'))]}"
/>
</h1>
<h3>
<group>
@@ -538,9 +523,9 @@
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
<field name="message_follower_ids" />
<field name="activity_ids" />
<field name="message_ids" />
</div>
</form>
</field>