This question has been flagged
2909 Views

I wanted to know if anyone can help me in building a module. I want to make a small module that adds The following features:

If the stock of a product "X" = 0, the box product "can be sold" is disabled (False). "Can be sold" is a box that is inside of "product".

If the stock of a product "X" = 0, the box for "published" (new feature of the ecommerce module) is disabled (False)

And on the other hand only allows me to sell the amount of products you have in stock. Example: product "X" can be sold from 1 to the number of stocks you have.

So far I have the following:

__openerp__.py:

-- encoding: utf-8 --

{ "name": "Ventas con stock cuantificado", "version": "1.0", "description": """ Añade reglas la venta para que se venda únicamente lo que haya en stock. Cuando el stock es 0 desactiva el producto para la venta """, "author": "", "website": "", "category": "extra-tools", "depends": [ "sales", "stock", "website", "ecommerce", ], "active": False, "installable": True, "certificate" : "", }

__init__.py:

-- coding: utf-8 --

import product_sale_quantify

product_sale_quantify.py: it's empty

I was looking at how to build a module in python but still do not understand how you could do to build rules.

Thanks!

Avatar
Discard