Bỏ qua để đến Nội dung
Odoo Menu
  • Đăng nhập
  • Dùng thử miễn phí
  • Ứng dụng
    Tài chính
    • Kế toán
    • Hóa đơn
    • Chi phí
    • Bảng tính (BI)
    • Tài liệu
    • Ký tên
    Bán hàng
    • CRM
    • Bán hàng
    • POS Cửa hàng
    • POS Nhà hàng
    • Đăng ký
    • Cho thuê
    Trang web
    • Trình tạo trang web
    • Thương mại điện tử
    • Blog
    • Diễn đàn
    • Trò chuyện trực tiếp
    • Học trực tuyến
    Chuỗi cung ứng
    • Tồn kho
    • Sản xuất
    • PLM
    • Mua hàng
    • Bảo dưỡng
    • Chất lượng
    Nhân sự
    • Nhân viên
    • Tuyển dụng
    • Ngày nghỉ
    • Đánh giá
    • Giới thiệu
    • Đội xe
    Marketing
    • Marketing trên MXH
    • Marketing qua email
    • Marketing qua SMS
    • Sự kiện
    • Tự động hóa Marketing
    • Khảo sát
    Dịch vụ
    • Dự án
    • Bảng chấm công
    • Dịch vụ hiện trường
    • Hỗ trợ
    • Kế hoạch
    • Lịch hẹn
    Năng suất
    • Thảo luận
    • Phê duyệt
    • IoT
    • VoIP
    • Kiến thức
    • WhatsApp
    Ứng dụng của bên thứ ba Studio Odoo Nền tảng Đám mây Odoo
  • Ngành
    Bán lẻ
    • Nhà sách
    • Cửa hàng quần áo
    • Cửa hàng nội thất
    • Cửa hàng tạp hóa
    • Cửa hàng đồ kim khí
    • Cửa hàng đồ chơi
    Ẩm thực & Dịch vụ lưu trú
    • Bar và quán rượu
    • Nhà hàng
    • Đồ ăn nhanh
    • Guest house
    • Nhà phân phối đồ uống
    • Khách sạn
    Bất động sản
    • Công ty môi giới bất động sản
    • Công ty kiến trúc
    • Xây dựng
    • Quản lý bất động sản
    • Làm vườn
    • Hiệp hội chủ sở hữu bất động sản
    Tư vấn
    • Công ty kế toán
    • Đối tác Odoo
    • Công ty marketing
    • Công ty luật
    • Tuyển dụng
    • Thanh tra & chứng nhận
    Sản xuất
    • Dệt may
    • Kim loại
    • Nội thất
    • Ẩm thực
    • Nhà máy bia
    • Quà tặng doanh nghiệp
    Sức khoẻ & fitness
    • CLB thể thao
    • Cửa hàng kính mắt
    • Trung tâm fitness
    • Chuyên gia chăm sóc sức khỏe
    • Hiệu thuốc
    • Tiệm làm tóc
    Thương mại
    • Dịch vụ sửa chữa
    • Phần cứng CNTT & Hỗ trợ
    • Hệ thống năng lượng mặt trời
    • Công ty sản xuất giày
    • Dịch vụ vệ sinh
    • Dịch vụ HVAC
    Khác
    • Tổ chức phi lợi nhuận
    • Cơ quan môi trường
    • Cho thuê biển quảng cáo
    • Nhiếp ảnh
    • Cho thuê xe đạp
    • Đại lý phần mềm
    Xem tất cả ngành
  • Cộng đồng
    Học tập
    • Khóa học
    • Tài liệu
    • Chứng chỉ
    • Đào tạo
    • Blog
    • Podcast
    Thúc đẩy đào tạo
    • Chương trình đào tạo
    • Trò chơi kinh doanh Scale Up!
    • Tham quan Odoo
    Nhận phần mềm
    • Tải xuống
    • So sánh các phiên bản
    • Phiên bản
    Hợp tác
    • Github
    • Diễn đàn
    • Sự kiện
    • Dịch thuật
    • Trở thành đối tác
    • Dịch vụ dành cho Đối tác
    • Đăng ký công ty kế toán của bạn
    Nhận dịch vụ
    • Tìm đối tác
    • Tìm kế toán
    • Gặp chuyên gia hỗ trợ
    • Dịch vụ Triển khai
    • Khách hàng tham khảo
    • Hỗ trợ
    • Nâng cấp
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Nhận một buổi demo
  • Bảng giá
  • Trợ giúp

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

  • CRM
  • e-Commerce
  • Kế toán
  • Tồn kho
  • PoS
  • Dự án
  • MRP
All apps
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Hỗ trợ

How to automatically update data in Google Spreadsheet with an Odoo integration

Đăng ký nhận tin

Nhận thông báo khi có hoạt động trên bài viết này

Câu hỏi này đã bị gắn cờ
googleintegrationquickstartspreadsheets
2 Trả lời
8655 Lượt xem
Ảnh đại diện
Clément Stampe (clst)

The purpose of this forum entry is to explain how it is possible to update automatically the data linked to an Odoo database in Google Spreadsheet. The goal of this action is to continually share updated data thanks to a Google Spreadsheet integration.

-1
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
Clément Stampe (clst)
Tác giả Câu trả lời hay nhất


1. The first step is to make the connection between Odoo and Google Spreadsheets working. Since it is not the subject of this forum entry, I assume the connection is done and the extraction of data in Google Spreadsheet works. 

 Since we have a formula for extracting data from the Odoo database, we now want to have updated data each time we open the spreadsheet or depending on a time-driven solution. 

The easiest way to do so is to refresh the formula extracting the data (so basically the “oe_browse”   or “oe_read_group”). One way to do it manually is to cut the formula and paste it in another cell or we can also insert a line above the formula. Both ways work but since we have to do it manually it is not efficient and totally not user friendly. 


2. The second step consists of implementing a solution to refresh the formula automatically. One way to do so is to change data in the formula. Indeed, if you go into your formula and modify the number of lines displayed for example (the last line of your formula) you will see that the formula is refreshing. So we know that by modifying a condition in the formula, the formula is refreshed and the extracted data is updated. 


So what we could do is to say in the formula that the lines displayed in the Spreadsheet must be the number displayed in the cell E1. 

“=oe_browse("stock.quant";"product_id location_id owner_id available_quantity";"";"";E1)”


Now we want that the data, appearing in the cell E1, to fluctuate from one number to another. This way the formula will be updated each time the fluctuation occurs.  


3. In order to have this fluctuation, we will write, via the script (I will explain later why), in cell B1 the function =now(). This function will give the date and the hours in the cell. 

In cell C1, we will just write “=B1” to display the hour of the day. 

In cell D1, we will use the function “=minute” to display the minutes of cell C1. 

Thanks to these formulas, we will be able to have a fluctuation by adding in Cell E1 the following formula 

“=IFS(ISEVEN(D1) = TRUE;1000;ISEVEN(D1) = FALSE;1001)”

This formula will display the number “1000” for each even number and “1001” for each odd number. This way we will have a fluctuating number each minute and these numbers (1000 & 10001) will represent the number of lines displayed in our formula extracting the data.



4. What we need now is to automatically update the formula (=now) in order to make the formula in cell E1 move from one number to another.  In order to do so we will add in the script of the Spreadsheet the following function. 


“

function trigger_cell(){

   SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').getRange('B1').setValue(new Date()).setNumberFormat("MM/dd/yyyy");

}

“

A) Go to "Extensions"

B) Select "App script" 

C) Scroll down in the script, go on the last line and click on the "enter" button two times in order to have your cursor two lines after the last written line. 

D) Paste the function then save the script. 

E) Select the function to run (switch "_test" by "trigger cell") and Run the script. 

F) Once it is done and if you have no error message (you should not have an error message if you wrote nothing else in the script than the function), you should see in cell B1 the date of the day.


You do not need to understand how the function is written but you need to understand why we use the script to add the function “=now) in cell B1 instead of directly writing the formula in the cell. 


5. The reason is that we want to use the “Trigger option” available in Spreadsheet. A trigger is a way to refresh formulas depending on a condition (could be time driven or while opening the file for example). The thing is we can only use triggers on functions written in the script. This is why we created the function “now” instead of directly writing the formula “now” in the cell. 


So now we need to create a trigger. To do so, go back in the script (Apps Script), go on the left menu and click on the Timer logo. 

  1. Select “Triggers”, create a new one.

  2. Choose the function “Trigger cell” 

  3. Leave “Head” in “which runs at deployment”

  4. Select your event source, for example Time Driven 

  5. Select type of time based trigger, for example Minutes timer

  6. Select minute interval


6. Once everything is set, you will have your excel formula which extracts data from Odoo refreshed every minute thanks to the link with the cell E1. The cell D1 displaying the minutes will be refreshed every minute thanks to the link with the cell B1. The cell E1 will fluctuate from the number 1000 to 1001 each minute.


Here is the configuration without the explanation

B1: “now” function displayed via the script

C1: “=B1”

D1: “=minute(C1)

E1: “=IFS(ISEVEN(D1) = TRUE;1000;ISEVEN(D1) = FALSE;1001)”


The formula extracting data (just an example to show you the link): 

=oe_browse("stock.quant";"location_id product_id available_quantity";"";"";E1)


2
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
TIZ
Câu trả lời hay nhất

Wow, Clément, that's a true game changer here! 

Thanks a lot!

Now that PowerBi or Powerquery include a functional Google Sheets Connector, that means that we're able to build complex dashboards that remain updated.


0
Ảnh đại diện
Huỷ bỏ
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!

Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!

Đăng ký
Bài viết liên quan Trả lời Lượt xem Hoạt động
Google Spreadsheets Đã xử lý
google spreadsheets
Ảnh đại diện
Ảnh đại diện
1
thg 3 15
10677
How to link Odoo to Google spreadsheet? Đã xử lý
google quickstart spreadsheet
Ảnh đại diện
Ảnh đại diện
2
thg 12 24
18216
Odoo Google spreadsheet error Đã xử lý
google oauth spreadsheets
Ảnh đại diện
1
thg 1 23
3641
Can anyone provide a detailed explanation of how to use the Google Spreadsheets module?
google v11 spreadsheets
Ảnh đại diện
Ảnh đại diện
Ảnh đại diện
Ảnh đại diện
3
thg 5 22
15636
Odoo Spreadsheet category_id
google spreadsheets spreadsheet
Ảnh đại diện
0
thg 7 21
2927
Cộng đồng
  • Khóa học
  • Tài liệu
  • Diễn đàn
Open source
  • Tải xuống
  • Github
  • Runbot
  • Dịch thuật
Dịch vụ
  • Lưu trữ Odoo.sh
  • Hỗ trợ
  • Nâng cấp
  • Phát triển tùy chỉnh
  • Đào tạo
  • Tìm kế toán
  • Tìm đối tác
  • Trở thành đối tác
Giới thiệu công ty
  • Công ty của chúng tôi
  • Tài sản thương hiệu
  • Liên hệ
  • Việc làm
  • Sự kiện
  • Podcast
  • Blog
  • Khách hàng
  • Pháp lý • Riêng tư
  • Bảo mật
الْعَرَبيّة 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 là bộ ứng dụng kinh doanh có open source đáp ứng tất cả các nhu cầu của công ty bạn: CRM, thương mại điện tử, kế toán, tồn kho, POS, quản lý dự án, v.v.

Định hướng giá trị riêng biệt của Odoo là tích hợp hoàn toàn và dễ dàng sử dụng.

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