원클릭으로
odoo-actions-and-buttons
Define buttons in views and link them to Python methods or Window Actions.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Define buttons in views and link them to Python methods or Window Actions.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
A router skill that identifies and recommends the most appropriate Odoo skill for a given user request.
Create HTTP endpoints for Websites and APIs.
Comprehensive guide to Odoo fields, including basic, relational, computed, and robust technical features (indexing, company_dependent, properties).
Master the Odoo ORM for data manipulation, environment management, and CRUD operations.
Configure Access Control Lists (ACLs) using CSV files.
Write automated tests using TransactionCase and Form emulators to ensure code quality.
| name | Odoo Actions and Buttons |
| description | Define buttons in views and link them to Python methods or Window Actions. |
Add interactivity to the UI using buttons that trigger Python code or other actions.
Buttons are usually placed in the <header> of a form view or inside the <sheet>/<list>.
Example (Header Button):
<form>
<header>
<button name="action_sold" type="object" string="Sold" class="oe_highlight"/>
<button name="action_cancel" type="object" string="Cancel"/>
</header>
<sheet>
<!-- Fields -->
</sheet>
</form>
string: Label of the button.class="oe_highlight": Highlights the button (primary color).Triggers a Python method on the model.
type="object", name="method_name"Example:
def action_sold(self):
for record in self:
if record.state == 'canceled':
raise UserError("Canceled properties cannot be sold.")
record.state = 'sold'
return True
odoo.exceptions.UserError to stop execution and warn the user.True (or an action dictionary) for public methods.Triggers a specific Window Action (e.g., open a wizard, report, or another view).
type="action", name="%(module_name.action_xml_id)d"Example:
<button type="action" name="%(estate.action_estate_offer)d" string="Offers"/>
You can add buttons to list views (or inside form sheets).
icon="fa-check" (FontAwesome) instead of string for compact buttons.Example:
<list>
<field name="name"/>
<button name="action_confirm" type="object" icon="fa-check" title="Confirm"/>
<button name="action_cancel" type="object" icon="fa-times" title="Cancel"/>
</list>