Skip to content

Commit

Permalink
[IMP] Demo data.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbcosta committed May 19, 2021
1 parent 10dc380 commit 1f209a8
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 18 deletions.
1 change: 1 addition & 0 deletions l10n_br_delivery/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
'security/ir.model.access.csv',
],
'demo': [
'demo/l10n_br_delivery_demo.xml',
'demo/sale_order_demo.xml',
],
'category': 'Localization',
Expand Down
80 changes: 80 additions & 0 deletions l10n_br_delivery/demo/l10n_br_delivery_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">

<!--
Transportadora res.partner
-->
<record id="test_carrier" model="res.partner">
<field name="name">Transportadora - Teste</field>
<field name="legal_name">Transportadora - Teste</field>
<field name="cnpj_cpf">21.221.265/0001-90</field>
<field name="street">Estrada do Caminho Velho</field>
<field name="street_number">1</field>
<field name="district">Jardim Nova Cidade</field>
<field name="street2"></field>
<field name="state_id" ref="base.state_br_sp"/>
<field name="city_id" ref="l10n_br_base.city_3518800"/>
<field name="zip">07252-312</field>
<field name="country_id" ref="base.br"/>
<field name="website">www.transportadora.com.br</field>
<field name="phone">(11) 9999-9999</field>
<field name="email">[email protected]</field>
<field name="inscr_est">115.106.496.207</field>
<field name="customer" eval="0"/>
<field name="supplier" eval="1"/>
<field name="is_company" eval="1"/>
<field name="active" eval="1"/>
</record>

<!-- Metodo de Entrega -->
<record id="test_br_delivery_carrier" model="delivery.carrier">
<field name="name">Teste - l10n_br_delivery</field>
<field name="fixed_price">10.0</field>
<field name="sequence">3</field>
<field name="delivery_type">fixed</field>
<field name="product_id" ref="delivery.product_product_delivery_normal"/>
<field name="partner_id" ref="test_carrier"/>
</record>

<!-- Resource: stock.inventory -->

<record id="l10n_br_delivery_stock_inventory_0" model="stock.inventory">
<field name="name">Starting Inventory - l10n_br_delivery</field>
</record>

<!-- Resource: stock.inventory.line -->

<record id="l10n_br_delivery_stock_inventory_line_1" model="stock.inventory.line">
<field name="product_id" ref="product.product_delivery_01"/>
<field name="product_uom_id" ref="uom.product_uom_unit"/>
<field name="inventory_id" ref="l10n_br_delivery_stock_inventory_0"/>
<field name="product_qty">100</field>
<field name="location_id" ref="stock.stock_location_stock"/>
</record>

<record id="l10n_br_delivery_stock_inventory_line_2" model="stock.inventory.line">
<field name="product_id" ref="product.product_delivery_02"/>
<field name="product_uom_id" ref="uom.product_uom_unit"/>
<field name="inventory_id" ref="l10n_br_delivery_stock_inventory_0"/>
<field name="product_qty">100</field>
<field name="location_id" ref="stock.stock_location_stock"/>
</record>

<function model="stock.inventory" name="action_validate">
<function eval="[[('state','=','draft'),('id', '=', ref('l10n_br_delivery_stock_inventory_0'))]]" model="stock.inventory" name="search"/>
</function>

<!-- Physical Products -->
<!-- Office Chair -->
<record id="product.product_delivery_01" model="product.product">
<field name="weight">3.0</field>
<field name="volume">1</field>
</record>

<!-- Office Lamp -->
<record id="product.product_delivery_02" model="product.product">
<field name="weight">3.0</field>
<field name="volume">1</field>
</record>

</odoo>
23 changes: 5 additions & 18 deletions l10n_br_delivery/demo/sale_order_demo.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<!-- Physical Products -->
<!-- Office Chair -->
<record id="product.product_delivery_01" model="product.product">
<field name="weight">3.0</field>
<field name="volume">1</field>
</record>

<!-- Office Lamp -->
<record id="product.product_delivery_02" model="product.product">
<field name="weight">3.0</field>
<field name="volume">1</field>
</record>


<!-- Main Company Simples Nacional -->
<!-- Sale Order with only products test -->
<!-- Teste com Transportadora e Incoterms -->
<record id="main_so_delivery_1" model="sale.order">
<field name="name">Main l10n_br_delivery - Produtos</field>
<field name="partner_id" ref="l10n_br_base.res_partner_akretion"/>
Expand All @@ -29,11 +14,13 @@
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_venda"/>
<field name="note">TESTE</field>
<field name="company_id" ref="base.main_company"/>
<field name="incoterm" ref="account.incoterm_FOB"/>
<field name="carrier_id" ref="l10n_br_delivery.test_br_delivery_carrier"/>
</record>

<record id="main_sl_delivery_1_2" model="sale.order.line">
<field name="order_id" ref="main_so_delivery_1"/>
<field name="name">Cadeira de Escritório</field>
<field name="name">Office Chair</field>
<field name="product_id" ref="product.product_delivery_01"/>
<field name="product_uom_qty">2</field>
<field name="product_uom" ref="uom.product_uom_unit"/>
Expand All @@ -56,7 +43,7 @@

<record id="main_sl_delivery_2_2" model="sale.order.line">
<field name="order_id" ref="main_so_delivery_1"/>
<field name="name">Lâmpada de Escritório</field>
<field name="name">Office Lamp</field>
<field name="product_id" ref="product.product_delivery_02"/>
<field name="product_uom_qty">2</field>
<field name="product_uom" ref="uom.product_uom_unit"/>
Expand Down

0 comments on commit 1f209a8

Please sign in to comment.