Automatically export CSV from Odoo

The goal is to automatically export the csv file to a location on the server using the odoos automatic actions. Daily or every time a record is created.

I have the first steps in order so that it works every time I create records.

To get here, I use Odoos automatic actions.

Settings> automation> automatic actions

I created a new action called Test

I have associated the associated document model with fax (which I want to save in csv)

I created a new server action called Export to CSV

At this stage, when things begin to fall apart, I know that I can’t understand what action I should use. I am trying to use Execute python code, but I cannot run anything since the following is available: although I cannot figure out how to access any of them.

# Available locals:
#  - time, datetime, dateutil: Python libraries
#  - env: Odoo Environement
#  - model: Model of the record on which the action is triggered
#  - object: Record on which the action is triggered if there is one, otherwise None
#  - workflow: Workflow engine
#  - Warning: Warning Exception to use with raise
# To return an action, assign: action = {...}

I tried

print object

Just to find out if there is anything, but he returned 500 error

opcode PRINT_ITEM not allowed (u'print object')

I hope someone comes across this sooner and can point me in the right direction. I have minimal knowledge. Any help would be greatly appreciated.

+4
source share

Source: https://habr.com/ru/post/1584321/


All Articles