Merge remote-tracking branch 'origin/12.0' into 12.0

This commit is contained in:
Ivan.x390
2019-07-18 00:20:46 +08:00
9 changed files with 104 additions and 22 deletions

View File

@@ -23,7 +23,7 @@
{ {
'name': 'Odoo Customize(Debranding, My Odoo)', 'name': 'Odoo Customize(Debranding, My Odoo)',
'version': '12.19.07.06', 'version': '13.19.07.12',
'author': 'Sunpop.cn', 'author': 'Sunpop.cn',
'category': 'Productivity', 'category': 'Productivity',
'website': 'https://www.sunpop.cn', 'website': 'https://www.sunpop.cn',
@@ -70,6 +70,7 @@
26. Add multi uninstall modules 26. Add multi uninstall modules
27. Add odoo 13 support, Just install this app on odoo 13, master branch of odoo github. 27. Add odoo 13 support, Just install this app on odoo 13, master branch of odoo github.
28. Fix pos remove data for account close. 28. Fix pos remove data for account close.
29. Fix account reset.
This module can help to white label the Odoo. This module can help to white label the Odoo.
Also helpful for training and support for your odoo end-user. Also helpful for training and support for your odoo end-user.

View File

@@ -268,6 +268,34 @@ class ResConfigSettings(models.TransientModel):
pass # raise Warning(e) pass # raise Warning(e)
return True return True
@api.multi
def remove_expense(self):
to_removes = [
# 清除
['hr.expense.sheet', ],
['hr.expense', ],
['hr.payslip', ],
['hr.payslip.run', ],
]
try:
for line in to_removes:
obj_name = line[0]
obj = self.pool.get(obj_name)
if obj:
sql = "delete from %s" % obj._table
self._cr.execute(sql)
# 更新序号
seqs = self.env['ir.sequence'].search([
('code', '=', 'hr.expense.invoice')])
for seq in seqs:
seq.write({
'number_next': 1,
})
self._cr.execute(sql)
except Exception as e:
pass # raise Warning(e)
return True
@api.multi @api.multi
def remove_mrp(self): def remove_mrp(self):
to_removes = [ to_removes = [
@@ -426,13 +454,63 @@ class ResConfigSettings(models.TransientModel):
def remove_account_chart(self): def remove_account_chart(self):
to_removes = [ to_removes = [
# 清除财务科目,用于重设 # 清除财务科目,用于重设
['res.partner.bank', ],
['res.bank', ],
['account.move.line'],
['account.invoice'],
['account.payment'],
['account.bank.statement', ],
['account.tax.account.tag', ], ['account.tax.account.tag', ],
['account.tax', ], ['account.tax', ],
['account.tax', ],
['account.account.account.tag', ], ['account.account.account.tag', ],
['wizard_multi_charts_accounts'], ['wizard_multi_charts_accounts'],
['account.account', ], ['account.account', ],
['account.journal', ], ['account.journal', ],
] ]
# todo: 要做 remove_hr因为工资表会用到 account
# 更新account关联很多是多公司字段故只存在 ir_property故在原模型只能用update
try:
# reset default tax不管多公司
field1 = self.env['ir.model.fields']._get('product.template', "taxes_id").id
field2 = self.env['ir.model.fields']._get('product.template', "supplier_taxes_id").id
sql = ("delete from ir_default where field_id = %s or field_id = %s") % (field1, field2)
self._cr.execute(sql)
except Exception as e:
pass # raise Warning(e)
try:
rec = self.env['res.partner'].search([])
for r in rec:
r.write({
'property_account_receivable_id': None,
'property_account_payable_id': None,
})
except Exception as e:
pass # raise Warning(e)
try:
rec = self.env['product.category'].search([])
for r in rec:
r.write({
'property_account_income_categ_id': None,
'property_account_expense_categ_id': None,
'property_account_creditor_price_difference_categ': None,
'property_stock_account_input_categ_id': None,
'property_stock_account_output_categ_id': None,
'property_stock_valuation_account_id': None,
})
except Exception as e:
pass # raise Warning(e)
try:
rec = self.env['stock.location'].search([])
for r in rec:
r.write({
'valuation_in_account_id': None,
'valuation_out_account_id': None,
})
except Exception as e:
pass # raise Warning(e)
try: try:
for line in to_removes: for line in to_removes:
obj_name = line[0] obj_name = line[0]
@@ -441,18 +519,13 @@ class ResConfigSettings(models.TransientModel):
sql = "delete from %s" % obj._table sql = "delete from %s" % obj._table
self._cr.execute(sql) self._cr.execute(sql)
# reset default tax不管多公司
field1 = self.env['ir.model.fields']._get('product.template', "taxes_id").id
field2 = self.env['ir.model.fields']._get('product.template', "supplier_taxes_id").id
sql = ("delete from ir_default where field_id = %s or field_id = %s") % (field1, field2) sql = "update res_company set chart_template_id=null;"
self._cr.execute(sql)
sql = "update res_company set chart_template_id=null ;"
self._cr.execute(sql) self._cr.execute(sql)
# 更新序号 # 更新序号
except Exception as e: except Exception as e:
pass pass
return True return True
@api.multi @api.multi

View File

@@ -7,6 +7,7 @@ class SaleOrder(models.Model):
_inherit = "sale.order" _inherit = "sale.order"
def _get_default_weight_uom_name(self): def _get_default_weight_uom_name(self):
# todo: 此处没有处理翻译,后续调整
get_param = self.env['ir.config_parameter'].sudo().get_param get_param = self.env['ir.config_parameter'].sudo().get_param
product_weight_in_lbs_param = get_param('product.weight_in_lbs') product_weight_in_lbs_param = get_param('product.weight_in_lbs')
if product_weight_in_lbs_param == '1': if product_weight_in_lbs_param == '1':

View File

@@ -23,21 +23,22 @@
{ {
'name': "Capacity of Stock Location货架容量管理", 'name': "Capacity of Stock Location货架容量管理",
'version': '12.19.03.18', 'version': '12.19.07.12',
'author': 'Sunpop.cn', 'author': 'Sunpop.cn',
'category': 'Warehouse', 'category': 'Warehouse',
'website': 'http://www.sunpop.cn', 'website': 'http://www.sunpop.cn',
'license': 'LGPL-3', 'license': 'LGPL-3',
'sequence': 2, 'sequence': 2,
'summary': """ 'summary': """
Add stock shelf, stock rack, stock slot manager. Shelf Auto Name with XYZ like WH-X1-Y2-Z6. Capacity manage for stock location.stock Capacity.
Add shelf menu. Capacity by quantity and certain order, like sale order.
set prepare location for sale order.
""", """,
'description': """ 'description': """
1. 1.
""", """,
'price': 68.00, 'price': 98.00,
'currency': 'EUR', 'currency': 'EUR',
'depends': [ 'depends': [
'stock', 'stock',

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View File

@@ -1,9 +1,9 @@
<section class="oe_container"> <section class="oe_container">
<div class="oe_row oe_spaced" style="max-width: 95%;"> <div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_span12"> <div class="oe_span12">
<h2 class="oe_slogan">App Shelf manage of stock</h2> <h2 class="oe_slogan">Capacity of Stock Location</h2>
<div class="" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;"> <div class="" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
<p>This moduld allows user to manager shelf report. </p> <p>This moduld allows user to manager Capacity of Stock Location. </p>
<h3>Lastest update: v12.19.1.6</h3> <h3>Lastest update: v12.19.1.6</h3>
<div class="oe_span12 oe_spaced"> <div class="oe_span12 oe_spaced">
<div class="alert alert-info" style="padding:8px;font-weight: 300; font-size: 20px;"> <div class="alert alert-info" style="padding:8px;font-weight: 300; font-size: 20px;">
@@ -11,11 +11,11 @@
<ul class="list-unstyled"> <ul class="list-unstyled">
<li> <li>
<i class="fa fa-check-square-o text-primary"></i> <i class="fa fa-check-square-o text-primary"></i>
1. Add shelf manage menu, default value. 1. Add Capacity manage for stock location.
</li> </li>
<li> <li>
<i class="fa fa-check-square-o text-primary"></i> <i class="fa fa-check-square-o text-primary"></i>
2. Shelf Auto Name with XYZ like WH-X1-Y2-Z6. 2. Capacity by quantity and certain order. set location for every sale order
</li> </li>
</ul> </ul>
</div> </div>
@@ -31,18 +31,24 @@
<div class="oe_row oe_spaced" style="max-width: 95%;"> <div class="oe_row oe_spaced" style="max-width: 95%;">
<div class="oe_demo" <div class="oe_demo"
style="margin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;"> style="margin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;">
<h2 class='oe_mt32'>Add stock shelf, stock rack, stock slot manager. Shelf Auto Name with XYZ like WH-X1-Y2-Z6.</h2> <h2 class='oe_mt32'>Capacity manage for stock location.</h2>
</div> </div>
<div class="oe_demo oe_screenshot"> <div class="oe_demo oe_screenshot">
<img src="demo.jpg" style="border:1px solid black"/>
<p></p>
<h2 class='oe_mt32'>Set is shelf location?</h2>
<img src="demo1.jpg" style="border:1px solid black"/> <img src="demo1.jpg" style="border:1px solid black"/>
<p></p> <p></p>
<h2 class='oe_mt32'>Auto name shelf.</h2> </div>
<div class="oe_demo oe_screenshot">
<img src="demo2.jpg" style="border:1px solid black"/> <img src="demo2.jpg" style="border:1px solid black"/>
<p></p> <p></p>
</div> </div>
<div class="oe_demo"
style="margin: 20px auto; padding: 0 15px 0 0; border:none; border-top:solid 1px #dedede; width: 96%;">
<h2 class='oe_mt32'>Capacity by quantity and certain order.</h2>
</div>
<div class="oe_demo oe_screenshot">
<img src="demo3.jpg" style="border:1px solid black"/>
<p></p>
</div>
</div> </div>
</section> </section>

View File

@@ -69,7 +69,7 @@
<field name="inherit_id" ref="stock.view_location_form"/> <field name="inherit_id" ref="stock.view_location_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<!--库存占用--> <!--库存占用-->
<xpath expr="//form/group" position="inside"> <xpath expr="//form//group" position="inside">
<group string="Capacity" attrs="{'invisible': [('usage', 'not in', ('internal', 'transit'))]}"> <group string="Capacity" attrs="{'invisible': [('usage', 'not in', ('internal', 'transit'))]}">
<field name="capacity_type"/> <field name="capacity_type"/>
<field name="occupied_order" readonly="1" attrs="{'invisible': [('capacity_type', '!=', 'model')]}"/> <field name="occupied_order" readonly="1" attrs="{'invisible': [('capacity_type', '!=', 'model')]}"/>