Skip to content

Commit

Permalink
use stock lot instead of fleet
Browse files Browse the repository at this point in the history
  • Loading branch information
vava-odoo authored and dhrs-odoo committed Jul 16, 2024
1 parent e663f2f commit f552f02
Show file tree
Hide file tree
Showing 13 changed files with 158 additions and 41 deletions.
20 changes: 12 additions & 8 deletions car_rental/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@
'depends': [
'account_followup',
'base_automation',
'crm',
'knowledge',
'purchase_stock',
'sale_purchase',
'sale_renting_crm',
'sale_stock_renting',
'sale_timesheet',
'timesheet_grid',
'payment_demo',
'project_timesheet',
'purchase_stock',
'sale_management',
'web_studio',
'website_crm',
'website_sale_stock',
'website_sale_comparison',
'website_sale_stock_renting',
],
'data': [
'data/base_automation.xml',
Expand All @@ -29,6 +26,11 @@
'data/ir_attachment_pre.xml',
'data/product_category.xml',
'data/project_project.xml',
'data/product_template.xml',
'data/product_attribute.xml',
'data/product_attribute_value.xml',
'data/product_template_attribute_line.xml',
'data/product_template_attribute_value.xml',
'data/product_product.xml',
'data/res_config_settings.xml',
'data/knowledge_cover.xml',
Expand All @@ -47,6 +49,8 @@
'demo/crm_lead.xml',
'demo/product_pricing.xml',
'demo/product_supplierinfo.xml',
'demo/product_product.xml',
'demo/stock_lot.xml',
'demo/purchase_order.xml',
'demo/purchase_order_line.xml',
'demo/purchase_order_confirm.xml',
Expand Down
6 changes: 6 additions & 0 deletions car_rental/data/ir_model_fields.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<record id="new_integer_lot_odometer" model="ir.model.fields">
<field name="name">x_last_odometer</field>
<field name="model_id" ref="stock.model_stock_lot"/>
<field name="field_description">Last Odometer (km)</field>
<field name="ttype">integer</field>
</record>
<record id="new_decimal_analytic_in_odometer" model="ir.model.fields">
<field name="name">x_in_odometer</field>
<field name="model_id" ref="analytic.model_account_analytic_line"/>
Expand Down
30 changes: 30 additions & 0 deletions car_rental/data/ir_ui_view.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<record id="stock_lot_form" model="ir.ui.view">
<field name="inherit_id" ref="stock.view_production_lot_form"/>
<field name="mode">extension</field>
<field name="model">stock.lot</field>
<field name="name">stock.production.lot.form</field>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="name" position="attributes">
<attribute name="string">License Plate</attribute>
</field>
<field name="location_id" position="after">
<field name="x_last_odometer"/>
</field>
</field>
</record>
<record id="stock_lot_tree" model="ir.ui.view">
<field name="inherit_id" ref="stock.view_production_lot_tree"/>
<field name="mode">extension</field>
<field name="model">stock.lot</field>
<field name="name">stock.production.lot.tree</field>
<field name="priority">99</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<data>
<field name="name" position="attributes">
<attribute name="string">License Plate</attribute>
</field>
</data>
</field>
</record>
<record id="project_project_task_form" model="ir.ui.view">
<field name="name">project.task.form.customization</field>
<field name="model">project.task</field>
Expand Down
12 changes: 12 additions & 0 deletions car_rental/data/product_attribute.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="product_attribute_2" model="product.attribute">
<field name="name">Transmission</field>
</record>
<record id="product_attribute_3" model="product.attribute">
<field name="name">Seats</field>
</record>
<record id="product_attribute_4" model="product.attribute">
<field name="name">Vehicle type</field>
</record>
</odoo>
35 changes: 35 additions & 0 deletions car_rental/data/product_attribute_value.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="product_attribute_value_1" model="product.attribute.value">
<field name="attribute_id" ref="product_attribute_2"/>
<field name="name">Automatic</field>
</record>
<record id="product_attribute_value_2" model="product.attribute.value">
<field name="attribute_id" ref="product_attribute_2"/>
<field name="name">Manual</field>
</record>
<record id="product_attribute_value_3" model="product.attribute.value">
<field name="attribute_id" ref="product_attribute_3"/>
<field name="name">2</field>
</record>
<record id="product_attribute_value_4" model="product.attribute.value">
<field name="attribute_id" ref="product_attribute_3"/>
<field name="name">4</field>
</record>
<record id="product_attribute_value_5" model="product.attribute.value">
<field name="attribute_id" ref="product_attribute_3"/>
<field name="name">5</field>
</record>
<record id="product_attribute_value_6" model="product.attribute.value">
<field name="attribute_id" ref="product_attribute_3"/>
<field name="name">7</field>
</record>
<record id="product_attribute_value_7" model="product.attribute.value">
<field name="attribute_id" ref="product_attribute_4"/>
<field name="name">Car</field>
</record>
<record id="product_attribute_value_8" model="product.attribute.value">
<field name="attribute_id" ref="product_attribute_4"/>
<field name="name">Vans</field>
</record>
</odoo>
25 changes: 0 additions & 25 deletions car_rental/data/product_category.xml

This file was deleted.

4 changes: 4 additions & 0 deletions car_rental/data/product_product.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="product_product_3" model="product.product">
<field name="product_template_attribute_value_ids" eval="[(6, 0, [ref('product_template_attribute_value_1'), ref('product_template_attribute_value_4'), ref('product_template_attribute_value_7')])]"/>
<field name="product_tmpl_id" ref="product_template_2"/>
</record>
<record id="product_product_4" model="product.product">
<field name="name">Airport Pickup and Drop</field>
<field name="image_1920" type="base64" file="car_rental/static/src/binary/product_template/6-image_1920"/>
Expand Down
12 changes: 12 additions & 0 deletions car_rental/data/product_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="product_template_2" model="product.template" context="{'create_product_product': False}">
<field name="name">Audi A3</field>
<field name="sale_ok" eval="False"/>
<field name="purchase_ok" eval="False"/>
<field name="detailed_type">product</field>
<field name="rent_ok" eval="True"/>
<field name="service_type">manual</field>
<field name="tracking">serial</field>
</record>
</odoo>
18 changes: 18 additions & 0 deletions car_rental/data/product_template_attribute_line.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="product_template_attribute_line_1" model="product.template.attribute.line" context="{'create_product_product': False}">
<field name="product_tmpl_id" ref="product_template_2"/>
<field name="attribute_id" ref="product_attribute_2"/>
<field name="value_ids" eval="[(6, 0, [ref('product_attribute_value_1')])]"/>
</record>
<record id="product_template_attribute_line_2" model="product.template.attribute.line" context="{'create_product_product': False}">
<field name="product_tmpl_id" ref="product_template_2"/>
<field name="attribute_id" ref="product_attribute_3"/>
<field name="value_ids" eval="[(6, 0, [ref('product_attribute_value_4')])]"/>
</record>
<record id="product_template_attribute_line_3" model="product.template.attribute.line" context="{'create_product_product': False}">
<field name="product_tmpl_id" ref="product_template_2"/>
<field name="attribute_id" ref="product_attribute_4"/>
<field name="value_ids" eval="[(6, 0, [ref('product_attribute_value_7')])]"/>
</record>
</odoo>
15 changes: 15 additions & 0 deletions car_rental/data/product_template_attribute_value.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="product_template_attribute_value_1" model="product.template.attribute.value">
<field name="product_attribute_value_id" ref="product_attribute_value_1"/>
<field name="attribute_line_id" ref="product_template_attribute_line_1"/>
</record>
<record id="product_template_attribute_value_4" model="product.template.attribute.value">
<field name="product_attribute_value_id" ref="product_attribute_value_4"/>
<field name="attribute_line_id" ref="product_template_attribute_line_2"/>
</record>
<record id="product_template_attribute_value_7" model="product.template.attribute.value">
<field name="product_attribute_value_id" ref="product_attribute_value_7"/>
<field name="attribute_line_id" ref="product_template_attribute_line_3"/>
</record>
</odoo>
13 changes: 6 additions & 7 deletions car_rental/data/res_config_settings.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">

<record model="res.config.settings" id="res_config_settings_enable">
<field name="group_discount_per_so_line" eval="1"/>
<field name="group_product_variant" eval="1"/>
<field name="group_rental_stock_picking" eval="1"/>
<field name="group_stock_production_lot" eval="1"/>
<field name="group_lot_on_delivery_slip" eval="1"/>
<field name="add_to_cart_action">go_to_cart</field>
</record>

<function model="res.config.settings" name="execute">
<value eval="[ref('res_config_settings_enable')]"/>
</function>

<function model="res.config.settings" name="execute" eval="[ref('res_config_settings_enable')]"/>
</odoo>
2 changes: 1 addition & 1 deletion car_rental/demo/sale_order_line.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<odoo noupdate="1">
<record id="sale_order_line_2" model="sale.order.line" context="{'in_rental_app': True}">
<field name="order_id" ref="sale_order_1"/>
<field name="product_id" model="product.template" eval="obj().search([('x_vehicle_no', 'ilike', 'Audi/A5/GJ657863')]).id"/>
<field name="product_id" ref="product_product_3"/>
</record>
<record id="sale_order_line_3" model="sale.order.line">
<field name="order_id" ref="sale_order_2"/>
Expand Down
7 changes: 7 additions & 0 deletions car_rental/demo/stock_lot.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<record id="stock_lot_1" model="stock.lot">
<field name="name">2-ABC-123</field>
<field name="product_id" ref="product_product_3"/>
</record>
</odoo>

0 comments on commit f552f02

Please sign in to comment.