This is the documentation for older versions of Odoo (formerly OpenERP).

See the new Odoo user documentation.

See the new Odoo technical documentation.

Database setup

You'll create all the elements in the database that you need to carry out the use case. These are specified in the functional requirements.

配置会计科目

You need to start off with a minimal set of accounts, and to do that you will need a couple of account types. You can structure your accounts into a chart at any time (and, in fact, you can structure them into several additional charts at the same time as you'll see in the chapter 从 A 到 Z 配置科目), so you don't need to be concerned unduly about structure.

科目类型

Create account types using Financial Management ‣ Configuration ‣ Financial Accounting ‣ Financial Accounts ‣ Account Types and then clicking the New button. You'll need the following four types, the first of which is shown in figure 新会计科目类型.

Defining Account Types

科目类型

类型CODE

Sequence

Sign on Reports

递延法

Partner Account

视图

视图

5

Positive

未选中

收入

收入

5

Positive

未对帐

未选中

支出

支出

5

Positive

未对帐

未选中

现金

现金

5

Positive

结余

未选中

/doc_static/5.0/_images/openerp_ch03_acctype.png

新会计科目类型

科目

Create accounts using Financial Management ‣ Configuration ‣ Financial Accounting ‣ Financial Accounts ‣ List of Accounts and then clicking the New button.

You need accounts to handle the purchase and sales orders that haven't yet been paid, two more for the receipt and shipping of goods, and one for the payment and receipt of funds. And one 'organizing' account that's just a view of the other five. So you'll need the following six accounts, one of which is shown in 新帐户.

Defining Accounts

名称

类型CODE

内部类型

上级科目

帐户类型

对账

最小的图

0

视图

 

视图

未选中

应付

无线AP

应付

最小的图 0

支出

已检查

应收

AR

应收

最小的图 0

收入

已检查

现金

C

其他

最小的图 0

现金

未选中

采购

P

其他

最小的图 0

支出

未选中

销售

S

其他

最小的图 0

收入

未选中

/doc_static/5.0/_images/openerp_ch03_accts.png

新帐户

The Account Type entry is taken from the list of types that you just created. Although it looks a bit like a text box, it doesn't behave in quite the same way. A single Del or Backspace keystroke is all you need to delete the whole text, and when you type the name (or part of the name) you still need to associate that text with the entry by clicking the Search icon to the right of the field.

属性

You now define some default properties so that you don't have to think about which account is used for which transaction every time you do something. The main new properties are the four that associate accounts payable and receivable to partners, and expenses and income to product categories.

Create properties using Administration ‣ Configuration ‣ Properties ‣ Default Properties and then clicking the New button.

Defining Properties

名称

按 所选公司 产生默认

Fields

默认值

Parent Resource

property_account_payable

Tiny sprl

应付账户

(account.account) AP应付

(None)

property_account_receivable

Tiny sprl

应收账户

(account.account) AR应收

(None)

property_account_expense_categ

Tiny sprl

费用账户

(account.account) P购买

(None)

property_account_income_categ

Tiny sprl

收入账户

(account.account) S 卖

(None)

小技巧

账号性质配置错误

It's easy to make mistakes in configuring the accounts and their properties, but the consequences are not immediately obvious. You'll mostly discover mistakes when trying to make a Purchase or Sale Order (see later, for example, 采购), where the accounts are required fields or, if you're diligent, when you set up Partners.

If you configure them correctly at this stage then fields will be completed automatically and you'll never know a thing. If you don't configure all this correctly then you won't be able to save the order form until you have corrected the problem or until you manually set the accounts.

Since this configuration is quite tedious you'd be best finding a certified Chart of Accounts that that has already been set up to meet your needs, if you can find one.

配置账簿

You'll also need to configure some journals, which are used to record the transactions from one account to another when invoices are raised and then paid. Create journals from the menu Financial Management ‣ Configuration ‣ Financial Accounting ‣ Financial Journals and then clicking the New button.

Defining Journals

日记账名称

类型CODE

类型

视图

对象实体序列

默认借方科目

默认贷方科目

采购日记账

PUJ

采购

Journal View

采购日记账

P购买

P购买

销售日记账

SAJ

销售

Journal View

销售日记账

S 卖出

S 卖出

银行日记账

BNK

现金

Cash Journal View

账户日记

C 现金

C 现金

小技巧

配置错误日志

It's easy to make mistakes in configuring the journals, too, and the consequences are also not immediately obvious. You'll mostly discover mistakes when creating an invoice (which happens at different points in the process depending on your configuration). In this example, validating a Purchase Order creates a draft invoice (see later, again for example, 采购), where a journal is required.

As with accounts and properties, if you configure them correctly at this stage then the fields will be completed automatically and you'll never know a thing. If you don't configure all this correctly then there will be errors with the order form or corresponding draft invoice until you have corrected the problem or until you manually set the journal.

配置公司信息

Start to configure your database by renaming the Main Company from its default of Tiny sprl to the name of your own company or (in this case) another example company. When you print standard documents such as quotations, orders and invoices you'll find this configuration information used in the document headers and footers.

To do this, click Partners ‣ Partners and click the name of the only company there, which is Tiny sprl . This gives you a read-only view form view of the company, so make it editable by clicking the Edit button to the upper left of the form.

小技巧

Editable form in the web client

When toggling from the list view to the form view of an item, you can generally click its name in the list view to show a non-editable view or the pencil icon by the left-hand edge of the line to open it in an editable view. You can toggle between editable and non-editable once you're in form view.

按下面的数据输入:

  • 名称 : Ambitious Plumbing Enterprises雄心水暖公司(就一公司名称)

  • Contact Name : George Turnbull .

Before you save this, look at the partner's accounting setup by clicking the fifth tab Accounting. The fields Account Receivable and Account Payable have account values in them that were taken from the account properties you just created. You don't have to accept those values: you can enter any suitable account you like at this stage, although OpenERP constrains the selection to ones that make accounting sense.

Back at the first tab, General change any other fields you like, such as the address and phone numbers, then Save. This changes one Contact for the Partner, which is sufficient for the example.

From the MAIN MENU, click Administration ‣ Users ‣ Company Structure ‣ Companies and edit the only entry there:

  • 公司名称 : AmbiPlum ,

  • Partner : 已显示为 Ambitious Plumbing Enterprises雄心水暖公司(就一公司名称) ,

  • Report Header : Ambitious Plumbing ,

  • Report Footer 1 : Best Plumbing Services, Great Prices ,

  • Report Footer 2 : Ambitious our Registered Company Details .

Figure 修改公司详情 shows the effect of this. You can also change various other company-wide parameters for reports and scheduling in the other tabs, and you can upload a company logo of a specific size for the reports. Click Save to store this.

/doc_static/5.0/_images/openerp_ch03_co.png

修改公司详情

You can leave the currency at its default setting of EUR for this example. Or you can change it in this Company and the two default Pricelists (Products ‣ Pricelists ‣ Pricelists) if you feel compelled to do that.

注解

货币

The examples in this book are in USD and EUR. You, the reader, could use your home currency (perhaps CAD, CNY, GBP, or IDR) in their place.

Creating partner categories, partners and their contacts

You'll now create a suppliers category and a customers category. Partner categories are useful for organizing groups of partners but have no special behavior that affects partners, so you can assign them as you like. Then you'll define one supplier and one customer, with a contact for each.

To do this use the menu Partners ‣ Configuration ‣ Partner Categories and click New to open a new form for defining Partner Categories. Define the two categories that follow by just entering their Category Name and saving them:

  • 供应商(Suppliers) ,

  • 客户(Customers) .

Then create two partners from the menu Partners ‣ Partners. Click on the New button to open a blank form and then add the following data for the first partner first:

  • 名称 : Plumbing Component Suppliers ,

  • Customer checkbox : unchecked ,

  • Supplier checkbox : checked ,

  • Contact Name : Jean Poolley ,

  • Address Type : Default ,

  • add Suppliers to the Categories field by selecting it from the Search List,

  • 然后点击 保存(Save) 按钮保存业务伙伴。

新业务伙伴表单 显示了操作的结果。

/doc_static/5.0/_images/openerp_03_part.png

新业务伙伴表单

注解

Contact Types

If you've recorded several contacts for the same partner you can specify which contact is used for various documents by specifying the Address Type.

For example the delivery address can differ from the invoice address for a partner. If the Address Types are correctly assigned, then Open ERP can automatically select the appropriate address during the creation of the document – an invoice is addressed to the contact that's been assigned the Address Type of Invoice, otherwise to the Default address.

录入第二个合作伙伴的数据时,同录入第一个一样,参考下面的数据录入:

  • 姓名(Name) : Smith and Offspring,

  • Customer checkbox : checked,

  • Supplier checkbox : unchecked,

  • Contact Name : Stephen Smith,

  • Address Type : Default.

Then add Customers in the Categories field. Save the form. To check your work you can go to the menu Partners ‣ Partners ‣ Partners by Categories and click on each category in turn to see the companies in the category.

注解

多业务伙伴分类

If this partner was also a supplier then you'd add Suppliers to the categories as well, but there's no need to do so in this example. You can assign a partner to multiple categories at all levels of the hierarchy.

Creating products and their categories

Unlike partner categories and their assigned partners, product categories do have an effect on the products assigned to them – and a product may belong to only one category. Select the menu Products ‣ Configuration ‣ Product Categories and click New to get an empty form for defining a product category.

Enter Radiators in the Name field. You'll see that other fields, specifically those in the Accounting Properties section, have been automatically filled in with values of accounts and journals. These are the values that will affect products – equivalent fields in a product will take on these values if they, too, are blank when their form is saved. Click Save.

注解

Properties fields

Properties have a rather unusual behavior. They're defined by parameters in the menus in Administration ‣ Configuration ‣ Properties, and they update fields only when a form is saved, and only when the fields are empty at the time the form is saved. You can manually override any of these properties as you need.

Properties fields are used all over the Open ERP system and particularly extensively in a multi- company environment. There, property fields in a partner form can be populated with different values depending on the user's company.

For example the payment conditions for a partner could differ depending on the company from which it's addressed.

注解

计量单位

UOM is an abbreviation for Unit of Measure. Open ERP manages multiple units of measure for each product: you can buy in tons and sell in kgs, for example. The conversion between each category is made automatically (so long as you have set up the conversion rate in the product form first).

小技巧

Managing double units of measure

The whole management of stock can be carried out with double units of measure (UOM and UOS – for Unit of Sale). For example an agro-food company can stock and sell ham by piece but buy and value it by weight. There's no direct relationship between these two units so a weighing operation has to be done.

这个功能是在农业食品行业至关重要,并且在制造业以及化学品和其他许多行业也是同样的重要。

Now create a new product:

  1. Go to the Products ‣ Products menu and click New.

  2. 新建一个产品类型:将 钛合金散热器 输入到 Name 栏位。

  3. Click the Search icon to the right of the Category field to select the Radiators category.

  4. The Product Type field should stay as Stockable Product its default value. The fields Procure Method, Supply Method, Default UOM, and Purchase UOM should also stay at their default values: in fact every other field in this tab remains untouched.

    /doc_static/5.0/_images/product.png

    Product Form

  5. Click on the Prices & Suppliers tab and enter 57.50 into the Cost Price field and 132.50 into the Sale Price field.

  6. Click the Accounting tab, then click Save and observe that Accounting Properties here remain empty. When product transactions occur, the Income and Expense accounts that you've just defined in the Product Category are used by the Product unless an account is specified here, directly in the product, to override that.

  7. Once the product is saved it changes to a non-editable state. If you had entered data incorrectly or left a required field blank, the form would have stayed editable and you'd need to click from tab to tab to find a field colored red, with an error message below it, that would have to be correctly filled in.

Stock locations

Click Stock Management ‣ Stock Locations Structure to see the hierarchy of stock locations. These locations have been defined by the minimal default data loaded when the database was created. You'll use this default structure in this example.

OpenERP有三个类型预定义的顶级库“物理库位”、“伙伴库位”和“虚拟库位”,其中前两种的用法顾名思义,另一个的设置是为了方便OpenERP使用。

  1. From the Main Menu click on Stock Management ‣ Configuration ‣ Locations to reach a list view of the locations (not the tree view).

  2. Click on the name of a location, such as Physical Locations/Tiny SPRL to open a descriptive form view. Each location has a Location type and a Parent Location that defines the hierarchical structure. An Inventory Account can also be assigned to a location. While you're here you should change the location's name to Ambitious Plumbing Enterprises , since it was named before you changed the company name.

  3. From the Main Menu click Stock Management ‣ Configuration ‣ Warehouses to view a list of warehouses. There's only the one at the moment, which should also be renamed from Tiny SPRL to Ambitious Plumbing Enterprises .

小技巧

Valuation of stock

If you want real-time stock valuation that tracks stock movements you must assign an account to each stock location. As product items are added to and taken from each location Open ERP generates an account entry for that location defined by the configuration of the product being moved – and a stock valuation based (in the current versions of Open ERP) on either Cost Price or Average Price.

For example, if you assign an account to the Supplier location you'll be able see the value of stock that you've taken from the supplier. Its contents can be valued in your accounts and it can manage inventory on consignment.

A Warehouse contains an input location, a stock location and an output location for sold products. You can associate a warehouse with a partner to give the warehouse an address. That doesn't have to be your own company (although it can be): you can easily specify another partner who may be holding stock on your behalf.

注解

库位结构

每个仓库由三个库位组成 Location Input, Location Output, 和 Location Stock. ,`。 Location Stock 存储库位'及其子库位就是您的有效库位。

So the Location Input can be placed as a child of the Location Stock, which means that when Location Stock is interrogated for product quantities, it also takes account of the contents of the Location Input. Location Input could be used as a goods-in QC location. The Location Output must never be placed as a child of Location Stock, since items in Location Output, which can be considered to be packed ready for customer shipment, should not be thought of as available for sale elsewhere.

In the default configuration, OpenERP uses the same Stock location for both Input and Output because it is easier to understand when you're starting out.

Setting up a chart of accounts

You can set up a chart of accounts during the creation of a database, but for this exercise you'll start with the minimal chart that you created (just a handful of required accounts without hierarchy, tax or subtotals).

A number of account charts have been predefined for Open ERP, some of which meet the needs of national authorities (the number of those created for Open ERP is growing as various contributors create and freely publish them). You can take one of those without changing it if it's suitable, or you can take anything as your starting point and design a complete chart of accounts to meet your exact needs, including accounts for inventory, asset depreciation, equity and taxation.

You can also run multiple charts of accounts in parallel – so you can put all of your transaction accounts into several charts, with different arrangements for taxation and depreciation, aggregated differently for various needs.

Before you can use any chart of accounts for anything you need to specify a Fiscal Year. This defines the different time periods available for accounting transactions. An initial Fiscal Year was created during the database setup so you don't need to do any more on this. You can also create Fiscal year manually from Financial Management ‣ Configuration ‣ Financial Accounting ‣ Periods ‣ Fiscal Years

Click Financial Management ‣ Charts ‣ Charts of Accounts and then click Open Charts to open a new Account charts form where you define exactly what you want to see. Click Open Charts to accept the defaults and see a hierarchical structure of the accounts.

Make a backup of the database

If you know the super-administrator password, make a backup of your database using the procedure described at the very end of 安装与初始配置. Then restore it to a new database: testing .

This operation enables you to test the new configuration on testing so that you can be sure everything works as designed. Then if the tests are successful you can make a new database from openerp_ch03 , perhaps called liveor production, for your real work.

打这儿起, 若您有 admin 权限那么即会连接上这个名为 testing 的数据库。 If you have to make corrections, do that on openerp_ch03 and copy it to a new testing database to continue checking it.

Or you can just continue working with the openerp_ch03 database to get through this chapter. You can recreate openerp_ch03 quite quickly if something goes wrong and you can't recover from it but, again, you'd need to know your super-administrator password for that.