I made a button to change status in form view.
in xml
<record id="eric_product_attribute_form_view" model="ir.ui.view">
<field name="model">product.attribute</field>
<field name="view_type">form</field>
<field name="mode">primary</field>
<field name="arch" type="xml">
<header>
<button name="change_attribute_status" states="confirmed" string="Confirm" type="object" class="btn-primary" attrs="{'invisible': [('state', '!=', 'saved')]}"/>
</header>
</field>
</record>
- and Action
class ProductAttribute(models.Model):But I cannot get any log
_name = "product.attribute"
_inherit = "product.attribute"
state = fields.Char("Status")
@api.multi
def change_attribute_status(self):
_logger.info("====================================456========================================")
Please help
Your xml code is wrong.
Its not necessary to add _name="same.name" for inheriting models