修改git的全局名称
C:\Users\Administrator>git config user.name
zhangcong
C:\Users\Administrator>git config --global user.name "张聪"
C:\Users\Administrator>git config user.name
张聪
1.odoo中search的用法:
search(arg,offset,limit,id)
在class,self表示的是一个实例,想要查询每一条记录,
self.env['product.object'].search([]) 或写成 self.env['product.object'].search([(‘last_stock_move_id’,'!=',None)])
def fix_last_stock_move_id(self):
"""修正所有条码品的最新出入库id"""
move_pool = self.env["stock.move"]
pos = self.env['product.object'].search([('last_stock_move_id','=',None)])
for po in pos:
last_move_ids = move_pool.search([("barcode", "like", po.name), ("barcode", "!=", None)], limit=1, order='id desc')
if last_move_ids:
po.last_stock_move_id = last_move_ids[0].id
# 一次一提交到数据库中
self._cr.commit()
新加的翻译需要升级,但是修改的翻译只需加载翻译,覆盖原有术语