Displaying all com.axelor.apps.sale.db.SaleOrder project-form screen?


#1

hello guys,

first I want to ask does SaleOrder and Project have a linked record, meaning do they have a common attribute that links them?

I want to display all SaleOrder of a certain customer in the “project-form”(view).
The Project and the SaleOrder has the same customer.

so I want to to display the SaleOrder.salemanUser into the “project-form”(view).

I was looking onto the RefSelect widget but I am confuse on to where to write the codes they are sampling.

Any help would be great,

KR


#2

hi,

You can use in your action-view a domain filter:
<domain>self.clientPartner = :partner</domain> <context name=":partner" expr="__self__.clientPartner">

in the domain you have to specify the JPQL query with var (prefix by :). Var will be assigned by “context”. So if you assign a “Projet” model to your action and link this action using a panel-dashlet inside a projet form the __self__ value will be equals to the current project and the :partner in the domain will be replaced by the value of the projet partner.


#3

Good day sir I tried your code but I fetched 0(zero) records instead.

I also try my own like this:

[quote=“gengulay, post:3, topic:1822, full:true”]
Good day sir I tried your code but I fetched 0(zero) records instead.

I also try my own code like this:

< action-view name=“sc.hist.completed.sale.orders-maverick” model=“com.axelor.apps.sale.db.SaleOrder” title=“Sales Man”>

< domain> self.clientPartner.id = :_clientPartner.id< /domain> // the customer of the Sale
< context name="_clientPartner.id" expr=“eval:id” / >

My code is “invalid domain”

So basically I want to fetch all SaleOrder that has the same clientPartner.id of the current Project viewed.

do you have another domain filter suggestion?

many thanks sir.


#4

Hi,

If I understand, your goal is to display inside a project view a list of orders of the customer.
Inside the domain node, the JPQL will target the SaleOrder object & fields, inside the context the project object & fields. So let’s try this:

< action-view name=“sc.hist.completed.sale.orders-maverick” model=“com.axelor.apps.sale.db.SaleOrder” title=“Sales Man”>

< domain> self.clientPartner.id = :clientPartner< /domain> // SaleOrder JPSL
< context name="clientPartner" expr=“clientPartner.id” / > // the Project var (:clientPartner) assignation

Just note that the “:clientPartner” inside the domain is a var that is populated using the context. A var has no “:” in context (just its name), has “:” in the domain to mark it as a var.

Regards


closed #5

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.