Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Sale Order Deadline to Project Task Deadline

Subscribe

Get notified when there's activity on this post

This question has been flagged
projecttaskorderodoo16features
1 Reply
2240 Views
Avatar
Steven Lunn

Hi all,

so im using a service in a sale order to create a task in a project. Is there a way of using automated actions so that when i update the delivery date in a sales order the task deadline updates if that product exists on the sale order. 

At the moment im adding the delivery date and then going into project tasks and updating that to the same date. i think there must be an easier/faster way.


Also if that is a thing would it be also possible to move a task to completed when the product is delivered or whole sale order delivered.


Many thanks

0
Avatar
Discard
Avatar
Hamid Ahmadimoghaddam
Best Answer

Hi Steven,

here is what you are searching for.

Now, whenever you update the field Delivery Date (commitment_date) on the sales order, all the tasks related to the lines of the sale order will get updated on the field deadline.

Regarding the last point, it will be somehow the same, but needs more clarification. 

Hamid - bitigloo GmbH

1
Avatar
Discard
Steven Lunn
Author

Thats amazing Hamid. but i do have more than one service on the sales order and more than one task so how would i do this based on product id to just update the one task.

Hamid Ahmadimoghaddam

Hey Steven,
the code will update all the tasks that are in any of the lines, not just 1 line and not just 1 task.
If you want to update all the tasks that are linked to that Sales Order and not just the lines you can do this:

for rec in records:
for task in rec.task_ids:
task.update({
'date_deadline': rec.commitment_date
})

Hamid Ahmadimoghaddam

Maybe I misunderstood what you mentioned. Maybe you can explain a little more, what is the expected behavior? And how you can distinguish for which task the deadline should get updated and for which not?

Steven Lunn
Author

so i have confused the situation.

Each sales order has 3 tasks created from 3 lines/products
Project management
Commissioning
Manufacturing

Project management has a deadline that matches the sale order delivery date
the other 2 the date is set by the engineer

using your solution i understand that all three will update to the delivery date whereas i only need the project management task to reflect that date.

does that make sense ?

Hamid Ahmadimoghaddam

ok, now I got it. A quick but sensitive way is to match it with the product_id and I would definitely use the first code in the screenshot, not the second one in the comments, but adjust it as below:

imagine the id of the product is 10. (you should check it in the product variants, not products).

for rec in records:
for line in rec.order_line:
if line.product_id.detailed_type == "service" and line.task_id and line.product_id.id == 10:
line.task_id.update({
'date_deadline': rec.commitment_date
})

the right way to do it, can be adding a new boolean field on product like "Update Deadline" and then we check this field and update the task if the product has this checkbox as True.

Steven Lunn
Author

Amazing, Thank you

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Project or Task for Service Business Solved
project task odoo16features
Avatar
Avatar
1
Jun 23
3434
Automated Action that sets kanban_state for another task
project task AutomatedActions odoo16features
Avatar
0
Jul 23
2545
Project task expense
project task expense odoo16features
Avatar
Avatar
2
May 23
3482
Unable to Select Project for Service Product in Odoo 17 Solved
project service product task order
Avatar
Avatar
Avatar
3
Apr 24
3119
Installing Project from latest Odoo 16 CE breaks down Odoo database
project odoo16features
Avatar
Avatar
1
Oct 23
3104
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now