Automatically register payment and generate invoice when amount is zero - odoo

When pressing the "Confirm Sale" button, even if the total amount to be paid is zero (because of the 100% discount), the Register Payment popup is getting displayed - and I need to press Cancel in the popup to proceed (generate invoice & and mark it as paid).
Can I bypass displaying the popup - automatically generate the invoice and mark it as paid?
Please let me know.
Thanks.

There are two ways you can achieve this.
Write a module to overwrite the buttons named Create Invoice method and call a method to check if the total amount is zero then prepare the invoice values and automatically generate the invoice and view if needed. The rest with non-zero amount should follow the wizard path.
Create an automated action, where you can filter the SOs which are confirmed and has zero total and automatically create the invoices. You can combine this with scheduled actions to check it every X minutes or hours. This can be tricker than explained and may require some coding in the action.

Related

Need help on implementing this Use-Case Scenario in NetSuite Oracle

I am very new to E-Commerce World.
I have a use case scenario that I want to Implement in Oracle NetSuite.
But I am not sure how to move forward with it.
Use-Case Scenario:
A Sales Order has a few Line Items & Among them, a few are out of stock.
The 3PL currently I am dealing with accepts only one Unique Sales Order ID as an Identifier.
I want to fulfill the items that are currently in stock and Later on, when the Inventory gets updated I want to fulfill the remaining Items back-ordered in the Sales Order.
But the fulfillment should happen only after the customer has paid for the Items.
Can anyone let me know? How can I achieve this?
Thank you.
You will probably need some customisation to achieve this. I don't know the full set of processes you're working with, but as a general approach, I would suggest the following:
Set up a payment term that says the customer must prepay.
Set up a script to run on your fulfilments, handle "prepay" customers.
You'll also want to check your settings in Setup > Accounting > Accounting Preferences > Order Management. Look for the option on sales orders and fulfilment. You'll probably want to default your fulfilment to available quantity only. You may want to prevent overage on your fulfilments.
When the script executes on your fulfilment, it should execute "before load". The script will need to check the sales order it's fulfilling. If the term is "prepay", the script should then check if a payment has been made against the sales order. You'll potentially need to consider deposits and paid invoices. If the script finds no payments, then it should block the fulfilment.
I'm working on the assumption that you will create a fulfilment with a "Picked" status to send to your warehouse. When they confirm the "goods-out", you will want some sort of feedback loop from your 3PL to set the fulfilment to "Shipped" and update your tracking numbers.
I hope this helps.
Mark

Automate sale order to invoice creation in odoo

Is there an easy way to automate the sale order process ?
I have customer whose salesman will create Sale orders for every sim he creates.
Once Sale order is closed both DC and Invoice should be created and validated automatically, there is no need for stock picking/packing concepts.
Could someone have any idea on doing it without affecting the default flow ?
Or should I call every function related to that process in my module ?
I tried calling the functions in stock picking and then tried validating DC. I got the odoo Warning as
'You have a difference between quantity on the operation and the quantities specified for the lots'
Could you please suggest me which particular function picks the product from stock in stock.picking ?
Hi Nirmalraj Rethinasabapathi,
Yes, I think I have done it for my project.
I can map What I have done to achieve that:
Added two boolean fields in Warehouse form.
One for "Auto Validate Invoice" and another one is for "Automation In Delivery"
Override sales confirmation button action and bypass all the function you want.
It is working perfectly for me.

Is it possible to show the number of pre-orders on the product page?

My primary business is pre-orders, and this is how it works:
I list an item for sale.
My customers order the item. Their credit card is authorized but not charged.
Once a minimum number of orders are placed, the customers are charged, and the buy is live.
If, after a specified amount of time, the minimum is not reached, all orders are cancelled.
What i would like to do is this:
Specify the minimum number of orders needed for a particular item in the backend. (not 100% needed, but it would be nice).
Display the total number of pre-orders on the product page, so that my customers know how many are left before the buy is live (it would be great to show it in the following format: 23/50 Ordered).
Does anyone know if this is possible? If so, can you please explain to me what I need to do in order to make this happen?
Thanks!
P.S. - In case it doesn't show up, I'm using Bigcommerce
Store the minimum needed as a custom field & set the initial inventory to that same number. You'll also need to allow inventory to be displayed for pre-orders, though you can hide it from display if you'd like (we only want it present in the DOM).
As the products are pre-ordered, inventory will decrement. Use javascript to subtract the number left in inventory from the original number (the custom field) and display in the ProductDetails.html panel.

CRM - Lock fields in certain view

In the entity Quote for example, there is a view on the form that shows what products have been selected for the quote, with the ability to view;
Product Name
Price Per Unit
Quantity
Discount
Extended Amount
My issue is that Product Name, Price Per Unit and Extended Amount are locked on the view therefore cannot be changed.
I would like to do the same for discount, any suggestions?
Currently, you cannot change the behavior of this default line item view so you have a few options:
Create your own quote line item view and show that in place of the system view. The drawback here is your view will not allow you to do in-line edits - you would have to open the quote item to edit each entry.
Create a synchronous plugin on the QuoteDetail entity's pre-processing add and update event which is filtered on the discount field. This plugin would simply throw an exception whenever a non-zero amount is attempted to be pushed through. This effectively makes the discount field disabled as any entry will result in an error on save.

Sql Transaction for POS

I am developing a POS for a pharmacy the scenario is like this:
1. a user select category and then Item, then the item will be pass to DataGridview, the use can increase and decrease the value of item.
2. the user select customer and other necessary information.
3. the user press the pay button and all insertion to stock, account register, sales invoice will be done in back of this pay button.
P.S: this system is multi User, mean Lan based.
Now, my question is that, I am trying to tell that system that check with still no changes come to qty of item in stock, if come rollback else commit.
Can I use Sql Transaction or no?
Thanks in Advance for answer.