Saving the data entered without pressing the Save button in POS

Asked by Bushair

Hi,
I want to add a new functionality like Save ,which should be done when i press the button MakePayment
For example:

Navigate to POS window,
Enter product details
When i press the MakePayment i want the data to get saved, without pressing the SAVE button in the toolbar.

How can i implemen these changes in the code?
Where is the code located for the Save function and MakePayment function in POS?

Also when i press F2 from the product box, it is bringing a pop window with all the products.
i would like to have the cursor pointing to the Name field without placing the cursor on the Name field
Means when this pop window comes ,i want the cursor to be placed in the name field.
What code should i change for this?
how this can be achieved.

like this i would like to modify some more changes like
when i type the products name ,say 3 letter of the product ,i want to list all the items with this name in the list without pressing the Filter button or enter button.
Filter should be done when i type the products name in the name field.

thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Vinay Rana (OpenERP)
Solved:
Last query:
Last reply:
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#1

Hello,

=>When you will press the button Make Payment then it will call a payment wizard and from payment wizard When you will press Make Payment button it will already save your record no need to press save button.
=>when you press F2 from the product box and the curser focus is already in name as search field on tree view and by pressing tab button you can change the curser position.
=>for character wise search in perticular field like many2one you needed to change in view '.xml' file by putting this many2one field as selection field like following way :
 <field name="fieldname" widget="selection"/>
so now your field will show as selection and on selection field you can search as character combination with typing.

Hope this will help you.

Thanks.

Revision history for this message
Bushair (bushairka) said :
#2

Hi,
Thank you very much for the answer.
Some more clarification required are

=>When i press the button Make Payment then it will call a payment wizard and from payment wizard When you will press Make Payment button it will already save
           Here i would like to display the message Document Saved at the bottom of the page the same message which will display when i press the Save button.
What code i should change for this? where is the code for that?

=>when you press F2 from the product box and the curser focus is already in name as search field on tree view

      This is not correct , i have pressed F2 from the product box and then the cursor is in BasicSearch when i press Tab.
If i want the cursor to be in name field, what is the code changes i have to do ?

=>for character wise search in perticular field like many2one you needed to change in view '.xml' file by putting this many2one field as selection field like following way :
 <field name="fieldname" widget="selection"/>

When i press the F2 in the product , it is poping up the Search Product window.
Here what i want is that if i press "ba" in the Name fileld , Without press Enter button,it should display all the products name with "ba"

For this change what code i should change?

The existing functionality is like if i type "ba" and then press enter , am getting the product list , but i prefer this list to come
without pressing enter button...while typing itself it should bring up the product list

Thanks

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#3

Hello Bushair,

=>Here i would like to display the message Document Saved at the bottom of the page the same message which will display when i press the Save button.What code i should change for this? where is the code for that?
*This is maintained by client side so you cannot do this from server side code.You can add one separate state field in class and write its state as 'Document Saved' when the Make Payment action is called.

=> This is not correct , i have pressed F2 from the product box and then the cursor is in BasicSearch when i press Tab.
If i want the cursor to be in name field, what is the code changes i have to do ?
*Yes the focus on name field of search and this all thing is common for all , in tree view you do not set focus for special one field it will take focus on line bases.

=>When i press the F2 in the product , it is poping up the Search Product window.
Here what i want is that if i press "ba" in the Name fileld , Without press Enter button,it should display all the products name with "ba"
*<field completion="1" name="company_id" select="2"/> , use completion="1" this option with many2one.

Revision history for this message
Bushair (bushairka) said :
#4

Hi Vra
Thanks for the information

*This is maintained by client side so you cannot do this from server side code.You can add one separate state field in class and write its state as 'Document Saved' when the Make Payment action is called.

###Can you please let me know how to do this?Also how to add one separate state field in class ?

*Yes the focus on name field of search and this all thing is common for all

### is there anyway that i can implement this set focus functionality to the field which i prefer?

Thanks
Bushair

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#5

Hello Bushair,

=>Can you please let me know how to do this?Also how to add one separate state field in class ?
vra ans=>The related code is already available in tiny you can see any workflow related form like invoice object form there on state field which is readonly and maintained by workflow like by intial stage it is in draft state and when you create any invoice it will going into open state.

=>is there anyway that i can implement this set focus functionality to the field which i prefer?
vra ans=>sorry but this type thing is needed much more customization from client side so better you ignore this.

Thanks.

Revision history for this message
Bushair (bushairka) said :
#6

Hi,
In the following code, i have a doubt

 _columns = {
        'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], required=True, change_default=True),
}

What does the first , second ,third and fifth parameter indicates/means?

1:'product.product'

2:'Product'

3:domain=[('sale_ok', '=', True)],

5:change_default=True

Thanks

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#7

Hello,

1:'product.product'
ans: Model name

2.'Product'
Ans : String Used in form/tree view.

3.domain=[('sale_ok', '=', True)]
Ans: Here assign one domain that only those product will be viewed which has sale_ok=True(help= "Determine if the product can be visible in the list of product within a selection from a sale order line.") means which are sell able.

4.change_default=True
Ans: This is set from client side.It is used to change the _default value, means suppose you have assigned some value by default in particular field and you wanted to change this value in inheriting object class.Then this is possible with the help of this option.

Hope this will help you.

Thanks.

Revision history for this message
Bushair (bushairka) said :
#8

Hi,
I modifed the pos.order view as follows

The existing code is
<form string="Order lines">

<field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)" widget="selection"/>

The modified one is

<form string="Order lines">

 <field completion="1" name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)" widget="selection" select = "2"/>

But i couldnt see any difference in the behaviour,
Can you please tell me what exactly is the difference between the above 2 lines of codes?

Also what is meant by the follwing parameters

1: on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)"

2: widget="selection"

Thanks

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#9

Hello,

 If you have added completion="1" parameter then no need to add widget="selection".
1.on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)"
=>It is onchange parameter which will call the function onchange_product_id which is defined in the related view object class.

Thanks.

Revision history for this message
Bushair (bushairka) said :
#10

Hi,

1:'product.product'
ans: Model name

How can i open this model?
i would like to do some changes in this product.product model
How can i do this?

Thanks

Revision history for this message
Mantavya Gajjar (Open ERP) (mga) said :
#11

Hello

any changes applied to openerp must be done by developing a new module using api look at doc.openerp.com for more info on creating new module

Mga
------Original Message------
From: Bushair
Sender: <email address hidden>
To: <email address hidden>
ReplyTo: <email address hidden>
Subject: Re: [Question #97953]: Saving the data entered without pressing theSave button in POS
Sent: Jan 31, 2010 3:07 PM

Question #97953 on OpenObject Addons changed:
https://answers.launchpad.net/openobject-addons/+question/97953

    Status: Answered => Open

Bushair is still having a problem:
Hi,

1:'product.product'
ans: Model name

How can i open this model?
i would like to do some changes in this product.product model
How can i do this?

Thanks

--
You received this question notification because you are an answer
contact for OpenObject Addons.

Sent from my BlackBerry® smartphone from !DEA

Revision history for this message
Bushair (bushairka) said :
#12

Hi,
Am not going to develop a new module, i just want to test some customization .

Navigate to MainMenu -> PointOfSale ->PointOfSale

Add a new product
Press F2 from Product field.
Which will bring a pop up window Search Products with the following fileds in the pop up window.

    * Basic Search * Advanced Search

Name: Code:
Category: Variant Price Margin: -

Variant Price Extra: -

Filter New Select Close
<< First < Previous [1 - 20 of 29] Next > Last >>
Change Limit:
   Code Name Variants Default UoM Real Stock Virtual Stock List Price Cost Price Status

the name field , i would like to make a widget = selection,for making this change which xml file i should open and what change i should do?

thanks
Bushair

Revision history for this message
Mantavya Gajjar (Open ERP) (mga) said :
#13

For customization do not change code. Just go to web client open a form you want change you will an option for manage view object and workflow go through that

Mga
------Original Message------
From: Bushair
Sender: <email address hidden>
To: <email address hidden>
ReplyTo: <email address hidden>
Subject: Re: [Question #97953]: Saving the data entered without pressingtheSave button in POS
Sent: Jan 31, 2010 4:41 PM

Question #97953 on OpenObject Addons changed:
https://answers.launchpad.net/openobject-addons/+question/97953

    Status: Answered => Open

Bushair is still having a problem:
Hi,
Am not going to develop a new module, i just want to test some customization .

Navigate to MainMenu -> PointOfSale ->PointOfSale

Add a new product
Press F2 from Product field.
Which will bring a pop up window Search Products with the following fileds in the pop up window.

    * Basic Search * Advanced Search

Name: Code:
Category: Variant Price Margin: -

Variant Price Extra: -

Filter New Select Close
<< First < Previous [1 - 20 of 29] Next > Last >>
Change Limit:
   Code Name Variants Default UoM Real Stock Virtual Stock List Price Cost Price Status

the name field , i would like to make a widget = selection,for making this change which xml file i should open and what change i should do?

thanks
Bushair

--
You received this question notification because you are an answer
contact for OpenObject Addons.

Sent from my BlackBerry® smartphone from !DEA

Revision history for this message
Bushair (bushairka) said :
#14

Hi,
Thank you very much for the answer.
i really appreciate your sudden response.

Can you please tell me how to customize the page, since you have mentioned in last message that i have to open the
page using web client and change it,
It will be great if you can tell me how to change..
My requirement is

Navigate to MainMenu -> PointOfSale ->PointOfSale

Add a new product
Press F2 from Product field.
Which will bring a pop up window Search Products with the following fileds in the pop up window.

    * Basic Search * Advanced Search

Name: Code:
Category: Variant Price Margin: -

Variant Price Extra: -

i want to make the"Name:" field in the pop uo window as selection field(widget = selection).
How to do this using web client?

thanks

Revision history for this message
Mantavya Gajjar (Open ERP) (mga) said :
#15

Hello

Open a view you want to customize and look at left down corner

You will see manage link

On hover you will get a list of 3 menus

Mga
------Original Message------
From: Bushair
Sender: <email address hidden>
To: <email address hidden>
ReplyTo: <email address hidden>
Subject: Re: [Question #97953]: Saving the data entered withoutpressingtheSave button in POS
Sent: Jan 31, 2010 4:54 PM

Question #97953 on OpenObject Addons changed:
https://answers.launchpad.net/openobject-addons/+question/97953

    Status: Answered => Open

Bushair is still having a problem:
Hi,
Thank you very much for the answer.
i really appreciate your sudden response.

Can you please tell me how to customize the page, since you have mentioned in last message that i have to open the
page using web client and change it,
It will be great if you can tell me how to change..
My requirement is

Navigate to MainMenu -> PointOfSale ->PointOfSale

Add a new product
Press F2 from Product field.
Which will bring a pop up window Search Products with the following fileds in the pop up window.

    * Basic Search * Advanced Search

Name: Code:
Category: Variant Price Margin: -

Variant Price Extra: -

i want to make the"Name:" field in the pop uo window as selection field(widget = selection).
How to do this using web client?

thanks

--
You received this question notification because you are an answer
contact for OpenObject Addons.

Sent from my BlackBerry® smartphone from !DEA

Revision history for this message
Bushair (bushairka) said :
#16

Hi,
I think still there is some confusion on this issue.
Steps done to replicate my query.

1: Navigate to MainMenu->PointOfSale ->PointOfSale
2:Select Create a new entry button which will bring a new line under Product
3:Press F2 from Product field.This will pop up up a window as shown below(Can you please have a look into this window)

This pop window has the following fields

* Basic Search * Advanced Search

Name: Code: Category: Variant Price Margin: -

Variant Price Extra: -

Below to this fields you can see the following labels

   Code Name Variants Default UoM Real Stock Virtual Stock List Price Cost Price Status

 But in the pos.py file i can see the code for poping up the window on Product field

 _columns = {
        'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], required=True, change_default=True),
}

Now Naviagate to Administration->Customization ->User Interface ->Views

open the view product.product ,which is the one mentioned above.
The content of this view is

<?xml version="1.0"?>

                <tree colors="red:virtual_available&lt;0;blue:state in ['draft', 'end', 'obsolete']" string="Products">
                    <field name="default_code"/>
                    <field name="name"/>
                    <field name="variants"/>
                    <field name="uom_id"/>
                    <field name="qty_available"/>
                    <field name="virtual_available"/>
                    <field invisible="'partner_id' not in context" name="price"/>
                    <field name="lst_price"/>
                    <field name="standard_price"/>
                    <field name="state"/>
                </tree>

Now please have a look into the pop up window which is opened when you press F2 from Product field.
The pop window has the following fileds

* Basic Search * Advanced Search

Name: Code: Category: Variant Price Margin: -

Variant Price Extra: -

Where is the code for this fields.

The view has the fields for the following lables
 Code Name Variants Default UoM Real Stock Virtual Stock List Price Cost Price Status

When the pop window has come, can you see the Name and Category field?Both are editable.
i would like to make this "Name" and Category field as widget= selection.
for this what changes i should do?
where is the code/file located for this change?

Hope you understood my explanation.

thanks

Revision history for this message
Best Vinay Rana (OpenERP) (vra-openerp) said :
#17

Hello Bushair,

From Administration/Customization/User Interface/Views menu open the view with the name : product.normal.form ,and replace categ_id field which is defined group which name string is status.
<field name="categ_id" select="1" widget="selection"/>
Name field is not many2one type field so you can not assign this in selection field because it is charector type field.

Hope this will help you.

Thanks.

Revision history for this message
Bushair (bushairka) said :
#18

Hi,
Thanks in millions...
this what i was looking for...

Thanks
Bushair