How can i change due date of invoice after the validation - odoo-9

I want to change some fields after the validation of the invoice when i do a payment (mostly i need it for the due date) in a way that due date takes the payment date when a i have a partial payment in order to know all the due date . Should i create a new function or i override a function that already exist ?Any idea for help please ?

Related

codeigniter custome validation for multiple input controls together

In my codeigniter form contains year , month selectboxes and many input controls. how to validate selected year and month already exitsts in my mysql table when form submitting ? ( custom validation for multiple input controls togethers)
ur question is not clear.
but i think you need to verify if a selected year and month by user is already exist or not. if that's it ur question you need to create ajax request with jquery to verify they are exist or not

Updating Transaction Currency On Form Doesn't Update Custom Money Currency Symbol

I'm creating an empty shell of a lead on a custom web page, then redirecting the user to the newly created lead. The TransactionCurrencyId on the lead is empty on load, and in the OnLoad event, JS is setting the TransactionCurrencyId, and then populating the custom Money field. Upon setting the money field, the following alert is being thrown:
A Currency is required if a value exists in a money field. Select a
currency and try again.
Manually clearing the TransactionCurrencyId, and then re-selecting the TransactionCurrency allows the user to manually populate the value.
Shouldn't the Transaction Currency be set by default, and how do I set the TransactionCurrencyId in order to set the Custom Money Currency Symbol?
I was able to get around this be calling this on the custom Money attribute in the onLoad, before actually setting the value:
att.$2_2.setCurrencySymbol("$")
Of course this is unsupported and not an ideal solution...

Throwing a message when Updating/Validating Part contents/data

Crosspost: https://orchard.codeplex.com/discussions/455498
When updating a Part, in the DriverResult Editor, how can we manually throw a warning message when implementing custom validation?
I want to add a custom validation for some date fields, where values are dependent on some other field in the Content Item itself (dates in the part need to be between a specific date in the content item's field).
Which leads me to another question, can we set validation in model properties between one another? Like if there are two properties StartDate and EndDate, is it doable in the model to declare that end date must be after start date?
You can add model validation errors using the "updater" parameter being passed in:
updater.AddModelError("StartDate", T("Please enter a date in the future"));

created_at column is taking junk date in magento when editing the customer

I’m using Magento 1.6.1CE.
I have set the default time zone to Australia/Perth. my server also running in the same time Zone.
when creating the customer there is no issue with created_at column in DB and Customer Since column in admin html.
But when edit the details and Update no problem in saving but Customer Since column is taking some junk date like 30/11/00-1 1:30:00 AM or 01/01/1970 9:30:00 AM. so I’m unable to edit it next time(showing Exception handling is disabled)
when I see in the DB created_at it is showing 0000-00-00 00:00:00.
Please let me know how can I solve this problem. I’m new to Magento Coding.
Thanks in Advance…
I had similar issue once. It's because Magento assumes a specific date format, which depends on your locale.
By default Magento uses format Month/Day/Year. In your case it seems like Magento acutally shifts Day and Month. So, make sure that "Locale" and "Timezone" in System > Configuration > General > Locale Options match.
If they match and you still get this issue, then you will can try to rewrite customer edit block or a controller action.

Magento: how do I determine if a customer is new?

I want to be able to send different order confirmation emails to new customers than to established customers.
I am already able to put a block in the email template to insert my own 'if' constructs based on order details.
I can get the customer data from the order id, e.g. the customer id, but how can I determine if they are a new customer?
Even if it is getting the customer creation date and checking if it is less than five minutes, I need a technique to determine if they are new from within my template code based on the order information.
Either way your going to just have to do calculations on created_at field in the customer_entity table. If not your going to have to find some specific window to consider customers as "new".
Don't think I'd put said logic in the template file but rather a model and just pass it a block to flag it or not.

Resources