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

Add Payment Link to Sales Order Quotation

Subscribe

Get notified when there's activity on this post

This question has been flagged
salestemplatespaymentssales.orderodoo16features
2 Replies
4230 Views
Avatar
Great Fermentations

Version: Odoo 16 running on SH


Is there a way to dynamically add the sales order payment link to an email template for sending to customers? I know that we can get the payment link manually from the sales order via Action >> Generate Payment Link >> Copy, but I'm hoping there's a way to add this to an email template so my sales reps don't have to copy and paste this value every time. I've gotten close to figuring this out, but am hung up on the access_token parameter in the URL. Here's my code so far:

https://mydomain\.odoo\.com/payment/pay\?reference=\{\{object\.name\}\}\&amount=\{\{object\.amount_total\}\}\&access_token=\{\{object\.access_token\}\}\&sale_order_id=\{\{object.id}}&provider_id=14">Payment Link

The access_token being returned from object.access_token is different than the access token parameter found in the link when I copy it from the Generate Payment Link popup. It seems like this used to be available in earlier versions of Odoo, so I'm hoping it is possible v16.


Thanks!

0
Avatar
Discard
Great Fermentations
Author

Unfortunately, no.

Avatar
Jainesh Shah(Aktiv Software)
Best Answer

Hello, @Great Fermentations,


Hope you are doing well,

Please find code in comment. 

Hope this answer helps you.

Thanks & Regards,
Email: odoo@aktivsoftware.com     

Skype: kalpeshmaheshwari

1
Avatar
Discard
Jainesh Shah(Aktiv Software)

Please find code here :-
For add the payment link into email you need to write the code like below:

<t t-set="base_url" t-value="object.get_base_url()"/>
<a t-attf-href="#{base_url}/payment/pay?reference=#{object.name}&amp;amount=#{object.amount_total}&amp;access_token=#{object.access_token}"> Payment Link </a>

Great Fermentations
Author

@Jainesh - Thanks, but that's already what I've tried more or less. The problem is object.access_token. That value is different from the access token in the payment link (sales order >> action >> generate payment link)

The access token generated by that action seems to be in the account_move model and not sale_order, thus object.access_token won't work.

Jainesh Shah(Aktiv Software)

Hello, @Great Fermentations,

Hope you are doing well,

When the "Generate Payment Link" button is clicked, a popup (payment_link_wizard) appears.
This popup generates an access token based on sale order data, not the account move.
We are using object.access_token because the wizard uses sale order data, not account move data.

The provided link in the question is missing some parameters between the objects.
Due to these missing parameters, accessing the specific link is not possible

I suggest use the given link to access a specific URL.

Great Fermentations
Author

I may be wrong about the model, but the access_token value is still different. When I call the object.access_token variable from a sales order email template, it pulls in the value used for the Customer Preview page, not the Payment link page. Quick example here from my environment below. Notice the different values for access_token:

Payment Link: https://<website url>/payment/pay?reference=S00054&amount=94.05&access_token=921190550da5307816d20b643188f8dea5bd0206002acafd1c71abd50c5ffb5a&sale_order_id=54

Customer Preview Link: https://<website url>/my/orders/54?access_token=e7cda3ad-1f32-477e-9bd6-73aa52d530da

My whole reason for going at it this way was to control which payment method is available to the customer. I run two websites with two different payment providers. The default customer preview page shows all the payment providers available, and not the ones associated with a given website. The payment link page gives me the ability to define exactly which one I want to show.

Avatar
David Schaeffer
Best Answer

Hi, great fermentations. Did code provided by Jainesh work? 

0
Avatar
Discard
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
Duplicate section on Sales order Solved
sales sale.order.line sales.order v14 odoo16features
Avatar
Avatar
2
Mar 25
3694
How to display changes to Delivered Quantities in Sales Orders in Chatter Solved
sales sales.order
Avatar
Avatar
1
Mar 25
2437
Sales stay in "To Invoice" despite already being paid.
sales sales.order
Avatar
Avatar
1
May 24
2660
Change or creat Sales Order date
sales.order odoo16features
Avatar
1
Dec 23
2473
Multiple Address in sale orde Solved
sales odoo16features
Avatar
Avatar
Avatar
2
Mar 24
3370
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