I am new to openerp I came across res.partner but I couldn't understand what it does and what all functionalities it provides,so if anyone could explain it to me I would be grateful.
To clarify.
res.partner is an ORM Model. An ORM model describes a class of objects in the database and provides a series of ORM methods to allow you to manage them in code (create, write, unlink etc).
To get the database table, unless there is a specific _table override, just convert the periods to underscores so the table in the database is res_partner. As with any "res." model, you get res.partner as part of the core of OpenERP rather than any additional model such as accounting or sales.
But to answer a wider question, what is res.partner for in OpenERP? Assuming OpenERP 7, res.partner contains information about any entities you have a relationship with.
This includes:
Customers - you have a res.partner entry for each customer plus a res.partner entry for each contact person or address (invoice to, deliver to) you set up for that customer.
Suppliers - same as customers. In fact, the only difference between the two is a boolean field on res.partner to say if they are a customer or supplier.
Users - each user allowed to log in to your OpenERP instance has a related res.partner to store address details.
Companies - each company you set up in OpenERP assuming you are using multi-company has a related res.parter to store address details.
res.partner is the technical name for the Model representing Partners:
Partners represent People and Organizations.
The most straightforward example are Customers and Suppliers.
Other examples of Partners are:
Contact persons within an organization
Customer or Supplier Adresses
Employees personal contact data
Users contact data
So it's a base concept used pretty much everywhere in the application.
Related
I am implementing a multi-company project and noticed that several models in the payroll modules are missing the company_id field.
Is there any official documentation explaining what would be the behavior of Odoo's multi-company environment
when company_id is not defined in a model?
I made some tests...
When I created records from these models, I noticed two different behavior.
On one occasion the record was shared between companies (as if there were a company_id field set to false).
On another case, the record is not visible outside the company from where I created it.
Thanks
How to use Domain and Context in odoo?
I have a situation for example,
In OpenEduCat List of Subjects and List of Students.
Students are registered against subjects.
I want to show all students related to specific subject(English) in tree view.
Model A (students.course), Model B(results)
When i click on Subject then open a list view of students belongs to that Subject.
domain="[('student', '=',subject)]"
I am trying to learn domain modeling , now lets consider a shopping cart example.Lets user can browse catalog of products and add products to shopping cart, purchase those products.To purchase products he will place order.User can trace his order details.He can call up customer rep to know about status of his order.
Please validate my Domain model in full scope.
Below is Domain Model i have designed , i am having issues in representing order and order status what is the right way to do
How would i link product and order.
A (conceptual) domain model is a solution-independent description of a problem domain produced in the analysis phase of a software engineering project. It may consist of information models (typically in the form of UML class diagrams), process models (typically in the form of BPMN diagrams), and possibly other types of models.
A domain class model contains only conceptual elements, such as properties (possibly without datatypes) and associations. It does not specify the visibility of properties and methods, as visibility is a platform-specific concept.
Your model is incomplete in many respects (e.g. it does not describe order lines/details, which are taken from the cart), and it does not contain any association. Clearly, an order is associated to one customer and to many items/products (via its order lines).
OrderStatus should be modeled as an enumeration, which is a UML datatype that is stereotyped with <>, and Order should have a status attribute with this enumeration as its range.
The model below may be a bit more general than what you had in mind, because it allows for several warehouses from which an order item can be sourced, and it also distinguishes between private and corporate customers.
You can make "order details" an associative class for the relationship between order and product. See the example:
IBM example of an associative class
Note that yours is really a class diagram. A domain diagram shows the dependencies on different problem domains such as
Order fullfillment
Database
RemoteCommunications
SystemMaintenance
etc.
Two resources:
/user
/product
The database table name is user_product and it describes relation between user and product. However, endpoint POST /user/{id}/product/{id} would indicate updating a specific product under user, as opposed to creating a new relation.
I have therefore named the resource POST /user/{id}/product/{id}/purchase, which defines fictional resource purchase. After all, this is what the data in the table represents.
I am aware that the original dissertation describing REST principles does little to standardise naming. I'd like to know what are industry established conventions for naming resource that identifies a relationship between two resources?
I would guess that your purchase is stored in a database somewhere and the actual purchase assigned its own ID. Why not use that ID directly as in /purchases/{purchase-id}?
Your example /user/{id}/product/{id}/purchase won't work if one user has more than one purchase of the same product. Unless of course the resource either signals "The user has at least one purchase of product X" or returns a list of all purchases of product X for that user - which looks more like a query (which is fine to assign its own resource).
I have therefore named the resource POST /user/{id}/product/{id}/purchase.
Please be aware that you don't include method names (like POST) in resource names. And why the POST? Is it for creating/modifying the relation - or did you mean GET to get some information about the relation?
I am aware that the original dissertation describing REST principles does little to standardise naming. I'd like to know what are industry established conventions for naming resource that identifies a relationship between two resources?
No, but if you want some hints then I wrote a piece on this subject here: http://soabits.blogspot.dk/2013/10/url-structures-and-hyper-media-for-web.html
I'm building a simple eCommerce application.
I currently have a customer model and need to add a shipping address to this. Question is, should I create a new address model and associate this with my customer or put the address fields on my customer model? It seems like creating 2 models will be more effort as I will then need to update multiple models when my customers enter their details on the front end form.
If your customers will ever need to associate two addresses with their account then create two models. Odds are they will. Billing vs Shipping is the most common, but so is wanting to ship to home vs ship to work, etc.