- 浏览: 668638 次
- 性别:
- 来自: 中山
文章分类
最新评论
-
wuhuizhong:
jFinal支持Rest风格吗?可以想spring mvc那样 ...
在JFinal的Controller中接收json数据 -
wuhuizhong:
在jfinal中应如何获取前端ajax提交的Json数据?ht ...
在JFinal的Controller中接收json数据 -
wuhuizhong:
jfinal如何处理json请求的数据:问题: 在某些api接 ...
在JFinal的Controller中接收json数据 -
wuhuizhong:
Ubuntu14.04 安装 Oracle 11g R2 Ex ...
Oracle 11g release 2 XE on Ubuntu 14.04 -
alanljj:
这个很实用,已成功更新,谢过了!
odoo薪酬管理模块l10n_cn_hr_payroll
设置:
1.Gemfile
gem 'erp_agreements', :path => '../compass_agile_enterprise/erp_agreements'
gem 'erp_txns_and_accts', :path => '../compass_agile_enterprise/erp_txns_and_accts'
gem 'erp_commerce', :path => '../compass_agile_enterprise/erp_commerce'
gem 'erp_products', :path => '../compass_agile_enterprise/erp_products'
gem 'erp_orders', :path => '../compass_agile_enterprise/erp_orders'
gem 'erp_inventory', :path => '../compass_agile_enterprise/erp_inventory'
2.routes.rb
mount ErpProducts::Engine => '/erp_products'
3.RailsDBAdmin
Tables: applications => Production Manager
运行:
1.ActionController::RoutingError (No route matches [POST] "/erp_products/erp_app/desktop/product_manager/new"):
处理:routes.rb需设置
mount ErpProducts::Engine => '/erp_products'
2.NameError (uninitialized constant ErpProducts::ErpApp::Desktop::ProductManager::BaseController::InventoryEntry):
处理:Gemfile需设置
gem 'erp_inventory', :path => '../compass_agile_enterprise/erp_inventory'
3.NoMethodError (undefined method `number_available' for nil:NilClass):
处理:inventory_entries 和 product_type 必须有一对一的数据。
4.NoMethodError (undefined method `url' for #<Image:0xb793ac8>):
处理:无ProductType.all.collect.images.first.url (table:file_assets无url栏位)
/compass_agile_enterprise/erp_products/app/controllers/erp_products/erp_app/desktop/product_manager/base_controller.rb
def index products = ProductType.all.collect do |product_type| { :id => product_type.id, :title => product_type.description, :imageUrl => product_type.images.empty? ? '/images/img_blank.png' : product_type.images.first.directory+'/'+product_type.images.first.data_file_name, :price => product_type.get_current_simple_amount_with_currency.nil? ? 'no price set' : product_type.get_current_simple_amount_with_currency, :available => product_type.inventory_entries.first.number_available, :sold => product_type.inventory_entries.first.number_sold, :sku => product_type.inventory_entries.first.sku.nil? ? '' : product_type.inventory_entries.first.sku } end render :json => {:products => products} end def images data = {:images => []} product_type = ProductType.find(params[:id]) product_type.images.each do |image| data[:images] << {:id => image.id, :name => image.name, :shortName => image.name, :url => image.directory+'/'+image.data_file_name}#image.url} end render :json => data end
Database 為 Oracle 時遇到的問題處理方法:
1.Index name 'contact_purposes_contacts_index' on table 'contact_purposes_contacts' is too long; the limit is 30 characters
原因: 索引名稱太長.
修改: 20080805000020_base_erp_services.rb
改前: add_index :contact_purposes_contacts, [:contact_id, :contact_purpose_id], :name => "contact_purposes_contacts_index"
改後: add_index :contact_purposes_contacts, [:contact_id, :contact_purpose_id], :name => "contact_purposes_index"
2.identifier is too long: CREATE TABLE "CURRENCIES" ("ID" NUMBER(38) NOT NULL PRIMARY KEY, "NAME" VARCHAR2(255), "DEFINITION" VARCHAR2(255), "INTERNAL_IDENTIFIER" VARCHAR2(255), "NUMERIC_CODE" VARCHAR2(255), "MAJOR_UNIT_SYMBOL" VARCHAR2(255), "MINOR_UNIT_SYMBOL" VARCHAR2(255), "RATIO_OF_MINOR_UNIT_TO_MAJOR_UNIT" VARCHAR2(255), "POSTFIX_LABEL" VARCHAR2(255), "INTRODUCTION_DATE" DATE, "EXPIRATION_DATE" DATE, "CREATED_AT" DATE, "UPDATED_AT" DATE)
原因: 資料表欄位:ratio_of_minor_unit_to_major_unit 太長
修改: 20080805000020_base_erp_services.rb
改前: t.string :ratio_of_minor_unit_to_major_unit
改後: t.string :ratio_of_minor_unit
3.OCIError: ORA-02327: cannot create index on expression with datatype LOB: CREATE INDEX "INDEX_NOTES_ON_CONTENT" ON "NOTES" ("CONTENT")
原因: LOB類型欄位不能建索引.
修改: 20080805000020_base_erp_services.rb
取消: add_index :notes, :content
4.OCIError: ORA-00972: identifier is too long: CREATE TABLE "PREFERENCE_OPTIONS_PREFERENCE_TYPES" ("PREFERENCE_TYPE_ID" NUMBER(38), "PREFERENCE_OPTION_ID" NUMBER(38), "CREATED_AT" DATE, "UPDATED_AT" DATE)
原因: 資料表名稱太長
修改: 20080805000096_base_app_framework.rb
改前:
unless table_exists?(:preference_options_preference_types) create_table :preference_options_preference_types, {:id => false} do |t| t.references :preference_type t.references :preference_option t.timestamps end add_index :preference_options_preference_types, :preference_type_id, :name => 'pref_opt_pref_type_pref_type_id_idx' add_index :preference_options_preference_types, :preference_option_id, :name => 'pref_opt_pref_type_pref_opt_id_idx' end
改後:
unless table_exists?(:preference_options_types) create_table :preference_options_types, {:id => false} do |t| t.references :preference_type t.references :preference_option t.timestamps end add_index :preference_options_types, :preference_type_id, :name => 'pref_opt_pref_type_id_idx' add_index :preference_options_types, :preference_option_id, :name => 'pref_opt_pref_opt_id_idx' end
5.OCIError: ORA-00972: identifier is too long: INSERT INTO "PREFERENCE_OPTIONS_PREFERENCE_TYPES" ("PREFERENCE_TYPE_ID", "PREFERENCE_OPTION_ID") VALUES (10002, 10000)
參考: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_and_belongs_to_many
原因: 需指定中間表名稱.
修改: Application-Stack---Suite\erp_app\app\models\preference_option.rb
has_and_belongs_to_many :preference_type, :join_table => 'preference_options_types'
修改: Application-Stack---Suite\erp_app\app\models\preference_type.rb
has_and_belongs_to_many :preference_options, :join_table => 'preference_options_types'
发表评论
-
使用Torquebox在Windows下面进行Rails的部署
2013-12-16 07:16 1032一、安装Torquebox 参考:http://torqu ... -
ruby匹配中文的正则表达
2013-07-16 21:12 1858ruby1.9: /\p{Word}+/u 不限于 a ... -
Ruby On Rails, Thin and Nginx on Windows
2012-01-08 07:23 1790安装thin: gem install eventmachi ... -
搭建rubygem repository server
2011-11-14 13:06 980做rails开发通常需要gem i ... -
在 Heroku 安裝 Redmine (1.1-stable)
2011-11-13 09:59 1030Redmine 是一套好用的軟 ... -
Rails之记录用户操作数据库信息
2011-11-10 02:50 1140db/migrate/002_add_audit_trails ... -
Rails3部署到heroku
2011-11-10 02:47 673gem install heroku rails new m ... -
Rails Cache
2011-11-10 02:20 658Rails Cache http://www.slid ... -
How do I use ActiveSupport core extensions?
2011-11-07 17:04 450When I try to use 1.week.ago ... -
Redhat安裝 nokogiri 時要求升級 libxml2
2011-11-07 16:58 2207安裝 nokogiri 時出現以下錯誤信息: Install ... -
Linux下Rails 3.1安装sqlite3
2011-10-25 08:29 1107服务器系统是Red Hat 4.1.2-48。默认已安装sql ... -
Ubuntu Server 64bits 如何安装 ruby-oci8
2011-10-23 06:56 2982安装 Linux软件包 : sudo apt- ... -
将gem包打成jar包
2011-10-16 11:45 783http://www.intellij.org.cn/blog ... -
升級到 Rails 3.1,專案所要做的前置準備工作
2011-10-14 14:28 609http://wp.xdite.net/?p=3137 ... -
Ruby 调用Shell脚本
2011-10-13 15:13 2855// 第一种 用反引号将shell命令引起来,如果是sh ... -
Ruby通过SOAP调用webservice发送短信
2011-10-06 11:27 1569url = 'http://lxt.esms360.co ... -
Sending delayed email from devise
2011-09-27 14:39 612Alternatively, instead of using ... -
让邮件发送也变得有序
2011-09-27 14:10 540邮件发送应该是一个网站中不可或缺的功能,但如果同时触发了大量的 ... -
rails 3 中 生成pdf 2: email pdf 附件
2011-09-27 13:31 950ActionMailer in Rails 3 http:/ ... -
rails 3 中 生成pdf
2011-09-27 13:28 1868基于 wkhtmltopdf (http://code.goo ...
相关推荐
compass_使用详解.pdf compass_教程 compass_试用案例。
compass教程.pdf
compass整合ssh的例子,由于上传的文件大小的限制有几个struts2.18的jar包需要自己添加进去
Compass_入门指南 Compass_入门文档
compass文档资料
compass annotation关联关系
Compass概念: 1:Compass相当于hb的SessionFactory 2:CompassSession相当于hb的Session 3:CompassTransaction相当于hb的transaction。 <br>Compass也是采用CompassConfiguration(装载配置和映射文件...
COMPASS介绍COMPASS介绍COMPASS介绍COMPASS介绍COMPASS介绍
mongodb安装包和compass mongodb安装包和compass mongodb安装包和compass 可在node学习过程中使用
Compass原理深入学习笔记,对于compass知识的一个梳理,希望对大家有用
Sass和Compass 实战
这个项目是我经过修改的源代码,含有需要的jar和sql
Chapter 1, Getting Started with Sass and Compass, explains, in layman's terms, what Sass and Compass are, how they relate, and how to get them installed and ready to use. Chapter 2, Setting Up a Sass ...
compass-reference,compass
compass搜索引擎技术 eclipse mysql 实现像google的搜索功能
compass 最新的compass,值得下载
mongodb-compass-1.17.0-win32-x64 MongoDB可视化工具Compass
最新mangodb compass
Compass是第一个实现java搜索引擎的开源框架,它是基于Lucene之上的,提供更简单的搜索引擎API,事务支持,对象到搜索引擎映射(Annotations
Compass需要的包3:compass-core.jar