~openerp-community/openobject-doc/ksa-openobject-doc-6.0

« back to all changes in this revision

Viewing changes to i18n/ru/source/developer/2_5_Objects_Fields_Methods/objects.rst

  • Committer: Don Kirkby
  • Date: 2011-02-21 20:46:11 UTC
  • mfrom: (433.1.53 openobject-doc)
  • Revision ID: donkirkby+launpd@gmail.com-20110221204611-1ykt6dmg4k3gh5dh
[MERGE] revisions 477 to 486 from the 5.0 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
.. i18n: OpenERP Objects
 
3
.. i18n: ===============
 
4
..
 
5
 
 
6
OpenERP Objects
 
7
===============
 
8
 
 
9
.. i18n: Introduction
 
10
.. i18n: ----------------
 
11
..
 
12
 
 
13
Introduction
 
14
----------------
 
15
 
 
16
.. i18n: .. This chapter is dedicated to detailed objects definition:
 
17
.. i18n:     all fields
 
18
.. i18n:     all objects
 
19
.. i18n:     inheritancies
 
20
..
 
21
 
 
22
.. This chapter is dedicated to detailed objects definition:
 
23
    all fields
 
24
    all objects
 
25
    inheritancies
 
26
 
 
27
.. i18n: All the ERP's pieces of data are accessible through "objects". As an example, there is a res.partner object to access the data concerning the partners, an account.invoice object for the data concerning the invoices, etc...
 
28
..
 
29
 
 
30
All the ERP's pieces of data are accessible through "objects". As an example, there is a res.partner object to access the data concerning the partners, an account.invoice object for the data concerning the invoices, etc...
 
31
 
 
32
.. i18n: Please note that there is an object for every type of resource, and not an
 
33
.. i18n: object per resource. We have thus a res.partner object to manage all the
 
34
.. i18n: partners and not a *res.partner* object per partner. If we talk in "object
 
35
.. i18n: oriented" terms, we could also say that there is an object per level.
 
36
..
 
37
 
 
38
Please note that there is an object for every type of resource, and not an
 
39
object per resource. We have thus a res.partner object to manage all the
 
40
partners and not a *res.partner* object per partner. If we talk in "object
 
41
oriented" terms, we could also say that there is an object per level.
 
42
 
 
43
.. i18n: The direct consequences is that all the methods of objects have a common parameter: the "ids" parameter. This specifies on which resources (for example, on which partner) the method must be applied. Precisely, this parameter contains a list of resource ids on which the method must be applied.
 
44
..
 
45
 
 
46
The direct consequences is that all the methods of objects have a common parameter: the "ids" parameter. This specifies on which resources (for example, on which partner) the method must be applied. Precisely, this parameter contains a list of resource ids on which the method must be applied.
 
47
 
 
48
.. i18n: For example, if we have two partners with the identifiers 1 and 5, and we want to call the res_partner method "send_email", we will write something like::
 
49
.. i18n: 
 
50
.. i18n:         res_partner.send_email(... , [1, 5], ...)
 
51
..
 
52
 
 
53
For example, if we have two partners with the identifiers 1 and 5, and we want to call the res_partner method "send_email", we will write something like::
 
54
 
 
55
        res_partner.send_email(... , [1, 5], ...)
 
56
 
 
57
.. i18n: We will see the exact syntax of object method calls further in this document.
 
58
..
 
59
 
 
60
We will see the exact syntax of object method calls further in this document.
 
61
 
 
62
.. i18n: In the following section, we will see how to define a new object. Then, we will check out the different methods of doing this.
 
63
..
 
64
 
 
65
In the following section, we will see how to define a new object. Then, we will check out the different methods of doing this.
 
66
 
 
67
.. i18n: For developers:
 
68
..
 
69
 
 
70
For developers:
 
71
 
 
72
.. i18n: * OpenERP "objects" are usually called classes in object oriented programming.
 
73
.. i18n: * A OpenERP "resource" is usually called an object in OO programming, instance of a class. 
 
74
..
 
75
 
 
76
* OpenERP "objects" are usually called classes in object oriented programming.
 
77
* A OpenERP "resource" is usually called an object in OO programming, instance of a class. 
 
78
 
 
79
.. i18n: It's a bit confusing when you try to program inside OpenERP, because the language used is Python, and Python is a fully object oriented language, and has objects and instances ...
 
80
..
 
81
 
 
82
It's a bit confusing when you try to program inside OpenERP, because the language used is Python, and Python is a fully object oriented language, and has objects and instances ...
 
83
 
 
84
.. i18n: Luckily, an OpenERP "resource" can be converted magically into a nice Python object using the "browse" class method (OpenERP object method). 
 
85
..
 
86
 
 
87
Luckily, an OpenERP "resource" can be converted magically into a nice Python object using the "browse" class method (OpenERP object method).