Skip to main content

Define in the sale subscription if the invoice must be posted or validated

Project description

Install

Dependencies for ArchLinux

sudo pacman -S cairo pkgconf gobject-introspection

Dependencies for debian

sudo apt-get install libcairo2-dev libgirepository1.0-dev

Install the package

# installs python deps
pip install hb_tryton_sale_subscription_automatic_post
# install the module
trytond-admin -u sale_subscription_automatic_post --activate-dependencies

Install the db by hb-tryton-devtools

pip install git+https://gitlab.com/hashbangfr/tryton-modules/hb_tryton_devtools.git#egg=hb_tryton_devtools
export TRYTON_DATABASE_URI=postgresql:///
export TRYTON_DATABASE_NAME=test
hb-tryton-admin create-db --modules sale_subscription_automatic_post

Test package

The package need pytest and hb-tryton-devtools

pip install pytest pytest-cov
pip install git+ssh://git@gitlab.com/hashbangfr/tryton-modules/hb_tryton_devtools.git#egg=hb_tryton_devtools

Run the test with pytest with environ variable

export TRYTON_DATABASE_URI=postgresql:///
export TRYTON_DATABASE_NAME=test
pytest sale_subscription_automatic_post/tests

Design

This module adds new fields to the Subscription Model and the Sale Configuration model.

The field “Invoice State” of the Subscription Model allows to set, for each instance of Subscription, to set the state of the invoices that will be generated : draft, validated or posted.

The default value of this field is set by the field “Default Subscription invoice state” of the Sale Configuration model.

Usage

Setting the state of the invoices generated by a subscription

When creating a new subscription, select a state (draft, validated or posted) in the “Invoice State” field, set up all the subscription, quote and run. Then, when running the Consumption Creation wizard and the Invoice Creation wizard, all the invoices linked to this subscription will have the state of the “Invoice State” field of the subscription.

Setting the default value of the invoice state of a subscription

Open the Sale Configuration menu, and select a state (draft, validated or posted) in the “Default Subscription invoice state” field. Then, when creating a new Subscription, the default value of the “Invoice State” will be the value selected in the Sale Configuration. The value of “Invoice State” is still editable.

When the “Default Subscription invoice state” field is empty, the default value of “Invoice State” is draft.

CHANGELOG

1.0.0 (2022-05-17)

  • Added field on subcription to indicate if the invoice will be posted or not.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page