Button creation


Usually I have no problem creating a button and managing its attributes.
However here the button that I create is in “readonly” state by default.
Am I missing something?

    def __setup__(cls):
        super(ContractContractAttribute, cls).__setup__()

            'fill_in': {}

    def fill_in(cls, attribute):
        product = attribute[0].product

        if product:
            attribute[0].attibute = product.attribute
            attribute[0].base_price = product.list_price
            attribute[0].uos = product.uos

        return True
<record model="ir.model.button" id="contract_attribute_fill_button">
          <field name="name">fill_in</field>
          <field name="string">Remplir</field>
          <field name="model" search="[('model', '=', 'contract.contract.attribute')]"/>
    <button name="fill_in"/>

(when I move this code to another class. The button behaves normally) ??

I suspect that it is in a One2Many so the record is not yet saved so buttons are disabled.