[FIX] hr_expense: Product creation default type

Fix a bug where quick-create of products from the expense form view
would not use the service detailed_type by default. Allowing bugs
when sale_stock module is installed as it would be considered
as a storable product

Also updates the demo data accordingly

task-3458826

closes odoo/odoo#147123

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
This commit is contained in:
Julien Alardot (jual)
2023-12-21 17:25:01 +00:00
parent 63a899ad31
commit f20545370f
2 changed files with 5 additions and 2 deletions
@@ -6,6 +6,7 @@
<field name="name">Meals</field>
<field name="description">Restaurants, business lunches, etc.</field>
<field name="standard_price">0.0</field>
<field name="type">service</field>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FOOD</field>
@@ -30,6 +31,7 @@
<record id="expense_product_mileage" model="product.product">
<field name="name">Mileage</field>
<field name="standard_price">1.0</field>
<field name="type">service</field>
<field name="uom_id" ref="uom.product_uom_km"/>
<field name="uom_po_id" ref="uom.product_uom_km"/>
<field name="default_code">MIL</field>
@@ -42,6 +44,7 @@
<field name="name">Gifts</field>
<field name="description">Gifts to customers or vendors</field>
<field name="standard_price">0.0</field>
<field name="type">service</field>
<field name="uom_id" ref="uom.product_uom_km"/>
<field name="uom_po_id" ref="uom.product_uom_km"/>
<field name="default_code">GIFT</field>
@@ -54,6 +57,7 @@
<field name="name">Communication</field>
<field name="description">Phone bills, postage, etc.</field>
<field name="standard_price">0.0</field>
<field name="type">service</field>
<field name="uom_id" ref="uom.product_uom_km"/>
<field name="uom_po_id" ref="uom.product_uom_km"/>
<field name="default_code">COMM</field>
+1 -2
View File
@@ -167,7 +167,7 @@
<label for="product_id"/>
<div>
<field name="product_id" required="1" readonly="not is_editable"
context="{'default_can_be_expensed': 1, 'tree_view_ref': 'hr_expense.product_product_expense_tree_view', 'form_view_ref': 'hr_expense.product_product_expense_form_view'}"
context="{'default_detailed_type': 'service', 'default_can_be_expensed': 1, 'tree_view_ref': 'hr_expense.product_product_expense_tree_view', 'form_view_ref': 'hr_expense.product_product_expense_form_view'}"
class="w-100"/>
<div class="fst-italic" invisible="not is_editable or not product_description or not product_id">
<field name="product_description"/>
@@ -573,7 +573,6 @@
<group string="General Information">
<field name="active" invisible="1"/>
<field name="type" invisible="1"/>
<field name="detailed_type" invisible="1"/>
<field name="standard_price" class="w-25"
help="When the cost of an expense product is different than 0, then the user
using this product won't be able to change the amount of the expense,