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
<?php
namespace App\Models;
use App\Notifiable;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Laravel\Lumen\Auth\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
@hieuhani
hieuhani / release.sh
Created April 5, 2020 08:43
Release to latest branch
#!/bin/sh
yarn install
yarn build
git checkout --orphan latest
mkdir release_tmp
mv packages/ui/dist release_tmp/dist
mv packages/ui/package.json release_tmp
rm -rf packages
rm `find . -type f | grep -Ev '.git|release_tmp|node_modules'`
class SaleOrder(models.Model):
_inherit = "sale.order"
@api.model_create_multi
def create_from_po(self, vals_list):
partner = self.env['res.partner'].search([('name', 'ilike', self.env.user.name)], limit=1)
if not partner:
raise ValidationError(_('Partner database is not configured properly'))
product_codes = set()
uom_names = set()
Django==4.0.5
djangorestframework==3.13.1
Pillow==9.1.1
import scrapy
class DienmayxanhSpider(scrapy.Spider):
name = "dienmayxanh"
def start_requests(self):
urls = [
"https://www.dienmayxanh.com",
]