Why Invoice state goes directly to paid instead of open from draft? - odoo

I am trying to make invoices in Odoo v10. When I am logged in as Administrator and make invoice, the invoice go from draft to open state. But when i am logged in as some other user, invoice state goes from draft to paid state directly without going into paid state.
What could be the reason for this??
using the above form

Found the error. Actually I made a mistake. While adding an invoice line I added a account of type receivable. So, it was going directly to paid state.
Receivable/payable account types in invoice lines
will take the invoice to paid state directly while other types will take it to open state.
So, I just changed the account type and it worked.

I'm going to suppose that you are modifying this module or it's behavior, so you probably are messing with some of the basic methods. For example
Validate
The basic behavior of validate for account_invoice is here, you can see that it returns a open state
addons/account/models/account_invoice.py#L923
A couple of questions:
what button is giving you this behavior?
are you modifying a method?
can you share more information, a video maybe?
if you are modifying explain what method and what does it do please

Related

Shopify create order admin api not taking email all of a sudden

Admin API 2021-10 Orders endpoint is throwing the following error for already existing user
{\"customer\":[\"Email has already been taken\"]}
This problem was not there before. Does anyone know if something changed recently API-wise? no documentation regarding the update was found
Usually when creating orders, you would want to use a Customer ID for an order when creating it. So you check, via email, does this customer even exist? If it does, you just provide the ID. If you skip that step (remember, customers are a separate aspect of Shopify Orders), you may then run into this issue. Shopify is given an email, tries to create a customer, and the system says STOP RIGHT THERE, this customer already exists, and you never provided an ID.
Sounds weird, but maybe you never encountered this issue because you just never ran into repeat customers? As you know, most orders are one-time and not repeat at a lot of stores.
Not sure this explanation makes total sense, but anyway, the workaround I found was just to establish the customer BEFORE trying to create the order. Either you use an ID for an existing one, or, create a new one.

Stripe open value subscriptions or product values

So Stripe support is currently not able to answer my questions. I have a Wufoo form set up and Stripe subscriptions tied to it. Well I have mapped the product values in the Stripe subscriptions to my form values.
However, I am not looking at an open field for a donation form to let a user define a price. Stripe support can't seem to find an answer. My assumption the support staff is combing their documentation and Google to find an answer and they can't, the same as I have.
That said, does anyone know if you can pass an open value to a Stripe subscription.
In essence letting a donor define the price they want to pay monthly.
So I checked with Wufoo and through them, the answer is no. Not right now. You can not add an open value. I have seen other systems using Stripe in which they allow open values, which means it is possible, but I guess not through Wufoo and you will probably have to write your own subscription code to handle it.

How to get a product modification log in Prestashop?

Is there a way to know what specific changes were made to a product in Prestashop 1.7?
In Advanced parameters> Logs I can see the employee who has made the modification, the severity, the message of the modification, the id of the object that has been modified and the date on which the modification was made, but it does not show me what the modification was. specific change that was made, if the name, price, description etc.
Is there a way to know that?
There is a way but it's a complex issue, you can hook into dynamic hooks like:
actionObjecProductUpdateBefore
and
actionObjectProductUpdateAfter
and compare two set of object data to see what has been changed.
Of course if you want to log more detailed informations like changes in Specific Prices etc. you also need to get informations about them before and after product change, it might be a time and resource consuming operation so be careful with it.

How do I create a custom payment module on Prestashop without a credit card?

This is the first time I've asked a question on here so I'm sure I'll be off on the question I'm trying to ask, but here's what I'm dealing with:
I'm using prestashop on my website that will only accept payment from people within our Bartering service group. So the only information needed for them to place an order is their contact information and their personal ID from the Bartering group so that we can accept the order and make sure they apply that. So I want to change the checkout to not actually charge anything, but rather send an email to the sales team and to the customer containing the product they ordered and their personal information. I've already done a couple of overrides with prestashop, but I haven't been able to find what all modules/classes need overridden for this particular issue.
Any advice even a basic list of what modules and classes to look at would be helpful. Thanks in advance.
Edit: Thanks for the advice folks. I think the module should be pretty straight forward. It does not have to charge any balance or anything, just send an email with the order details and customer info to both us and the customer.

VirtoCommerce - Creation of a new payment gateway

I have a big problem dealing with new payment gateway creation. I followed a tutorial but I think I did something wrong because it doesn't work well.
I would like to create a "devis" (sorry I don't know the word in english... It looks like that.
When the customer buys something, he could choose this kind of payment which does nothing but provide the "devis". It would be perfect if the status of the order could be "on hold" directly in order to unhold it when the "real payment" is done.
I hope you have understand what I try to do but if you have not be free to ask me questions.
Here is what I've done:
I created a new class in the VirtoCommerce.PaymentGateways namespace called DevisPaymentGateway which inherits from the PaymentGatewayBase class.
In this class there is just one method: ProcessPayment where I do:
payment.status = PaymentStatus.Completed.ToString();
in the SqlOrderDatabaseInitializer.cs
I created a private SetupDevisGateway method:
private void SetupPaypalGateway(List<PaymentGateway> gateways)
which is called in the CreatePaymentGateways method just after the paypal gateway.
I deployed the database thanks to your powershell script, the gateway
is created as expected.
I enabled the gateway payment via
VirtoCommerce Manager Then I bought something on the website and I
chose the new Payment which is available so it seems to work.
When I click on proceed to checkout I have a new order line which is created
with the "Pending" status so it's perfect...
When I bought something with paypal for example, there was the same reaction BUUUT when the new order line was created there was the onBeforeUpdate method which detected that new line and some work was done asynchronously. With the new gateway it seems that the onBeforeUpdate method doesn't work anymore...
I think that I've forgot something which is done with Paypal and not with my gateway but what and where?
I already know that it's not a good idea to write something in the SqlOrderDatabaseInitializer.cs but I don't think that it's the problem... Does anybody have a solution?
Thanks
Edit: Explanation on what I try to achieve:
Products which are sold are in fact a couple: "images treatments" + "images"
Each customer can manage album and put photos into it, and when he clicks on a product (which is a treatment) he can choose an album.
So it's why I need this event, when the payment is done and the status change from pending to in progress, I send relevant information (about the treatment, the album...) to a queue and I have worker roles (one for each treatment) which read these messages and do some work.
I hope you understand the idea but if you don't, do not hesitate to ask me questions
can you explain why do you need that event? What will you do when that event is raised?
Some explanation below on how status is changed for the order below:
The order status is actually changed by the job "ProcessOrderStatusWork class" that simply runs in the background and changes the status order status from "Pending" to "InProgress" after order has been in pending state for a certain period of time. I would suggesting for you to create a copy of "ProcessOrderStatusWork" class and create a new job (name it MyProcessOrderStatusWork class), that in addition to changing status also adds custom work for your payment. You can then register that Job and disable the one included with VC, so it is not duplicated (by adding it in the database,similar to how you did payment gateway).
It might work for PayPal, because it uses slightly different logic, as order created on call back from PayPal, thus executing in the same web process and event is raised.