How to use Domain and Context in odoo 10? - odoo

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)]"

Related

Odoo multi companies - model missing company_id field

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 can I fix the rendundancy in my ER-Diagram?

I've a problem with my ER-Diagram, I hope somebody can help. The scenario: users can create contacts. The user can also add notes to the contact. The note consists of one text field. The contacts can be connected to the notes, that means; one contact can be linked to several notes and one note can be linked to several contacts. Now I have an entity "User" and an entity "Contact", it's a many to many relationship. But I'm stucked at one point: I'm not sure if "Note" also have to be an entity, because I've to show the many to many relationship between the notes and contacts, but I've also to show the relation between the user and the note. This would lead to a circle which is redundant. Any help would be appreciated thanks!
You definitely need to show note as an entity. Now, since you already defined a relationship between contact and note there is no need to show another relationship between person and note. You can get note for a user with user and contact combination.

Create contact record from registration form in odoo 9

Using Odoo 9 SA, I've added custom fields to my crm.lead model and added those fields to a registration form. I'd like to have that custom lead information carry over to the contact record that is created in res.partner when the lead is qualified.
My question is how can I go about doing that? I don't know where the action is that would copy the fields from crm.lead to res.partner.
You must add these fields to res.partner model and it will store it (related fields would be best choise I think)

Domain Model for Simple Use case

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.

What is res.partner?

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.