[ADD] forgotten images, new patches/howto sections

This commit is contained in:
Xavier Morel 2014-04-14 17:05:41 +02:00
parent 43523d4e35
commit 9a1413576a
6 changed files with 54 additions and 5 deletions

View File

@ -445,6 +445,12 @@ Let us, then, create a menu and an action for our lectures:
.. patch::
.. note::
if a requested view does not exist, OpenERP will automatically generate a
very basic one on-the-fly. That is the case here as we have not yet
created a list and a form view for the lectures.
If you reload the backend, you should see a new menu :menuselection:`Academy`
at the top-left corner, before :menuselection:`Messaging`. In it is the
submenus we defined via ``menuitem``, and within (the first submenu is
@ -455,13 +461,19 @@ single record). The :guilabel:`Create` button above the list lets you create
new record, you can select records to delete them.
There's one big issue to fix right now, the labeling of the column in the list
and the fields in the form view, which are all currently :guilabel:`unknown`:
and the fields in the form view, which are all currently :guilabel:`unknown`.
We can fix that by adding a ``string`` attribute to the model field:
.. FIXME fix labels
.. patch::
.. create menu, action
.. improve generated views
.. create list & form views for events
The second problem is that the list view only displays the ``name`` field. To
fix this, we have to create an explicit list view for lectures:
.. patch::
.. todo:: link to list view documentation
.. todo:: have lectures extend events -> reuse in OpenERP?
.. [#taprofile] the teaching assistants profile view ends up broken for now,
but don't worry we'll get around to it

View File

@ -0,0 +1,14 @@
# HG changeset patch
# Parent fe4edbcd9e98db81ec6321c58e8ac508a686f45b
diff -r fe4edbcd9e98 -r 72a099819e5b models/academy.py
--- a/models/academy.py Mon Apr 14 16:38:10 2014 +0200
+++ b/models/academy.py Mon Apr 14 16:59:01 2014 +0200
@@ -14,6 +14,6 @@ class Lectures(orm.Model):
_order = 'date ASC'
_columns = {
- 'name': fields.char(required=True),
- 'date': fields.date(required=True),
+ 'name': fields.char(required=True, string="Name"),
+ 'date': fields.date(required=True, string="Date"),
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

View File

@ -0,0 +1,21 @@
# HG changeset patch
# Parent 72a099819e5b352314124dd03841a9f4c3b5b7c1
diff -r 72a099819e5b -r 6a562e55935f data/views.xml
--- a/data/views.xml Mon Apr 14 16:59:01 2014 +0200
+++ b/data/views.xml Mon Apr 14 17:04:36 2014 +0200
@@ -1,5 +1,15 @@
<openerp>
<data>
+ <record id="list_academy_lecture" model="ir.ui.view">
+ <field name="model">academy.lectures</field>
+ <field name="arch" type="xml">
+ <tree string="Lectures">
+ <field name="name"/>
+ <field name="date"/>
+ </tree>
+ </field>
+ </record>
+
<record id="action_academy_lecture" model="ir.actions.act_window">
<field name="name">Academy lectures</field>
<field name="res_model">academy.lectures</field>

View File

@ -14,3 +14,5 @@ ta-template-biography
lectures-model-add
data-to-demo
lectures-action-and-menus
field-label
lecture-view-list