Didn't understand 'filename' field logic in fields.Binary()

I am trying to make it flexible…
Well, I declared a field:

    sales_y_t_y_graph = fields.Function(fields.Binary('Sales M-t-M vs previous year', readonly=True, filename='filename_field'),'get_y_t_y_sales_graph')

    def get_y_t_y_sales_graph(self, name):
        # Build a grpah for Year to Year compare
        self.filename_field = f'{self.sales_this_m.name}.png'
        return self.draw_year_graph(db_fieled_name='sales_this_m', title='Sales M-t-M vs previous year')

self.draw_year_graph() — returns binary data with an image based on various DB fields

When the user presses the “Save button”, Tryton still shows weird suggestion:

If this field “a system only use” or I do something wrong with the naming?


You can not assign value to other field in a getter function.
You must fill the value of fieldname_field differently. It is probably just another Function field as far as I can see.

thanks, didn’t get it.
filename_field — is a fields.Char() function…
But I understand about the way it might be filled. I will try the ‘default value’ mechanism…