CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I'm new to Odoo and one area where I'm having trouble is understanding the context around the python code you can put in server actions (what I can do, and what I can't), and what I can and can't do through XML data files.
If anybody could point me to examples of addons which do this, and thorough reference documentation and/or tutorials, it would help.
Edit: Digging into the XML, I have a more specific question which could be answered by pointing me at the right documentation. I can see that you add rows to a table in the DB, using XML record tags, like so:
<record id="stock_location_locations" model="stock.location">
<field name="name">Physical Locations</field>
Where model="" the model name, but what is the id attribute? Where can I read about what is supposed to go in there? The stock.location model doesn't have an ID field, but I would expect it to have a surrgate key called that which is managed by the ORM, so I don't know what to put there in the XML. Is it just string which is unique to the XML record tag?
You can find server action example in CRM module.
1.GO to crm module
3. You can find ir.action.server example something like this:
<record id="action_email_reminder_lead" model="ir.actions.server">
<field name="name">Reminder to User</field>
<field name="model_id" ref="model_crm_lead"/>
<field name="subject">Reminder on Lead: [[object.id ]] [[object.partner_id and 'of ' +object.partner_id.name or '']]</field>
<field name="message">Warning unprocessed incoming lead is more than 5 day old.
Name: [[object.name ]]
ID: [[object.id ]]
About This Community
Odoo Training Center
|Asked: 11/27/14, 1:57 PM|
|Seen: 2632 times|
|Last updated: 3/16/15, 8:10 AM|