Odoo: ask delete reason on unlink method? - odoo-9

How I ask reason on unlink method. I tried to call wizard method. But it's not working because it has validation/from python code/.
How can I ask delete reason?

you can override unlink method to only fire-up a wizard asking for the reason, and only when the user sets the reason you make the actual unlinking.

Related

Create Migration using command

guys.
I tried creating a migration, model and controller using the php artisan commands and it was all created, but with wrong permissions: if I want to modify something and then save it in these new files, I need to save using sudo, which is a waste of time. I'd like to know if there's a way to change those permissions when creating the files. The docker is already outside sudo.
Thanks a lot.
Run php artisan command with the user you will use to access this files later or change the permissions for the files after you create them.

Using "check" package causes another package to error

I'm using the Check package to validate parameters passed to Meteor methods. And I'm using Audit argument checks to enforce this.
However, I've added another package, Meteor Tags and when I try to use methods from the Tags package, I get a server error "Exception while invoking method '/patterns/addTag' Error: Did not check() all arguments during call to '/patterns/addTag'".
I think I understand why this error happens - the method in the Tags package doesn't check its inputs, so Audit Argument Checks generates an error. But I can't find any way around this, apart from 1) don't enforce checking, or 2) hack the Tags package methods so they use check. Neither of these seems like a great option - checking server parameters is a good idea, and hacking a package is not very maintainable.
Does anybody know if there is any smart way to use 'Audit argument checks' with packages that provide new server methods? I have looked at the Check documents, and searched online, but I haven't found an answer.
I hope this question makes sense.
Using audit-argument-checks is like saying: "I want to be serious about the security of the methods in my app." It's global to all methods in your app's codebase, including the methods from your installed packages.
There is no way to specify which parts of the app get checked, as that would be the equivalent of saying: "I want to be serious about the security of the methods I've written, but I don't care about the security holes created by some pacakges" (which doesn't make a lot of sense).
Note to package authors
Check your method arguments. It's not hard, and it prevents this situation from happening. Frankly, a package without this basic security really shouldn't be installed in the first place.
What you should do
Unless you have a throwaway app, I wouldn't recommend removing audit-argument-checks. Instead I'd do the following (assuming the package really has something of value):
Open an issue on github and let the maintainer know what's up.
Fork the code, and add the required checks. Keep this version as a local package.
Submit a pull request for the changes.
If all goes well, your PR will be accepted and everyone can benefit from the change. In the worst case, you'll still have a local copy that you can use in your app.

Why does a "on a non-object" error occurs with this extension in Magento?

I'm having an Issue with a blog extension in Magento CE 1.6.2.0.
I installed this extension: Neotheme_nBlog.
I created an entry in the administrator.
Then I went to http://www.example.com/index.php/blog/ to see the recently created entry.
What I saw was an error like this:
Fatal error: Call to a member function getName() on a non-object
in /home/example.com/public_html/app/design/frontend/default/caramel/template/magicat/left.phtml
I searched in google the terms: "template/magicat/left.phtml" getName and what I only found is sites having this issue, but no support at all.
Please note: I know what does that error mean in PHP ("unfortunately" I'm not new at that). What I don't understand is what's happening with such [NON/null] object and how to fix it without killing a dozen of kittens.
Question: What can I do to solve it? What is the nature of the error, regarding Magento?(again: not PHP).
Notes: The Magento site (http://magento.stackexchange.com) is somewhat poor and strict to bring support of such nature, so asking there is not an option.
Edit (as answer to comment, and to clarify):
Neotheme is still not responding the request.
Don't know what should I look on such file (instances are not initialized there, but only accessed).
I'm using the default theme (caramel), which has esthetical changes (does not have layout changes).
It's hard to say without seeing your system specifically, but on this
template/magicat/left.phtml
It looks like you've added a template named magicat/left.phtml to your system -- either via an extension or custom development. Somewhere in this file PHP's called getName on a non-object. There's a variety of reasons this could be happening, and without seeing the specific line of code PHP's complaining about in your system, it's hard to say. It'd also be helpful to know if magicat is part of the extension or something else.
The most common reason for this error in a template is code that relies on a block being there that's been removed by another extension (eitehr via layout XML or observer methods)
$this->getLayout()->getBlock('some_block')->getName();
The next most common is people using the registry to communicate between templates and views, but a registry key not being set
Mage::registry('some_item')->getName();
Without knowing the variable and context, it's doubtful anyone will be able to help you.

Is it possible to check if an application helper is already set to run at login?

Due to application sandboxing I'm using a helper app to launch my app at login.
I've figured out how to set my helper to start at login. The problem I'm trying to solve now is determining whether or not the helper is ALREADY set to start at login. I don't see anything in the API for that. Any ideas?
The same API you use to add yourself to the Login Items list, LSSharedFileList, is the one you use to see whether you're already in it. Copy a snapshot of the list and look through it.

Save file in magento after checkout completation

I need to save a file after a succesfully checkout. So I'm using the checkout_type_onepage_save_order_after event. When checking out, it stucks if I have some shitty code in there but it goes nicely if I have valid code in the observer. So it gets called, at least I think it does. Can't test it since it doesn't write my file, doesnt write anything in the log etc. So, what could be wrong? Why doesn't it write some stuff into the log? As I said, with other events it works perfectly. It's a new magento installation.
http://pastebin.com/TWyj6CYt cache is disabled. I'm using 1.5
I suggest you use the following event : sales_model_service_quote_submit_after
This event triggers right after the successful creation of an order.
You can also use Mage::log("Observer called"); just to check if your event observer is being invoked.
I hope this helps you :)
You have a class name Xxx_saveCheckout_Model_Observer. Class name parts usually all have uppercase initial letters, the autoloader expects that. Try changing it to Xxx_SaveCheckout_Model_Observer (with a capital 'S').
Also make sure the config file has a /config/global/models section, although it might be missing from your pastebin on purpose.

Resources