Coder Social home page Coder Social logo

nereid-webshop's Introduction

nereid-webshop

https://travis-ci.org/openlabs/nereid-webshop.png?branch=develop https://coveralls.io/repos/openlabs/nereid-webshop/badge.png?branch=develop

Full Webshop based on Tryton Nereid

Installation

Setting this module up is similar to the setup of any other tryton module.

Step 1: Create a virtualenv

virtualenv webshop

You can now activate the virtualenv

cd webshop
source bin/activate

Step 2: Clone and Setup the module

git clone [email protected]:openlabs/nereid-webshop.git
cd nereid-webshop
python setup.py install

This command would install all the required dependencies for the module to function.

Step 3: Setup Database

The module should now be available on the modules list and can be installed into any database. Setup a website as shown below:

docs/source/_static/img//website.png

You will have to create a guest user for nereid. The guest user would be the user which would be available in the context when there are no users logged into the website.

Ensure that you have the following too:

  • A pricelist
  • A payment_term

Step 4: Create an application script

Create an application.py script which could lauch the application. A reference is provided in the web folder (application-example.py).

In most cases the only changes you may need are:

  • the DATABASE_NAME which should be the name of the database (from step 3).
  • the TRYTON_CONFIG which should be the location of the tryton config file.

You should now be able to run the development server by running the application using:

python application.py

On pointing the browser to localhost:5000 you should be able to see the home page.

docs/source/_static/img/homepage.png

Step 5: Production Deployment

TODO

Step 6: Customization

For base customization in webshop you have to inherit base.jinja as follow:

{% extends "webshop/base.jinja" %}

6.1: Favicon and logo

Set custom favicon by setting icon path in SHOP_FAVICON variable before extending webshop/base.jinja as follows:

{% set SHOP_FAVICON = "<path to custom favicon>" %}
{% extends "webshop/base.jinja" %}

nereid-webshop's People

Contributors

aroraumang avatar gauravbutola avatar gautampanday avatar gayledds avatar goyal1092 avatar mbehrle avatar pokoli avatar prakashpp avatar pritishc avatar raghav-kukreti avatar rajatguptarg avatar sharoonthomas avatar tarunbhardwaj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nereid-webshop's Issues

Error on importing translation file for es_ES

[Fri Jun 27 15:17:05 2014] INFO:modules:nereid_webshop:loading locale/es_ES.po
/home/mathiasb/.virtualenvs/nereid-webshop/local/lib/python2.7/site-packages/trytond-3.0.4-py2.7.egg/trytond/model/modelsql.py:360: DeprecationWarning: With-statements now directly support multiple context managers
Transaction().set_user(0)):
Traceback (most recent call last):
File "/home/mathiasb/.virtualenvs/nereid-webshop/bin/trytond", line 5, in
pkg_resources.run_script('trytond==3.0.4', 'trytond')
File "/home/mathiasb/.virtualenvs/nereid-webshop/local/lib/python2.7/site-packages/pkg_resources.py", line 534, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/home/mathiasb/.virtualenvs/nereid-webshop/local/lib/python2.7/site-packages/pkg_resources.py", line 1434, in run_script
execfile(script_filename, namespace, namespace)
File "/home/mathiasb/.virtualenvs/nereid-webshop/lib/python2.7/site-packages/trytond-3.0.4-py2.7.egg/EGG-INFO/scripts/trytond", line 111, in
trytond.server.TrytonServer(options).run()
File "/home/mathiasb/.virtualenvs/nereid-webshop/local/lib/python2.7/site-packages/trytond-3.0.4-py2.7.egg/trytond/server.py", line 124, in run
Pool(db_name).init(update=update, lang=lang)
File "/home/mathiasb/.virtualenvs/nereid-webshop/local/lib/python2.7/site-packages/trytond-3.0.4-py2.7.egg/trytond/pool.py", line 151, in init
lang=lang)
File "/home/mathiasb/.virtualenvs/nereid-webshop/local/lib/python2.7/site-packages/trytond-3.0.4-py2.7.egg/trytond/modules/init.py", line 399, in load_modules
load_module_graph(graph, pool, lang)
File "/home/mathiasb/.virtualenvs/nereid-webshop/local/lib/python2.7/site-packages/trytond-3.0.4-py2.7.egg/trytond/modules/init.py", line 262, in load_module_graph
Translation.translation_import(lang2, module, filename)
File "/home/mathiasb/.virtualenvs/nereid-webshop/lib/python2.7/site-packages/trytond/modules/nereid/translation.py", line 216, in translation_import
translations |= set(cls.create(to_create))
File "/home/mathiasb/.virtualenvs/nereid-webshop/lib/python2.7/site-packages/trytond/modules/nereid/translation.py", line 343, in create
return super(Translation, cls).create(vlist)
File "/home/mathiasb/.virtualenvs/nereid-webshop/local/lib/python2.7/site-packages/trytond-3.0.4-py2.7.egg/trytond/ir/translation.py", line 731, in create
return super(Translation, cls).create(vlist)
File "/home/mathiasb/.virtualenvs/nereid-webshop/local/lib/python2.7/site-packages/trytond-3.0.4-py2.7.egg/trytond/model/modelsql.py", line 361, in create
cls.__raise_integrity_error(exception, values)
File "/home/mathiasb/.virtualenvs/nereid-webshop/local/lib/python2.7/site-packages/trytond-3.0.4-py2.7.egg/trytond/model/modelsql.py", line 225, in __raise_integrity_error
cls.raise_user_error(error)
File "/home/mathiasb/.virtualenvs/nereid-webshop/local/lib/python2.7/site-packages/trytond-3.0.4-py2.7.egg/trytond/error.py", line 74, in raise_user_error
raise UserError(error)
trytond.exceptions.UserError: ('UserError', ('Translation must be unique', ''))

Test that translations can be loaded

Add a unittest that ensures that translations are installed correctly.

My guess is this could be as simple as writing a new test where you first install the base modules (ir, res) and then make the languages supported by the webshop translatable. Then installing nereid webshop should raise the exception or error if there are issues in translations.

The original issue can be seen on #251

UnicodeDecodeError: 'utf8' codec can't decode byte 0x9e in position 16: invalid start byte

Administration/Localization/Set translations:

Traceback (most recent call last):
File "/trytond/protocols/jsonrpc.py", line 123, in _marshaled_dispatch
response['result'] = dispatch_method(method, params)
File "/trytond/protocols/jsonrpc.py", line 156, in _dispatch
res = dispatch(_args)
File "/trytond/protocols/dispatcher.py", line 169, in dispatch
result = rpc.result(meth(_c_args, **c_kwargs))
File "/trytond/wizard/wizard.py", line 218, in execute
return wizard._execute(state_name)
File "/trytond/wizard/wizard.py", line 249, in _execute
result = self.execute(transition())
File "/site-packages/trytond_nereid-3.0.9.0dev-py2.7.egg/trytond/modules/nereid/translation.py", line 356, in transition_set

self.set_nereid_template()
File "/site-packages/trytond_nereid-3.0.9.0dev-py2.7.egg/trytond/modules/nereid/translation.py", line 458, in set_nereid_template
self._get_nereid_template_messages():
File "/site-packages/trytond_nereid-3.0.9.0dev-py2.7.egg/trytond/modules/nereid/translation.py", line 442, in _get_nereid_template_messages
file_obj = open(loader.get_source({}, template)[1])
File "/jinja2/loaders.py", line 167, in get_source
contents = f.read().decode(self.encoding)
File "/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9e in position 16: invalid start byte

Question wrt. to test app and 8b0ce274d625a11016e631b16b993ab0a2dcde49

Looking at commit 8b0ce27 this one contains:

in the template:

{% for invoice in sale.invoices %}
{% if invoice.state == "paid" %}

and in the test:

            with Transaction().set_context(company=self.company.id):

                self.Sale.process([sale])
                self.Account.post(sale.invoices)
            with app.test_client() as c:
                # Loged in user tries to download invoice
                self.login(c, '[email protected]', 'password')
                response = c.get(
                    '/orders/invoice/%s/download' % (sale.invoices[0].id, )
                )
                self.assertEqual(response.status_code, 200)

So the invoice(s) are in state posted, and according to my reading there shouldn't be any invoice available for download, when only paid invoices are shown. Nevertheless the travis build passes.

Did I miss something or is there a glitch in the test app?

What is the reason to permit to download only paid invoices?

Cheers,
Mathias

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.