Skip to content

Commit

Permalink
[MIG] rental_base: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
edescalona committed Nov 27, 2024
1 parent 03df3ad commit 200a6a7
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 139 deletions.
1 change: 1 addition & 0 deletions rental_base/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"author": "elego Software Solutions GmbH, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/vertical-rental",
"depends": [
"base",
"account",
"product_analytic",
"sale",
Expand Down
16 changes: 0 additions & 16 deletions rental_base/models/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,6 @@ class SaleOrderLine(models.Model):
related="product_id.rented_product_id.uom_id",
)

start_date = fields.Date(
states={
"draft": [("readonly", False)],
"sent": [("readonly", False)],
"sale": [("readonly", False)],
}
)

end_date = fields.Date(
states={
"draft": [("readonly", False)],
"sent": [("readonly", False)],
"sale": [("readonly", False)],
}
)

@api.constrains(
"rental_type",
"extension_rental_id",
Expand Down
62 changes: 26 additions & 36 deletions rental_base/views/res_config_settings_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,42 @@
<field name="priority" eval="10" />
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[hasclass('settings')]" position="inside">
<div
class="app_settings_block"
data-string="Rental"
string="Rental"
data-key="rental_base"
>
<h2>Product</h2>
<div class="row mt16 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="group_product_variant" />
</div>
<div class="o_setting_right_pane">
<label for="group_product_variant" />
<div class="text-muted">
Configure your products with variants
</div>
<div
class="content-group"
attrs="{'invisible': [('group_product_variant','=',False)]}"
>
<div class="mt16">
<button
name="%(product.attribute_action)d"
icon="fa-arrow-right"
type="action"
string="Attributes"
class="btn-link"
/>
</div>
<xpath expr="//form" position="inside">
<app data-string="Rental" string="Rental" name="rental_base">
<block title="Product">
<setting
id="variant_options"
help="Configure your products with variants"
>
<field name="group_product_variant" />
<div
class="content-group"
invisible="not group_product_variant"
>
<div class="mt8">
<button
name="%(product.attribute_action)d"
icon="oi-arrow-right"
type="action"
string="Attributes"
class="btn-link"
/>
</div>
</div>
</div>
</div>
</div>
</setting>
</block>

</app>
</xpath>
</field>
</record>

<record id="action_rental_configuration" model="ir.actions.act_window">
<field name="name">Settings</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.config.settings</field>
<field name="view_id" ref="res_config_settings_view_form" />
<field name="view_mode">form</field>
<field name="target">inline</field>
<field name="context">{'module' : 'rental_base'}</field>
<field name="context">{'module' : 'rental_base', 'bin_size': False}</field>
</record>
</odoo>
Loading

0 comments on commit 200a6a7

Please sign in to comment.