Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] refactor test and fix them, solve issue with description #7

Open
wants to merge 3 commits into
base: 8.0-holding-invoicing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions multi_company_holding_invoicing/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
'views/product_view.xml',
],
'demo': [
'demo/product_demo.xml',
'demo/res_company_demo.xml',
'demo/res_users_demo.xml',
'demo/sales_team_demo.xml',
Expand Down
16 changes: 16 additions & 0 deletions multi_company_holding_invoicing/demo/product_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<record id="holding_product" model="product.product">
<field name="name">Holding Product</field>
<field name="categ_id" ref="product.product_category_all"/>
<field name="sale_ok" eval="True"/>
</record>

<record id="holding_royalty_product" model="product.product">
<field name="name">Holding Royalty Product</field>
<field name="categ_id" ref="product.product_category_all"/>
<field name="sale_ok" eval="True"/>
</record>

</odoo>
174 changes: 32 additions & 142 deletions multi_company_holding_invoicing/demo/sale_order_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<data noupdate="1">

<record id="sale_order_1" model="sale.order">
<field name="client_order_ref">Custom REF 1</field>
<field name="partner_id" ref="base.res_partner_2"/>
<field name="partner_invoice_id" ref="base.res_partner_2"/>
<field name="partner_shipping_id" ref="base.res_partner_2"/>
Expand All @@ -17,20 +18,20 @@
<field name="order_id" ref="sale_order_1"/>
<field name="name">Laptop E5023</field>
<field name="product_id" ref="product.product_product_25"/>
<field name="product_uom_qty">3</field>
<field name="product_uos_qty">3</field>
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">2950.00</field>
<field name="price_unit">1850.00</field>
</record>

<record id="sale_order_line_2" model="sale.order.line">
<field name="order_id" ref="sale_order_1"/>
<field name="name">Pen drive, 16GB</field>
<field name="product_id" ref="product.product_product_30"/>
<field name="product_uom_qty">5</field>
<field name="product_uos_qty">5</field>
<field name="product_uom_qty">10</field>
<field name="product_uos_qty">10</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">145.00</field>
<field name="price_unit">10.00</field>
</record>

<record id="sale_order_line_3" model="sale.order.line">
Expand All @@ -40,7 +41,7 @@
<field name="product_uom_qty">2</field>
<field name="product_uos_qty">2</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">65.00</field>
<field name="price_unit">25.00</field>
</record>

<record id="sale_order_2" model="sale.order">
Expand All @@ -62,20 +63,21 @@
<field name="product_uom_qty">3</field>
<field name="product_uos_qty">3</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">2950.00</field>
<field name="price_unit">300.00</field>
</record>

<record id="sale_order_line_5" model="sale.order.line">
<field name="order_id" ref="sale_order_2"/>
<field name="name">Pen drive, 16GB</field>
<field name="product_id" ref="product.product_product_30"/>
<field name="product_uom_qty">5</field>
<field name="product_uos_qty">5</field>
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">145.00</field>
<field name="price_unit">100.00</field>
</record>

<record id="sale_order_3" model="sale.order">
<field name="client_order_ref">Custom REF 3</field>
<field name="partner_id" ref="base.res_partner_14"/>
<field name="partner_invoice_id" ref="base.res_partner_14"/>
<field name="partner_shipping_id" ref="base.res_partner_14"/>
Expand All @@ -90,10 +92,10 @@
<field name="order_id" ref="sale_order_3"/>
<field name="name">Laptop E5023</field>
<field name="product_id" ref="product.product_product_25"/>
<field name="product_uom_qty">3</field>
<field name="product_uos_qty">3</field>
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">2950.00</field>
<field name="price_unit">300.00</field>
</record>

<record id="sale_order_line_7" model="sale.order.line">
Expand All @@ -103,7 +105,7 @@
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">70.00</field>
<field name="price_unit">200.00</field>
</record>

<record id="sale_order_4" model="sale.order">
Expand All @@ -123,37 +125,37 @@
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">70.00</field>
<field name="price_unit">40.00</field>
</record>

<record id="sale_order_line_9" model="sale.order.line">
<field name="order_id" ref="sale_order_4"/>
<field name="name">Webcam</field>
<field name="product_id" ref="product.product_product_34"/>
<field name="product_uom_qty">10</field>
<field name="product_uos_qty">10</field>
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">45.00</field>
<field name="price_unit">20.00</field>
</record>

<record id="sale_order_line_10" model="sale.order.line">
<field name="order_id" ref="sale_order_4"/>
<field name="name">Multimedia Speakers</field>
<field name="product_id" ref="product.product_product_31"/>
<field name="product_uom_qty">3</field>
<field name="product_uos_qty">3</field>
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">150.00</field>
<field name="price_unit">10.00</field>
</record>

<record id="sale_order_line_11" model="sale.order.line">
<field name="order_id" ref="sale_order_4"/>
<field name="name">Switch, 24 ports</field>
<field name="product_id" ref="product.product_product_47"/>
<field name="product_uom_qty">2</field>
<field name="product_uos_qty">2</field>
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">70.00</field>
<field name="price_unit">30.00</field>
</record>

<record id="sale_order_5" model="sale.order">
Expand All @@ -174,17 +176,17 @@
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">405.00</field>
<field name="price_unit">10.00</field>
</record>

<record id="sale_order_line_13" model="sale.order.line">
<field name="order_id" ref="sale_order_5"/>
<field name="name">Blank DVD-RW</field>
<field name="product_id" ref="product.product_product_36"/>
<field name="product_uom_qty">3</field>
<field name="product_uos_qty">3</field>
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_dozen"/>
<field name="price_unit">24.00</field>
<field name="price_unit">35.00</field>
</record>

<record id="sale_order_line_14" model="sale.order.line">
Expand All @@ -194,120 +196,8 @@
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">4410.00</field>
</record>

<record id="sale_order_6" model="sale.order">
<field name="partner_id" ref="base.res_partner_18"/>
<field name="partner_invoice_id" ref="base.res_partner_18"/>
<field name="partner_shipping_id" ref="base.res_partner_18"/>
<field name="user_id" ref="base.user_root"/>
<field name="pricelist_id" ref="product.list0"/>
<field name="section_id" ref="section_market_2"/>
<field name="company_id" ref="child_company_a"/>
</record>

<record id="sale_order_line_15" model="sale.order.line">
<field name="order_id" ref="sale_order_6"/>
<field name="name">PC Assamble + 2GB RAM</field>
<field name="product_id" ref="product.product_product_4"/>
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">750.00</field>
</record>

<record id="sale_order_7" model="sale.order">
<field name="partner_id" ref="base.res_partner_11"/>
<field name="partner_invoice_id" ref="base.res_partner_address_20"/>
<field name="partner_shipping_id" ref="base.res_partner_address_20"/>
<field name="user_id" ref="base.user_root"/>
<field name="pricelist_id" ref="product.list0"/>
<field name="order_policy">manual</field>
<field name="section_id" ref="section_market_2"/>
<field name="company_id" ref="child_company_b"/>
<field name="date_confirm" eval="(DateTime.today() - relativedelta(months=1)).strftime('%Y-%m-%d %H:%M')"/>
</record>

<record id="sale_order_line_16" model="sale.order.line">
<field name="order_id" ref="sale_order_7"/>
<field name="name">Laptop E5023</field>
<field name="product_id" ref="product.product_product_25"/>
<field name="product_uom_qty">5</field>
<field name="product_uos_qty">5</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">2950.00</field>
</record>

<record id="sale_order_line_17" model="sale.order.line">
<field name="order_id" ref="sale_order_7"/>
<field name="name">GrapWorks Software</field>
<field name="product_id" ref="product.product_product_44"/>
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">173.00</field>
</record>

<record id="sale_order_line_18" model="sale.order.line">
<field name="order_id" ref="sale_order_7"/>
<field name="name">Datacard</field>
<field name="product_id" ref="product.product_product_46"/>
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">40.00</field>
</record>

<record id="sale_order_line_19" model="sale.order.line">
<field name="order_id" ref="sale_order_7"/>
<field name="name">USB Adapter</field>
<field name="product_id" ref="product.product_product_48"/>
<field name="product_uom_qty">1</field>
<field name="product_uos_qty">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">18.00</field>
</record>

<record id="sale_order_8" model="sale.order">
<field name="partner_id" ref="base.res_partner_15"/>
<field name="partner_invoice_id" ref="base.res_partner_address_25"/>
<field name="partner_shipping_id" ref="base.res_partner_address_25"/>
<field name="user_id" ref="base.user_demo"/>
<field name="pricelist_id" ref="product.list0"/>
<field name="order_policy">manual</field>
<field name="section_id" ref="section_market_2"/>
<field name="company_id" ref="child_company_b"/>
</record>

<record id="sale_order_line_20" model="sale.order.line">
<field name="order_id" ref="sale_order_8"/>
<field name="name">Laptop Customized</field>
<field name="product_id" ref="product.product_product_27"/>
<field name="product_uom_qty">2</field>
<field name="product_uos_qty">2</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">3645.00</field>
</record>

<record id="sale_order_line_21" model="sale.order.line">
<field name="order_id" ref="sale_order_8"/>
<field name="name">Mouse, Wireless</field>
<field name="product_id" ref="product.product_product_12"/>
<field name="product_uom_qty">2</field>
<field name="product_uos_qty">2</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="price_unit">12.50</field>
<field name="price_unit">5.00</field>
</record>

<workflow action="order_confirm" model="sale.order" ref="sale_order_1"/>
<workflow action="order_confirm" model="sale.order" ref="sale_order_2"/>
<!-- Confirm some Sale Orders
<workflow action="order_confirm" model="sale.order" ref="sale_order_3"/>
<workflow action="order_confirm" model="sale.order" ref="sale_order_4"/>
<workflow action="order_confirm" model="sale.order" ref="sale_order_5"/>
<workflow action="order_confirm" model="sale.order" ref="sale_order_5"/>
<workflow action="order_confirm" model="sale.order" ref="sale_order_5"/>
-->
</data>
</openerp>
16 changes: 4 additions & 12 deletions multi_company_holding_invoicing/demo/sales_team_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,16 @@
<field name="name">Holding Market 1</field>
<field name="holding_company_id" ref="base.main_company"/>
<field name="holding_discount">10</field>
<field
name="holding_product_id"
ref="account_invoice_inter_company.product_consultant_multi_company"/>
<field
name="holding_royalty_product_id"
ref="account_invoice_inter_company.product_consultant_multi_company"/>
<field name="holding_product_id" ref="holding_product"/>
<field name="holding_royalty_product_id" ref="holding_royalty_product"/>
</record>

<record id="section_market_2" model="crm.case.section">
<field name="name">Holding Market 2</field>
<field name="holding_company_id" ref="base.main_company"/>
<field name="holding_discount">15</field>
<field
name="holding_product_id"
ref="account_invoice_inter_company.product_consultant_multi_company"/>
<field
name="holding_royalty_product_id"
ref="account_invoice_inter_company.product_consultant_multi_company"/>
<field name="holding_product_id" ref="holding_product"/>
<field name="holding_royalty_product_id" ref="holding_royalty_product"/>
</record>

</data>
Expand Down
Loading