Skip to content

Commit ef01aad

Browse files
committed
Merge commit '4abfc9e161dc4de0c6324ebdba703102a42145c8'
* commit '4abfc9e161dc4de0c6324ebdba703102a42145c8': (447 commits) 退货不能获取采购成本 [IMP]增加限制:应收期初和应付期初不能同时存在 [FIX]解决客户和供应商双重身份的期初问题等 升级反核销资金单逻辑 [ADD] 打印圆通快递面单换成三联单 [FIX]bug:月末结账时报公司利润科目未配置 [FIX]关于批次号的收货的bug osbzr#1887:入库单生成退货单时不该传入lot_id [FIX]业务伙伴对账单应收/应付余额涉及到折扣时计算的bug [FIX]漏提交了视图文件 [ADD]销货订单上增加净重合计及添加测试 提示字段不对应 [FIX]修复作废时只能移除第一个审批组的bug,作废时应全部移除待审批人 客户列表增加业务员字段 [FIX]修复作废时的bug [FIX]1.审批向导进去所有单据跳过审批的bug,2.不需审批单据自动移除待审批人,3.作废单据时做判断 Update sell_view.xml [FIX]关于作废单据审批问题 osbzr#1867 完善销售单开单的业务员 [FIX]修复bug:付款单设置了审批流程但入库单审核生成的付款单审批流程没加上; add test Update sell_view.xml ...
2 parents b0ed900 + 4abfc9e commit ef01aad

File tree

333 files changed

+51828
-2685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+51828
-2685
lines changed

.travis.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1+
language: python
2+
sudo: false
3+
cache:
4+
apt: true
5+
directories:
6+
- $HOME/.cache/pip
7+
8+
python:
9+
- "2.7.13"
10+
111
addons:
12+
postgresql: "9.5"
213
apt:
314
packages:
415
- expect-dev # provides unbuffer utility
5-
- python-lxml # because pip installation is slow
6-
7-
language: python
8-
9-
python:
10-
- "2.7"
1116

1217
env:
13-
- VERSION="10.0" ODOO_REPO="osbzr/base" LINT_CHECK="0"
14-
15-
16-
virtualenv:
17-
system_site_packages: true
18+
global:
19+
- VERSION="10.0" ODOO_REPO="osbzr/base" LINT_CHECK="0" PGPASSWORD="travis"
20+
- PHANTOMJS_VERSION="latest"
1821

1922
install:
2023
- git clone http://github.com/GoodERPJeff/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
@@ -32,4 +35,4 @@ script:
3235
- travis_run_tests
3336

3437
after_success:
35-
coveralls
38+
- travis_after_tests_success

access_control_goods/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# -*- coding: utf-8 -*-

access_control_goods/__openerp__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
{
3+
'name': "GoodERP Access Control Goods 模块",
4+
'author': "开阖软件",
5+
'website': "http://www.osbzr.com",
6+
'category': 'gooderp',
7+
'summary': 'GoodERP 商品 读写建删权限控制',
8+
"description":
9+
'''
10+
该模块添加了 创建商品组,该组成员可以对商品进行增删改查,普通用户只能查看。
11+
''',
12+
'version': '11.11',
13+
'application': True,
14+
'depends': ['core'],
15+
'data': [
16+
'security/groups.xml',
17+
'security/ir.model.access.csv',
18+
],
19+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<openerp>
3+
<data noupdate="1">
4+
<!--添加创建创建商品组-->
5+
<record id="group_operate_goods_main_data" model="res.groups">
6+
<field name='name'>创建商品</field>
7+
<field name='category_id' ref="core.Gooderp"/>
8+
<field name="users" eval="[(4, ref('base.user_root'))]"/>
9+
</record>
10+
</data>
11+
</openerp>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2+
core.access_goods,access_goods_user,core.model_goods,base.group_user,1,0,0,0
3+
access_goods_operator,access_goods_operator,core.model_goods,access_control_goods.group_operate_goods_main_data,1,1,1,1

account_cost/models/cost_order.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
from datetime import datetime
2626
from odoo.tools import float_compare, float_is_zero
2727

28-
# 购货订单审核状态可选值
28+
# 购货订单确认状态可选值
2929
COST_ORDER_STATES = [
30-
('draft', u'未审核'),
31-
('done', u'已审核'),
30+
('draft', u'草稿'),
31+
('done', u'已确认'),
3232
('cancel', u'已中止'),
3333
('cancel', u'已作废')]
3434

@@ -65,7 +65,7 @@ def _compute_amount(self):
6565
note = fields.Text(u'备注', help=u'单据备注')
6666
prepayment = fields.Float(u'预付款', states=READONLY_STATES,
6767
digits=dp.get_precision('Amount'),
68-
help=u'输入预付款审核购货订单,会产生一张付款单')
68+
help=u'输入预付款确认购货订单,会产生一张付款单')
6969
bank_account_id = fields.Many2one('bank.account', u'结算账户',
7070
ondelete='restrict',
7171
help=u'用来核算和监督企业与其他单位或个人之间的债权债务的结算情况')
@@ -84,11 +84,11 @@ def _compute_amount(self):
8484
'cost_ids',
8585
'move_ids',
8686
u'费用分摊出入库明细', copy=False)
87-
approve_uid = fields.Many2one('res.users', u'审核人',
87+
approve_uid = fields.Many2one('res.users', u'确认人',
8888
copy=False, ondelete='restrict',
89-
help=u'审核单据的人')
90-
state = fields.Selection(COST_ORDER_STATES, u'审核状态', readonly=True,
91-
help=u"购货订单的审核状态", index=True, copy=False,
89+
help=u'确认单据的人')
90+
state = fields.Selection(COST_ORDER_STATES, u'确认状态', readonly=True,
91+
help=u"单据的确认状态", index=True, copy=False,
9292
default='draft')
9393
amount = fields.Float(u'合计金额', store=True, readonly=True,
9494
compute='_compute_amount', track_visibility='always',
@@ -194,14 +194,14 @@ def _create_mv_cost(self):
194194

195195
@api.one
196196
def cost_order_confim(self):
197-
'''审核服务订单'''
197+
'''确认服务订单'''
198198
if not self.name:
199199
self.update(
200200
{'name': self.env['ir.sequence'].next_by_code('cost.order') or '/'})
201201
if self.state == 'done':
202-
raise UserError(u'请不要重复审核!')
202+
raise UserError(u'请不要重复确认!')
203203
if self.state == 'cancel':
204-
raise UserError(u'请不要审核已中止的订单!')
204+
raise UserError(u'请不要确认已中止的订单!')
205205
if not self.line_ids:
206206
raise UserError(u'请输入服务明细行!')
207207
if not self.bank_account_id and self.prepayment:
@@ -215,9 +215,9 @@ def cost_order_confim(self):
215215

216216
@api.one
217217
def cost_order_draft(self):
218-
'''反审核服务订单'''
218+
'''撤销确认服务订单'''
219219
if self.state == 'draft':
220-
raise UserError(u'请不要重复反审核!')
220+
raise UserError(u'请不要重复撤销确认!')
221221

222222
for mv_id in self.wm_ids:
223223
cost_line_id = mv_id
@@ -230,11 +230,12 @@ def cost_order_draft(self):
230230
invoice_id.money_invoice_draft()
231231
invoice_id.unlink()
232232

233-
# 查找产生的付款单并反审核,删除
233+
# 查找产生的付款单并撤销确认,删除
234234
money_order = self.env['money.order'].search(
235235
[('origin_name', '=', self.name)])
236236
if money_order:
237-
money_order.money_order_draft()
237+
if money_order.state == 'done':
238+
money_order.money_order_draft()
238239
money_order.unlink()
239240

240241
self.state = 'draft'

account_cost/tests/test_cost_order.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,20 @@ def test_create_mv_cost(self):
8888

8989
def test_cost_order_draft_has_prepayment(self):
9090
'''反审核服务订单'''
91+
# 账户先收钱
92+
get_money = self.env.ref('money.get_40000')
93+
get_money.money_order_done()
94+
9195
self.cost_order_1.prepayment = 20
92-
self.cost_order_1.bank_account_id = self.env.ref('core.alipay')
96+
self.cost_order_1.bank_account_id = self.env.ref('core.comm')
9397
self.cost_order_1.cost_order_confim()
98+
# 找到对应的预收款单,并审核
99+
money_order = self.env['money.order'].search(
100+
[('origin_name', '=', self.cost_order_1.name)])
101+
if money_order:
102+
money_order.money_order_done()
103+
104+
# 反审核时,会找到已审核的预收款单,反审核并删除
94105
self.cost_order_1.cost_order_draft()
95106

96107

account_cost/views/cost_order_view.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
<field name="arch" type="xml">
2626
<form string="费用订单">
2727
<header>
28-
<button name="cost_order_confim" states="draft" string="审核" type="object" class="oe_highlight"/>
29-
<button name="cost_order_draft" states="done" string="反审核" type="object"/>
28+
<button name="cost_order_confim" states="draft" string="确认" type="object" class="oe_highlight"/>
29+
<button name="cost_order_draft" states="done" string="撤销确认" type="object"/>
3030
<button name="action_cancel" states="draft" string="作废" type="object"/>
3131
<field name="state" widget="statusbar" statusbar_visible="draft,done" statusbar_colors='{"done":"blue"}' readonly="1"/>
3232
</header>

app_odoo_customize/models/ir_ui_view.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class View(models.Model):
1212
@api.model
1313
def render_template(self, template, values=None, engine='ir.qweb'):
1414
if template in ['web.login', 'web.webclient_bootstrap']:
15-
if not values:
16-
values = {}
15+
values = values or {}
1716
values["title"] = self.env['ir.config_parameter'].get_param("app_system_name", "odooApp")
18-
return super(View, self).render_template(template, values=values, engine=engine)
17+
return super(View, self).render_template(template, values=values, engine=engine)

app_odoo_customize/tests/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# -*- coding: utf-8 -*-
2+
import test_settings
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# -*- coding: utf-8 -*-
2+
from odoo.tests.common import TransactionCase
3+
from odoo.exceptions import UserError
4+
5+
6+
class TestSettings(TransactionCase):
7+
def setUp(self):
8+
super(TestSettings, self).setUp()
9+
10+
def test_create(self):
11+
setting = self.env['app.theme.config.settings'].create({
12+
'app_system_name': 'GoodERP',
13+
})
14+
setting.set_default_all()
15+

asset/data/asset_data.xml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,46 @@
22
<openerp>
33
<data noupdate="1">
44
<record id="small_business_chart160101" model='finance.account'>
5-
<field name='code'>1601</field>
6-
<field name='name'>固定资产</field>
7-
<field name='costs_types'>assets</field>
5+
<field name='code'>160101</field>
6+
<field name='name'>固定资产-房屋</field>
7+
<field name='user_type' ref='finance.base_assest' />
8+
<field name='parent_id' ref='finance.small_business_chart1601' />
89
<field name='balance_directions'>in</field>
910
</record>
1011
<record id="small_business_chart410101" model='finance.account'>
1112
<field name='code'>410101</field>
1213
<field name='name'>制造费用-折旧费</field>
13-
<field name='costs_types'>cost</field>
14+
<field name='user_type' ref='finance.base_cost' />
1415
<field name='balance_directions'>in</field>
1516
</record>
1617
<record id="small_business_chart530101" model='finance.account'>
1718
<field name='code'>570101</field>
1819
<field name='name'>营业外收入-固定资产清理</field>
19-
<field name='costs_types'>in</field>
20+
<field name='user_type' ref='finance.base_in' />
2021
<field name='balance_directions'>out</field>
2122
</record>
2223
<record id="small_business_chart571101" model='finance.account'>
2324
<field name='code'>571101</field>
2425
<field name='name'>营业外支出-固定资产清理</field>
25-
<field name='costs_types'>out</field>
26+
<field name='user_type' ref='finance.base_in' />
2627
<field name='balance_directions'>in</field>
2728
</record>
2829
<record id="small_business_chart170101" model='finance.account'>
2930
<field name='code'>170101</field>
3031
<field name='name'>无形资产-土地</field>
31-
<field name='costs_types'>assets</field>
32+
<field name='user_type' ref='finance.base_assest' />
3233
<field name='balance_directions'>in</field>
3334
</record>
3435
<record id="small_business_chart170201" model='finance.account'>
3536
<field name='code'>170201</field>
3637
<field name='name'>累计摊销-土地</field>
37-
<field name='costs_types'>assets</field>
38+
<field name='user_type' ref='finance.base_assest' />
3839
<field name='balance_directions'>in</field>
3940
</record>
4041
<record id='small_business_chart5602022' model='finance.account'>
4142
<field name='code'>5602022</field>
4243
<field name='name'>管理费用-土地摊销</field>
43-
<field name='costs_types'>out</field>
44+
<field name='user_type' ref='finance.base_in' />
4445
<field name='balance_directions'>in</field>
4546
</record>
4647

asset/models/asset.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# 字段只读状态
1010
READONLY_STATES = {
11-
'done': [('readonly', True)], # 已审核
11+
'done': [('readonly', True)], # 已确认
1212
'clean': [('readonly', True)], # 已清理
1313
}
1414

@@ -119,7 +119,7 @@ def _get_net_value(self):
119119
'Amount'), store=True, compute='_get_cost_depreciation')
120120

121121
state = fields.Selection([('draft', u'草稿'),
122-
('done', u'已审核'),
122+
('done', u'已确认'),
123123
('clean', u'已清理')], u'状态', default='draft',
124124
index=True,)
125125

@@ -201,11 +201,11 @@ def onchange_bank_account(self):
201201

202202
@api.one
203203
def _wrong_asset_done(self):
204-
''' 固定资产审核入账前的验证 '''
204+
''' 固定资产确认入账前的验证 '''
205205
if self.state == 'done':
206-
raise UserError(u'请不要重复审核!')
206+
raise UserError(u'请不要重复确认!')
207207
if self.period_id.is_closed:
208-
raise UserError(u'该会计期间(%s)已结账!不能审核' % self.period_id.name)
208+
raise UserError(u'该会计期间(%s)已结账!不能确认' % self.period_id.name)
209209
if self.cost <= 0:
210210
raise UserError(u'金额必须大于0!\n金额:%s' % self.cost)
211211
if self.tax < 0:
@@ -235,7 +235,7 @@ def _partner_generate_invoice(self):
235235

236236
''' 因分类上只能设置一个固定资产科目,这里要用当前固定资产的对应科目替换凭证 '''
237237

238-
# 如未自动审核,则审核一下结算单
238+
# 如未自动确认,则确认一下结算单
239239
if money_invoice.state != 'done':
240240
money_invoice.money_invoice_done()
241241
# 找到结算单对应的凭证行并修改科目
@@ -285,7 +285,7 @@ def _construction_generate_voucher(self):
285285

286286
@api.one
287287
def asset_done(self):
288-
''' 审核固定资产 '''
288+
''' 确认固定资产 '''
289289
self._wrong_asset_done()
290290
# 非初始化固定资产生成入账凭证
291291
if not self.is_init:
@@ -305,15 +305,17 @@ def asset_done(self):
305305

306306
@api.one
307307
def asset_draft(self):
308-
''' 反审核固定资产 '''
308+
''' 撤销确认固定资产 '''
309309
if self.state == 'draft':
310-
raise UserError(u'请不要重复反审核!')
310+
raise UserError(u'请不要重复撤销确认!')
311311
if self.line_ids:
312-
raise UserError(u'已折旧不能反审核!')
312+
raise UserError(u'已折旧不能撤销确认!')
313313
if self.chang_ids:
314-
raise UserError(u'已变更不能反审核!')
314+
raise UserError(u'已变更不能撤销确认!')
315315
if self.period_id.is_closed:
316-
raise UserError(u'该会计期间(%s)已结账!不能反审核' % self.period_id.name)
316+
raise UserError(u'该会计期间(%s)已结账!不能撤销确认' % self.period_id.name)
317+
if self.money_invoice.reconciled != 0:
318+
raise UserError(u'固定资产已有核销,请不要撤销')
317319

318320
'''删掉凭证'''
319321
if self.voucher_id:
@@ -411,7 +413,7 @@ def _clean_cost_generate_other_pay(self, clean_cost):
411413

412414
@api.one
413415
def _generate_voucher(self, Asset):
414-
''' 生成凭证,并审核 '''
416+
''' 生成凭证,并确认 '''
415417
vouch_obj = self.env['voucher'].create({'date': self.date, 'ref': '%s,%s' % (self._name, self.id)})
416418
depreciation2 = sum(line.cost_depreciation for line in Asset.line_ids)
417419
depreciation = Asset.depreciation_previous + depreciation2
@@ -507,7 +509,7 @@ def create_chang_account(self):
507509
'tax_amount': self.chang_tax
508510
})
509511

510-
# 如未自动审核,则审核一下结算单
512+
# 如未自动确认,则确认一下结算单
511513
if money_invoice.state != 'done':
512514
money_invoice.money_invoice_done()
513515
#将分类上的资产科目替换为固定资产上的资产科目
@@ -640,7 +642,7 @@ def create_depreciation(self):
640642
res = []
641643
asset_line_id_list = []
642644
for Asset in self.env['asset'].search([('no_depreciation', '=', False), # 提折旧的
643-
('state', '=', 'done'), # 已审核
645+
('state', '=', 'done'), # 已确认
644646
('period_id', '!=', self.period_id.id)]): # 从入账下月开始
645647
# 本期间没有折旧过,本期间晚于固定资产入账期间
646648
if self.period_id not in [line.period_id for line in Asset.line_ids] and \
@@ -746,7 +748,7 @@ def init_asset(self):
746748
res = {}
747749
if self.env['asset'].search([('is_init', '=', True),
748750
('state', '=', 'draft')]):
749-
raise UserError(u'有未审核的初始化固定资产')
751+
raise UserError(u'有未确认的初始化固定资产')
750752
for Asset in self.env['asset'].search([('is_init', '=', True),
751753
('state', '=', 'done')]):
752754
cost = Asset.cost

0 commit comments

Comments
 (0)