Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import the plugin: the file odooStep.tar doesn't contain class: odooStep #3

Open
hchautrung opened this issue Nov 27, 2017 · 13 comments

Comments

@hchautrung
Copy link

Dear,

I am new to Process Maker. I tried to install this plugin with Process Maker 3.1 by downloading the source code and create a .tar file --> Then import the tar file via Plugin Manager. However, I got this error

"The file odooStep.tar doesn't contain class: odooStep"

Please advise,
Thank you very much!

@ecdani
Copy link
Owner

ecdani commented Nov 27, 2017

Hi,
Here is a possible answer for you: #2

However, keep in mind that its still under development.

@hchautrung
Copy link
Author

hchautrung commented Nov 28, 2017

Hi Ecdani,

Please correct me if your name is incorrect. Thank you for your information. I copied all file to "workflow\engine\plugins" and it works fine. I have some concerns

  • Does the plugin work fine with Odoo 11?

  • Might we use and modify the code of the plugin then use in our project?

  • I saw in your demo, there is a step so called "CargaProductos" in Odoo Steps Creator". The step has a model (Modelo) names "product.product" to load products in "Purchase details" when submit a new Order request form, is it? If I guess correctly, please show how can we initialize product data?

Thank you,
Trung.

@ecdani
Copy link
Owner

ecdani commented Nov 28, 2017

I'm Dani, but you can use my nickname.

  • Does the plugin work fine with Odoo 11?

I think that as long as the XML-RPC API remains unchanged in Odoo the plugin will work, but i do not tried it yet.

  • Might we use and modify the code of the plugin then use in our project?

Yes, of course, as long as the license is respected: https://github.com/ecdani/odooStep/blob/master/LICENSE

  • If I guess correctly, please show how can we initialize product data?

That is one of the purposes of the plugin, the data is loaded from Odoo, product.product is a model of Odoo.

There is usually a models reference in Odoo under "developer settings mode", anyway you must appeal to the database in many cases to get the model.

If this is not what you want, you can initialize a PM array instead: http://wiki.processmaker.com/3.1/Variables

I hope I have helped.

@hchautrung
Copy link
Author

Hi Dani,

Thank you for your reply. Its quite clear and have helped me a lot. I will test the plugin and let you know.
Regards,
Trung.

@hchautrung
Copy link
Author

hchautrung commented Nov 29, 2017

Hi Dani,

I got the notices
Notice: Undefined index: partner in D:\www\htdocs\processmaker31\workflow\engine\plugins\odooStep\SosApp.class.php on line 526

Notice: Undefined index: itemGrid in D:\www\htdocs\processmaker31\workflow\engine\plugins\odooStep\SosApp.class.php on line 530 .

Supposedly, I did these steps below to get products from Odoo (product.product model) to put in the drop-down control in Request Purchase Form

  1. Created a LoadProduct step to load product from Odoo

image

  1. Add step LoadProduct to Submit Request task, and assign the task to Staff account

image

Order Request Form

image

  1. Login with Staff account and start a new case, then I returned data from Odoo and the notices

image

Then I check source code in file SosApp.class.php at line 526 and 530

image

Please advise

  • partner, itemGrid mean here, for debug purpose only is it?
  • Would you mind to explain a bit reagarding Parámetros, Parámetros KW fields in Odoo Step UI? and how are the format of them?
  • I noticed that name, description fields in Parámetros KW are not column names in product_product table of Odoo database but how can it returns data from Odoo
  • Kindly show what are the Odoo Steps code (CrearLineasPedido, CrearPedido) to push order request to Odoo ( I saw in the video, you access Odoo and can see order request)
  • Might I get the exported the project in the deme video?

Thanks a lot
Trung.

@ecdani
Copy link
Owner

ecdani commented Nov 29, 2017

Hi,

Did you create odoo_product variable in process maker first?
You need to declare it at least (http://wiki.processmaker.com/3.1/Variables)

NOTE: I did searching for getVarFieldType function in source code, I realized that there is no definition for this function.

getVarFieldType() is a process maker function, you can see the declaration in htdocs/workflow/engine/classes/model/om/BaseProcessVariables.php and again in workflow/engine/classes/model/om/BaseProcessVariables.php i dont know what definition uses Process maker, but both are the same.

The postprocessMethod() is not completly developed, this function try to get the type of the output variable (@@odoo_product in your case) and apply a "postprocessfunction" that convert the Odoo response in an acceptable Process Maker variable.

The combinatorial of cases is a headache. Im still trying to figure out how to approach it in a good way.

Anyway, your case must work.

"I click here then nothing is happened"

That is a Process maker issue, not related with odooStep :)

would you mind to explain a bit reagarding Parámetros, Parámetros KW fields in Odoo Step UI? and how are the format of them?

There is a very strong correlation with Odoo XML-RPC API: https://www.odoo.com/documentation/8.0/api_integration.html#calling-methods

The format in parameters is like: value,value,value,... etc
And in KW parameters: key:value,value,value... INTRO key:value,value... etc

In some cases, like create_multiple, they have a different behavior. The variables must be iterable, and it will iterate it doing multiple create calls.

Definitely i need to document this.

And finally, please apologize me my surely bad english.

@hchautrung
Copy link
Author

Hi Dani,

Thank you very much for your information. I can get returned product from Odoo already and just updated the previous comment. Kindly advise me the following concerns

  • I noticed that name, description fields in Parámetros KW are not the same column names in product_product table of Odoo database, is there any mapping to map these fields to product_product column in your plugin?

  • Kindly show the Odoo Steps definition to create CrearLineasPedido, CrearPedido and others to push order lines to Odoo ( I saw in the video, you access Odoo and can see order request)

  • Might I get the exported the project in the demo video?

Regards,
Trung.

@ecdani
Copy link
Owner

ecdani commented Nov 29, 2017

Hi,

is there any mapping to map these fields to product_product column in your plugin?
No.

Is better to search the model in Odoo first, try this: activate developer mode (in settings main screen), navigate where is show in the image and search what you want.

imagen

Kindly show the Odoo Steps definition to create CrearLineasPedido, CrearPedido and others to push order lines to Odoo ( I saw in the video, you access Odoo and can see order request)

I think the definition is in the video, anyway here is:

Name: CrearLineasPedido
Proceso:
Método: create_multiple
Modelo: purchase.order.line
Parámetros:
name:auxGrid ---> Its a literal string, none special
price_unit:616 ---> Its a literal string, none special
product_uom:1 ---> Its a literal string, none special
date_planned:@@requestDate ---> Its a simple variable, same value for all lines.
product_id:@@itemGrid ---> Its a array (grid) variable, value vary in each line.
product_qty:@@itemGrid ---> Same, it will use "product_qty" key present in the grid variable.
order_id:@@orderID ---> Its a simple variable, same value for all lines.
Parámetros KW:
Salida: lineasCreadas ---> a simple variable (i decided not demand @@ here. its not needed here)

The grid type variable have a form like this (or similar), the key in kwparameters is used as fieldkey to retrieve the value:
[0] ->[fieldkey:value],[fieldkey:value],[fieldkey:value]...
[1] ->[fieldkey:value],[fieldkey:value],[fieldkey:value]...
....

Name: CrearPedido
Proceso:
Método: create
Modelo:purchase.order
Parámetros:
partner_id:@@partner ---> Its a simple variable
Parámetros KW:
Salida: orderId ---> Its a simple variable

Might I get the exported the project in the demo video?

I cant supose how this can be exported. The project is the tutorial of process maker, with the additions you can see in the video. Is quite simple (and quicker) replicate it.
http://wiki.processmaker.com/3.0/getting_started

I just noticed the modification in your previous comment. I'm going to see it.

@ecdani
Copy link
Owner

ecdani commented Nov 29, 2017

partner, itemGrid mean here, for debug purpose only is it?
Yes. :)

I maintain that "step screen" that does nothing for debug purposes.

@hchautrung
Copy link
Author

Hi Dani,

Thank you for your detailed and clear explanation. It was very helpful and understandable. I will try tomorrow and update you. If our company want to combine Odoo + ProcessMaker, I will definitely use your code, make modification.

Thanks a lot,
Trung.

@hchautrung
Copy link
Author

Hi Dani,

Just to update you, I can run your code to show demo without any problems. I think I will modify your code to apply in our company.

Thank you so much.
Trung.

@ecdani
Copy link
Owner

ecdani commented Dec 9, 2017

That sounds great.

I upload a new version, i retrieve prices and create a track code from process maker in Odoo.
Just to update you.

@hchautrung
Copy link
Author

Hi Dani,

That's great because I'm going to get the price when making a purchase request. Please update me if you update new features.
Thanks a lot,
Trung.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants