OCA / vertical-rental

GNU Affero General Public License v3.0
20 stars 31 forks source link

Migration to version 16.0 #20

Open OCA-git-bot opened 2 years ago

OCA-git-bot commented 2 years ago

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

etoimene commented 8 months ago

Take a look a t work done here! https://github.com/daramousk/vertical-rental/tree/16.0-mig_rental_base

I plan to test it and report back here.

linuxnow commented 3 months ago

Does anybody know if the 16.0 migration is working?

brianredbeard commented 2 months ago

FYI, I've spent a little bit of time testing @daramousk's work in the branch listed above. Over all this is the list of changes I've had to implement thusfar:

Required modules:

Repository           Module
 account-analytic     product_analytic               
 account-closing      account_invoice_start_end_dates
 sale-workflow        sale_order_type                
 sale-workflow        sale_start_end_dates           
 vertical-rental      rental_base                    
 vertical-rental      rental_offday                  
 vertical-rental      rental_pricelist               
 vertical-rental      rental_pricelist_interval      
 vertical-rental      rental_product_pack            

Code changes:

The only code changes were to the sale_view in rental_base.

diff --git a/rental_base/views/sale_view.xml b/rental_base/views/sale_view.xml
index 24625c5..2fb1fa7 100644
--- a/rental_base/views/sale_view.xml
+++ b/rental_base/views/sale_view.xml
@@ -57,7 +57,7 @@
             ref="sale_stock.view_order_form_inherit_sale_stock"
         />
             <field name="arch" type="xml">
-                <xpath expr="//field[@name='product_packaging']" position="attributes">
+                <xpath expr="//field[@name='product_packaging_id']" position="attributes">
                     <attribute name="attrs">{'invisible': 1}</attribute>
                 </xpath>
             </field>
@@ -133,12 +133,6 @@

             <!-- Sale Order Lines -->
             <!-- Hide fields inserted by sale module to move them to new location -->
-            <xpath
-                expr="//group[field[@name='analytic_tag_ids']]"
-                position="attributes"
-            >
-                <attribute name="id">further_rental_info</attribute>
-            </xpath>
             <xpath expr="//field[@name='tax_id']" position="attributes">
                 <attribute name="attrs">{'invisible': 1}</attribute>
             </xpath>
@@ -148,12 +142,6 @@
             <xpath expr="//div[field[@name='customer_lead']]" position="attributes">
                 <attribute name="attrs">{'invisible': 1}</attribute>
             </xpath>
-            <!-- <xpath expr="//label[@for='analytic_tag_ids']" position="attributes">
-                <attribute name="attrs">{'invisible': 1}</attribute>
-            </xpath> -->
-            <xpath expr="//field[@name='analytic_tag_ids']" position="attributes">
-                <attribute name="attrs">{'invisible': 1}</attribute>
-            </xpath>
             <xpath expr="//label[@for='qty_delivered']" position="attributes">
                 <attribute name="attrs">
                     {'invisible': ['|', ('rental', '=', True), ('parent.state', 'not in', ['sale', 'done'])]}
@@ -246,148 +234,6 @@
                 <field name="name" nolabel="1" colspan="2" />
             </xpath>

-            <xpath expr="//group[@id='further_rental_info']" position="inside">
-                <!-- Group: Rental Settings -->
-                <group id="rental_settings" string="Rental Settings" colspan="4">
-                    <field name="rental" />
-                    <field
-                        name="rental_type"
-                        attrs="{'invisible': [('rental', '=', False)],
-                                   'required': [('rental', '=', True)]}"
-                    />
-                    <field
-                        name="extension_rental_id"
-                        options="{'no_quick_create': True, 'no_create_edit': True}"
-                        attrs="{'invisible': [('rental_type', '!=', 'rental_extension')],
-                                   'required': [('rental_type', '=', 'rental_extension')]}"
-                        domain="[('rental_product_id', '=', product_id), ('state', 'in', ('ordered', 'out'))]"
-                    />
-                    <field name="can_sell_rental" invisible="1" />
-                    <field
-                        name="sell_rental_id"
-                        options="{'no_quick_create': True, 'no_create_edit': True}"
-                        attrs="{'invisible': [('can_sell_rental', '=', False)]}"
-                        domain="[('rented_product_id', '=', product_id), ('state', '=', 'out')]"
-                    />
-                </group>
-
-                <!-- Group: Rental Times -->
-                <group
-                    id="rental_times"
-                    string="Rental Times"
-                    colspan="4"
-                    attrs="{'invisible': [('rental', '=', False)]}"
-                >
-                    <field name="number_of_days" />
-                    <label for="product_uom_qty" string="Ordered Rental Time" />
-                    <div>
-                        <field
-                            name="product_uom_qty"
-                            context="{'partner_id':parent.partner_id,
-                                         'quantity':product_uom_qty,
-                                         'pricelist':parent.pricelist_id,
-                                         'uom':product_uom,
-                                         'uom_qty_change':True,
-                                         'company_id': parent.company_id}"
-                            class="oe_inline"
-                        />
-                        <span>&amp;nbsp;</span>
-                        <field
-                            name="product_uom"
-                            force_save="1"
-                            groups="uom.group_uom"
-                            class="oe_inline oe_no_button"
-                            attrs="{'readonly': 1}"
-                        />
-                    </div>
-                    <label
-                        for="qty_delivered"
-                        string="Delivered Rental Quantity"
-                        attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"
-                    />
-                    <div
-                        attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"
-                    >
-                        <field
-                            name="qty_delivered"
-                            attrs="{'readonly': [('qty_delivered_method', '!=', 'manual')]}"
-                            class="oe_inline"
-                        />
-                        <span>&amp;nbsp;</span>
-                        <field
-                            name="rental_qty_uom"
-                            groups="uom.group_uom"
-                            attrs="{'readonly': 1}"
-                            class="oe_inline oe_no_button"
-                        />
-                    </div>
-                    <label
-                        for="qty_invoiced"
-                        string="Invoiced Rental Time"
-                        attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"
-                    />
-                    <div
-                        attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"
-                    >
-                        <field
-                            name="qty_invoiced"
-                            attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"
-                            class="oe_inline"
-                        />
-                        <span>&amp;nbsp;</span>
-                        <field
-                            name="product_uom"
-                            force_save="1"
-                            groups="uom.group_uom"
-                            class="oe_inline oe_no_button"
-                            attrs="{'readonly': 1}"
-                        />
-                    </div>
-                    </group>
-
-                <!-- Group: Transport -->
-                <group id="rental_transport" string="Transport" colspan="4">
-                    <field
-                        name="product_packaging"
-                        attrs="{'invisible': [('product_id', '=', False)]}"
-                        context="{'default_product_id': product_id,
-                                     'tree_view_ref':'product.product_packaging_tree_view',
-                                     'form_view_ref':'product.product_packaging_form_view',
-                                     }"
-                        domain="[('product_id','=',product_id)]"
-                        groups="product.group_stock_packaging"
-                    />
-                    <label for="customer_lead" />
-                    <div>
-                        <field name="customer_lead" class="oe_inline" /> Day(s)
-                    </div>
-                </group>
-
-                <!-- Group: Invoicing -->
-                <group id="rental_invoicing" string="Invoicing" colspan="4">
-                    <field
-                        name="tax_id"
-                        widget="many2many_tags"
-                        options="{'no_create': True}"
-                        context="{'search_view_ref': 'account.account_tax_view_search'}"
-                        domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
-                        attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"
-                    />
-                    <label
-                        for="analytic_tag_ids"
-                        groups="analytic.group_analytic_tags"
-                    />
-                    <div>
-                        <field
-                            name="analytic_tag_ids"
-                            widget="many2many_tags"
-                            groups="analytic.group_analytic_tags"
-                            options="{'color_field': 'color'}"
-                        />
-                    </div>
-                </group>
-
-            </xpath>

         </field>
     </record>
etoimene commented 2 months ago

@brianredbeard , thanks! Nice work! I'll give it a try when I catch some time.