Skip to content

Instantly share code, notes, and snippets.

View hieuhani's full-sized avatar
🎯
The beginning is the end and the end is the beginning

Hieu Tran hieuhani

🎯
The beginning is the end and the end is the beginning
View GitHub Profile
import { AsyncStorage } from 'react-native'
import { OdooRPC } from '../node-odoorpc'
type QueryFirstParams = {
model: string,
id: number,
fields: [string],
}
type QueryParams = {
export const UPDATE_INVENTORY_ADJUSTMENTS = 'UPDATE_INVENTORY_ADJUSTMENTS'
export function updateInventoryAdjustments(inventoryAdjustments) {
return {
type: UPDATE_INVENTORY_ADJUSTMENTS,
payload: {
inventoryAdjustments,
},
}
}
import React from 'react'
import {
View,
StyleSheet,
} from 'react-native'
import { connect } from 'react-redux'
import { NavigationScreenProp } from 'react-navigation'
import Colors from '../../common/Colors'
import Header from '../../common/Header'
import Transactions from './Transactions'
import Joi from 'joi'
import jwt from 'jsonwebtoken'
import logger from '../logger'
import RestController from './RestController'
import AppError from '../AppError'
export default class ApplicationsController extends RestController {
async validateAppToken(payload) {
logger.debug('validate application token with data', payload)
const validationSchema = Joi.object().keys({
import PromiseRouter from './PromiseRouter'
function hello(req) {
const { authController } = req.config
return authController.sayHello()
}
export default class AuthRouter extends PromiseRouter {
mountRoutes() {
this.route('GET', '/hello', req => (hello(req)))
import React from 'react'
import Validator from 'validatorjs'
import styled from 'styled-components'
import en from 'validatorjs/src/lang/en'
import { TextField } from 'office-ui-fabric-react/lib/TextField'
import { DefaultButton } from 'office-ui-fabric-react/lib/Button'
Validator.setMessages('en', en)
const Spacer = styled.div`
result = db.session.execute(
db
.update(Contact, values={'value': payload['value']}, returning=Contact.__table__.columns)
.where(Contact.id == payload['id'])
)
db.session.commit()
fetched_data = result.first()
contact = {}
for (index, column) in enumerate(result.keys()):
contact[column] = fetched_data[index]
CREATE TABLE [dbo].[AspNetRoleClaims] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[RoleId] NVARCHAR (450) NOT NULL,
[ClaimType] NVARCHAR (MAX) NULL,
[ClaimValue] NVARCHAR (MAX) NULL,
CONSTRAINT [PK_AspNetRoleClaims] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_AspNetRoleClaims_AspNetRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[AspNetRoles] ([Id]) ON DELETE CASCADE
);
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrfaYSxlYBMtYUrxxobQPMvPu+FPrQjfacG2XLp7gH5MGnt6ChSyBzAVs9x0goanp6HBX/yq7m4yOjAJr+/Us/rRwjTB5f39jyt0rxqmdmLZKgJf6FhOjfxcJYlJMdUmhFUQyKq3Z0jDAZeu7Fd1LXp8Ky8ow1Ra1eT9FAHZzSfzW9EBKibmKc8+dQpw4mnHc2GpCO7Fqd3m120zDSJJHtn+xrQGB5akLeMO3HBkAPeKUq+ntPA6qz5nRT8Nx9kIo3sDMMWT7Cu3l/rrjondufpP72WAeeZ4GN42K3XQJAqnp/AjXrtN/cCnMT8N9YjgXLVLyVZc4vKbCNfXCd/vRn [email protected]
quants = env['stock.quant'].search([])
move_line_ids = []
warning = ''
for quant in quants:
move_lines = env["stock.move.line"].search([
('product_id', '=', quant.product_id.id),
('location_id', '=', quant.location_id.id),
('lot_id', '=', quant.lot_id.id),
('package_id', '=', quant.package_id.id),
('owner_id', '=', quant.owner_id.id),