mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] Invoiced contact page information
This commit is contained in:
@@ -218,10 +218,8 @@ class HotelFolio(models.Model):
|
||||
partner_invoice_country_id = fields.Many2one(related="partner_invoice_id.country_id")
|
||||
partner_invoice_email = fields.Char(related="partner_invoice_id.email")
|
||||
partner_invoice_lang = fields.Selection(related="partner_invoice_id.lang")
|
||||
partner_invoice_type = fields.Selection(related="partner_invoice_id.type")
|
||||
partner_invoice_parent_id = fields.Many2one(related="partner_invoice_id.parent_id")
|
||||
partner_parent_id = fields.Many2one(related="partner_id.parent_id")
|
||||
fiscal_position_id = fields.Many2one('account.fiscal.position', oldname='fiscal_position', string='Fiscal Position')
|
||||
partner_diff_invoicing = fields.Boolean('Bill to another Address', default='_default_diff_invoicing')
|
||||
|
||||
#WorkFlow Mail Fields-----------------------------------------------
|
||||
has_confirmed_reservations_to_send = fields.Boolean(
|
||||
@@ -416,8 +414,7 @@ class HotelFolio(models.Model):
|
||||
res = {}
|
||||
onchange_fields = ['partner_invoice_id',
|
||||
'pricelist_id',
|
||||
'payment_term_id',
|
||||
'partner_diff_invoicing']
|
||||
'payment_term_id']
|
||||
if values.get('partner_id'):
|
||||
line = self.new(values)
|
||||
if any(f not in values for f in onchange_fields):
|
||||
@@ -442,7 +439,6 @@ class HotelFolio(models.Model):
|
||||
'partner_invoice_id': False,
|
||||
'payment_term_id': False,
|
||||
'fiscal_position_id': False,
|
||||
'partner_diff_invoicing': False,
|
||||
})
|
||||
return
|
||||
|
||||
@@ -455,7 +451,6 @@ class HotelFolio(models.Model):
|
||||
'payment_term_id': self.partner_id.property_payment_term_id and self.partner_id.property_payment_term_id.id or False,
|
||||
'partner_invoice_id': addr['invoice'],
|
||||
'user_id': self.partner_id.user_id.id or self.env.uid,
|
||||
'partner_diff_invoicing': False if self.partner_id.id == addr['invoice'] else True
|
||||
}
|
||||
|
||||
if self.env['ir.config_parameter'].sudo().get_param('sale.use_sale_note') and \
|
||||
@@ -477,13 +472,6 @@ class HotelFolio(models.Model):
|
||||
)}
|
||||
self.update(values)
|
||||
|
||||
@api.onchange('partner_diff_invoicing')
|
||||
def onchange_partner_diff_invoicing(self):
|
||||
if self.partner_diff_invoicing is False:
|
||||
self.update({'partner_invoice_id': self.partner_id.id})
|
||||
elif self.partner_id == self.partner_invoice_id:
|
||||
self.update({'partner_invoice_id': self.partner_id.address_get(['invoice'])['invoice'] or None})
|
||||
|
||||
@api.onchange('partner_invoice_id')
|
||||
def onchange_partner_invoice_id(self):
|
||||
if self.partner_invoice_id and not self.partner_invoice_id.parent_id and \
|
||||
|
||||
@@ -221,10 +221,8 @@ class HotelReservation(models.Model):
|
||||
partner_invoice_country_id = fields.Many2one(related="partner_invoice_id.country_id")
|
||||
partner_invoice_email = fields.Char(related="partner_invoice_id.email")
|
||||
partner_invoice_lang = fields.Selection(related="partner_invoice_id.lang")
|
||||
partner_invoice_type = fields.Selection(related="partner_invoice_id.type")
|
||||
partner_invoice_parent_id = fields.Many2one(related="partner_invoice_id.parent_id")
|
||||
partner_parent_id = fields.Many2one(related="partner_id.parent_id")
|
||||
closure_reason_id = fields.Many2one(related='folio_id.closure_reason_id')
|
||||
partner_diff_invoicing = fields.Boolean('Bill to another Address', default='_default_diff_invoicing')
|
||||
company_id = fields.Many2one(related='folio_id.company_id', string='Company', store=True, readonly=True)
|
||||
reservation_line_ids = fields.One2many('hotel.reservation.line',
|
||||
'reservation_id',
|
||||
@@ -655,7 +653,6 @@ class HotelReservation(models.Model):
|
||||
values = {
|
||||
'pricelist_id': pricelist,
|
||||
'partner_invoice_id': addr['invoice'],
|
||||
'partner_diff_invoicing': False if self.partner_id.id == addr['invoice'] else True
|
||||
}
|
||||
self.update(values)
|
||||
|
||||
@@ -761,13 +758,6 @@ class HotelReservation(models.Model):
|
||||
]
|
||||
return {'domain': {'room_id': domain_rooms}}
|
||||
|
||||
@api.onchange('partner_diff_invoicing')
|
||||
def onchange_partner_diff_invoicing(self):
|
||||
if self.partner_diff_invoicing is False:
|
||||
self.update({'partner_invoice_id': self.partner_id.id})
|
||||
elif self.partner_id == self.partner_invoice_id:
|
||||
self.update({'partner_invoice_id': self.partner_id.address_get(['invoice'])['invoice'] or None})
|
||||
|
||||
@api.onchange('partner_invoice_id')
|
||||
def onchange_partner_invoice_id(self):
|
||||
if self.partner_invoice_id and not self.partner_invoice_id.parent_id and \
|
||||
|
||||
@@ -135,13 +135,13 @@
|
||||
/>
|
||||
</page>
|
||||
<page name="invoicing" string="Invoicing">
|
||||
<div class="alert alert-info" role="alert" style="margin-bottom:0px;">
|
||||
these are the billing information associated with the booking client or the company (if a company is assigned). If you want to bill an independent contact, you can select it in the billing assistant
|
||||
</div>
|
||||
<group>
|
||||
<field name="partner_diff_invoicing" string="Bill to another Address"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="partner_parent_id" />
|
||||
<field name="partner_invoice_id"
|
||||
string="Contact Invoiced"
|
||||
attrs="{'invisible':[('partner_diff_invoicing','=',False)]}"/>
|
||||
string="Contact Invoiced"/>
|
||||
</group>
|
||||
<group>
|
||||
<group>
|
||||
@@ -152,10 +152,6 @@
|
||||
attrs="{'readonly': [('partner_invoice_id', '!=', False),
|
||||
('partner_invoice_email','!=', False)]}" />
|
||||
</group>
|
||||
<group>
|
||||
<field name="partner_invoice_parent_id" />
|
||||
<field name="partner_invoice_type" />
|
||||
</group>
|
||||
<group>
|
||||
<label for="partner_invoice_street" string="Address"/>
|
||||
<div class="o_address_format">
|
||||
|
||||
@@ -318,22 +318,15 @@
|
||||
attrs="{'invisible': ['|',('reservation_type','in',('out')),
|
||||
('parent_reservation','!=',False)]}">
|
||||
<group>
|
||||
<field name="partner_diff_invoicing" string="Bill to another Address"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="partner_invoice_id"
|
||||
string="Contact Invoiced"
|
||||
attrs="{'invisible':[('partner_diff_invoicing','=',False)]}"/>
|
||||
<field name="partner_parent_id" />
|
||||
<field name="partner_invoice_id"
|
||||
string="Contact Invoiced"/>
|
||||
</group>
|
||||
<group>
|
||||
<group>
|
||||
<field name="partner_invoice_vat" />
|
||||
<field name="partner_invoice_email" />
|
||||
</group>
|
||||
<group>
|
||||
<field name="partner_invoice_parent_id" />
|
||||
<field name="partner_invoice_type" />
|
||||
</group>
|
||||
<group>
|
||||
<label for="partner_invoice_street" string="Address"/>
|
||||
<div class="o_address_format">
|
||||
|
||||
Reference in New Issue
Block a user