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

[17.0][MIG] sale_rental #52

Open
wants to merge 95 commits into
base: 17.0
Choose a base branch
from

Conversation

edescalona
Copy link

@edescalona edescalona commented Nov 27, 2024

@BinhexTeam
For the migration of this module sale_rental use PR #46 as a base

Alexis de Lattre and others added 30 commits November 27, 2024 11:19
Replace openerp by odoo in import declarations
Convert readme to new subdir format
the creation of the stock location for rental respects the translations
Currently translated at 85.4% (88 of 103 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_rental
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_rental/pt_BR/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_rental
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_rental/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_rental
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_rental/
Currently translated at 9.7% (10 of 103 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_rental
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_rental/pt/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_rental
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_rental/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_rental
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_rental/
No more need to add users to the packaging group
View of rental group is now possible on product.template form view
Standard migration + add some tests
@rousseldenis
Copy link

/ocabot migration sale_rental

Copy link

@remi-filament remi-filament left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @edescalona for porting this module.
I discovered it with your PR, it seems to be working fine.
However, display on products and sale order could be improved !

<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="arch" type="xml">
<group name="sale" position="after">
<group name="rental" string="Rental" invisible="type != 'service'">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<group name="rental" string="Rental" invisible="type != 'service'">
<group name="rental" string="Rental" invisible="detailed_type != 'service'">

You should use the new field detailed_type here I suppose since type is computed from this new field.

Comment on lines +45 to +71
<group name="sale" position="inside">
<label
for="rented_product_tmpl_id"
string="Rental"
invisible="type != 'service' or product_variant_count &gt; 1"
/>
<field
name="rented_product_tmpl_id"
invisible="type != 'service' or product_variant_count &gt; 1"
/>
<label
for="rental_service_tmpl_ids"
string="Rental Services"
invisible="type == 'service' or product_variant_count &gt; 1"
/>
<field
name="rental_service_tmpl_ids"
nolabel="1"
invisible="rental_service_tmpl_ids == []"
/>
<button
type="action"
name="%(sale_rental.create_rental_product_action)d"
string="Create Rental Service"
invisible="type == 'service' or product_variant_count &gt; 1"
/>
</group>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The view is not so visible, I would suggest the following instead:

Suggested change
<group name="sale" position="inside">
<label
for="rented_product_tmpl_id"
string="Rental"
invisible="type != 'service' or product_variant_count &gt; 1"
/>
<field
name="rented_product_tmpl_id"
invisible="type != 'service' or product_variant_count &gt; 1"
/>
<label
for="rental_service_tmpl_ids"
string="Rental Services"
invisible="type == 'service' or product_variant_count &gt; 1"
/>
<field
name="rental_service_tmpl_ids"
nolabel="1"
invisible="rental_service_tmpl_ids == []"
/>
<button
type="action"
name="%(sale_rental.create_rental_product_action)d"
string="Create Rental Service"
invisible="type == 'service' or product_variant_count &gt; 1"
/>
</group>
<page name="sales" position="after">
<page name="rental" string="Rental" invisible="not sale_ok and detailed_type=='service'">
<group>
<group name="rental-service" invisible="detailed_type != 'service' or product_variant_count &gt; 1">
<field name="rented_product_tmpl_id" />
</group>
<group name="rental-product" string="Rental Services" col="1" colspan="3"
invisible="detailed_type == 'service' or product_variant_count &gt; 1">
<field
nolabel="1"
name="rental_service_tmpl_ids"
invisible="not rental_service_tmpl_ids"
>
<tree create="0" delete="0">
<field name="name" />
<field name="list_price" string="Rental Price per Day"/>
</tree>
</field>
<button
type="action"
name="%(sale_rental.create_rental_product_action)d"
string="Create Rental Service"
colspan="3"
/>
</group>
</group>
</page>
</page>

id="sale_rental_menu"
parent="sale.sale_order_menu"
action="sale_rental_action"
sequence="2"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sequence="2"
sequence="25"

The menu is shown as first on sale which does not seem relevant, better to have it later in the menu list.

@edescalona
Copy link
Author

Thanks @edescalona for porting this module. I discovered it with your PR, it seems to be working fine. However, display on products and sale order could be improved !

Hi @remi-filament thank you for your comments, I will review them and comment on them, greetings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.