field-service
field-service copied to clipboard
[15.0][ADD] fieldservice_website_sale: New module fieldservice_website_sale
This module integrates e-commerce with field service workflows, allowing customers to create sale orders through the e-commerce platform while selecting a preferred delivery date and time range based on their FSM route. These selections are used to determine the delivery window for the associated stock picking and field service management (FSM) orders. When an FSM order is created, it is automatically assigned to the appropriate FSM day route based on the selected delivery date. This integration streamlines operations by automating the assignment of day routes from incoming sale orders, ensuring organized and efficient scheduling.
cc https://github.com/APSL 165144
@miquelalzanillas @lbarry-apsl @mpascuall @peluko00 @javierobcn @BernatObrador please review
Depends on:
- [fieldservice_availability] #1318
- [fieldservice_sale_stock_route] #1343
This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖
I tested in runboat and it functions as documented
The models
fsm_delivery_time_rangeandfsm_festive_daycould be useful for other situations. Maybe it could lead to a new separate modulefieldservice_availabilityor something similar
Thank you for the review, @brian10048! That makes total sense. I’ll start working on this and update the PR accordingly.
Hi @brian10048! As per your suggestion, I’ve separated fsm_delivery_time_range and fsm_festive_day into a separate module, fieldservice_availability.
However, I encountered test failures when uploading changes to the fieldservice_website_sale module, and it appears to be unrelated to my module. I tested locally, and when both fieldservice and website are installed (without even installing my fieldservice_website_sale module), the tests fail with the following error:
Error when render the template
Exception: Unallowed to fetch files from addon website
Template: web.report_layout
Path: /t/html/head/t[1]
Node: <t t-call-assets="web.report_assets_common" t-js="false"/>
This error originates from this code.
Strangely, this didn't happen the first time I uploaded this module, as all checks in the pipeline passed correctly.
I resolved it by adding a dependency on the website module. Let me know your thoughts on this. Thank you!
Hi @ppyczko ,
In the runboat, i didn't find this here: under Master Data > Delivery Time Ranges, create delivery time ranges.
I found it here: under Configuration > section Availability >Delivery Time Ranges.
It's a mistake?
Hi @ppyczko ,
In the runboat, i didn't find this here: under
Master Data>Delivery Time Ranges, create delivery time ranges.I found it here: under
Configuration> sectionAvailability>Delivery Time Ranges.It's a mistake?
Fixed! It was wrong due to changes in the dependency fieldservice_availability, thank you for pointing it out @lbarry-apsl!
Hi @brian10048 @max3903 @hparfr,
I extracted some functionality from this module fieldservice_website_sale to this module here #1343, but now the tests are failing. I already encountered these errors in this other PR #1344 and added commits there to fix them.
My question is, should I add those fixes here as well, or just wait for #1343 and #1344 to be merged and relaunch the tests later? Thanks in advance!
@ppyczko looking briefly at these, I would suggest we do a separate PR to fix the tests first, preferably one PR per module. I'll merge them quickly and we can retest the new modules
And I would prefer we look into fixing the other test issue instead of adding website dependency directly to fieldservice module. Looking at this part of the test like you mentioned, seems odd to test the report action as part of a test defined test_fsm_order_create
@ppyczko looking briefly at these, I would suggest we do a separate PR to fix the tests first, preferably one PR per module. I'll merge them quickly and we can retest the new modules
And I would prefer we look into fixing the other test issue instead of adding
websitedependency directly tofieldservicemodule. Looking at this part of the test like you mentioned, seems odd to test the report action as part of a test definedtest_fsm_order_create
Thank you @brian10048! Here are the separate PR's to fix the tests:
- [fieldservice_sale_recurring] #1348
- [fieldservice_delivery] #1349
And you're absolutely right, I’ll look into the failing tests and remove the website dependency. Thanks again for your help!
@brian10048 I removed the website dependency from the fieldservice module, but I couldn't get the report test to work correctly. I tried several approaches, but I keep encountering the same errors whenever website is installed. However, when website is uninstalled or as a dependency, the test runs perfectly.
That said, the report itself works fine in Odoo in both cases—I can print it without any issues. Since I couldn't find a way to resolve the test failure, I temporarily removed that part of the test to prevent it from breaking. I know this may not be the ideal solution, so if you have any suggestions, please let me know.
@ppyczko Can you add a res.config.setting in the fieldservice module to install this one?
@ppyczko Can you add a res.config.setting in the
fieldservicemodule to install this one?
Done! Thank you for the suggestion @max3903
/ocabot merge nobump
What a great day to merge this nice PR. Let's do it! Prepared branch 15.0-ocabot-merge-pr-1298-by-max3903-bump-nobump, awaiting test results.
@max3903 your merge command was aborted due to failed check(s), which you can inspect on this commit of 15.0-ocabot-merge-pr-1298-by-max3903-bump-nobump.
After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.
Hi @max3903, the test fix has already been merged in #1392. When you get a chance, could you please retry the merge command? Thanks!
/ocabot merge nobump
Hey, thanks for contributing! Proceeding to merge this for you. Prepared branch 15.0-ocabot-merge-pr-1298-by-hparfr-bump-nobump, awaiting test results.
Congratulations, your PR was merged at 3d0002e639928e24557e8ed58843aab4870b6f3a. Thanks a lot for contributing to OCA. ❤️