sync from 14.0
This commit is contained in:
1 parent
f769370605
commit
b137bb0cd0
25 files changed
+600
-17
No files matched your search
@@ -13,7 +13,8 @@ This projects provides a highly opinionated way to develop Odoo and Odoo modules
|
||||
* **Community Edition**: Checkout the Odoo Community Edition and start editing the source code
|
||||
* **Enterprise Modules**: Checkout the Odoo enterprise modules and deploy them into the Odoo Docker container or the Odoo source.
|
||||
* **Develop Modules**: Scaffold a new module, develop new Odoo features locally and [much more](./task.md)
|
||||
* **Customizing Snippets**: See [snippets](./snippets.md) to find various Odoo view edits
|
||||
* **Customizing Snippets**: Create [snippets](./snippets.md) and push them to an Odoo database
|
||||
* **Odoo Scripts**: Develope scripts to patch Odoo modules
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -43,6 +44,7 @@ task checkout 14.0
|
||||
# or
|
||||
task checkout 15.0
|
||||
```
|
||||
|
||||
Install [Odoo scripts](https://github.com/Mint-System/Ansible-Playbooks/tree/master/roles/odoo-scripts)
|
||||
|
||||
```bash
|
||||
@@ -83,12 +85,6 @@ Open browser to [http://localhost:8069](http://localhost:8069) and login with `a
|
||||
docker-odoo-install -m show_db_name
|
||||
```
|
||||
|
||||
**Save config with Docker**
|
||||
|
||||
```bash
|
||||
docker exec -it odoo bin/bash -c "odoo -s -d odoo --db_host \$HOST -r \$USER -w \$PASSWORD"
|
||||
```
|
||||
|
||||
### Native
|
||||
|
||||
Run Odoo from source.
|
||||
@@ -133,12 +129,12 @@ Open browser to [http://localhost:8069](http://localhost:8069) and login with `a
|
||||
Scaffold a new module.
|
||||
|
||||
```bash
|
||||
task create-module project_report
|
||||
task create-module addons/project_report
|
||||
```
|
||||
|
||||
### Common
|
||||
|
||||
Instructions that are true for Docker and Source usage paths.
|
||||
Instructions that are true for Docker and native usage paths.
|
||||
|
||||
**Enable developer mode**
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ package.json
|
||||
package-lock.json
|
||||
.gitignore
|
||||
.vercelignore
|
||||
config/addons_path
|
||||
config/checkout_files
|
||||
logo.png
|
||||
docker-compose.yml
|
||||
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/usr/lib/python3/dist-packages/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}odoo/addons/hr_holidays/models/hr_leave.py"
|
||||
FIND="'name': meeting_name,"
|
||||
REPLACE="'name': meeting_name.replace('on Time Off ', holiday.holiday_status_id.name),"
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND/$REPLACE/g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/usr/lib/python3/dist-packages/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}odoo/addons/hr_holidays/models/hr_leave.py"
|
||||
FIND="if not is_officer:"
|
||||
REPLACE="if not True:"
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND/$REPLACE/g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/usr/lib/python3/dist-packages/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}odoo/addons/hr_holidays/models/hr_leave.py"
|
||||
FIND="body=_('Your %s planned on %s has been refused') % (holiday.holiday_status_id.display_name, holiday.date_from),"
|
||||
IFS='' read -r -d '' REPLACE << EOM
|
||||
body=(_('Your %s planned on %s has been refused') % (holiday.holiday_status_id.display_name, holiday.date_from)) + _('<br/>Note: %s') % (holiday.sudo().report_note),
|
||||
EOM
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
LINE=$(grep -n "$FIND" $FILE | cut -f1 -d:)
|
||||
|
||||
# Find and append
|
||||
awk -v n="$LINE" -v s="$REPLACE" '{ if(NR == n) {print s} else {print} }' $FILE > $FILE.tmp && mv $FILE.tmp $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/usr/lib/python3/dist-packages/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}odoo/addons/hr_holidays/models/hr_leave.py"
|
||||
FIND="report_note = fields.Text('HR Comments', copy=False, groups=\"hr_holidays.group_hr_holidays_manager\")"
|
||||
REPLACE="report_note = fields.Text('HR Comments', copy=False, groups=\"hr_holidays.group_hr_holidays_responsible\")"
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND/$REPLACE/g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/usr/lib/python3/dist-packages/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}odoo/addons/hr_holidays/models/hr_leave.py"
|
||||
FIND="body=_('Your %s planned on %s has been accepted' % (holiday.holiday_status_id.display_name, holiday.date_from)),"
|
||||
REPLACE="body=_('Your %s planned on %s has been accepted') % (holiday.holiday_status_id.display_name, holiday.date_from),"
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND/$REPLACE/g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/usr/lib/python3/dist-packages/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}odoo/addons/hr_holidays/models/hr_leave.py"
|
||||
FIND="note = _('New %s Request created by %s from %s to %s') % (holiday.holiday_status_id.name, holiday.create_uid.name, start, end)"
|
||||
IFS='' read -r -d '' APPEND << EOM
|
||||
if holiday.name:
|
||||
note += _('<br/>Comment: %s') % (holiday.name)
|
||||
EOM
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
LINE=$(grep -n "$FIND" $FILE | cut -f1 -d:)
|
||||
|
||||
# Find and append
|
||||
awk -v n="$LINE" -v s="$APPEND" 'NR-1 == n {print s} {print}' $FILE > $FILE.tmp && mv $FILE.tmp $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/usr/lib/python3/dist-packages/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}odoo/addons/project/models/project.py"
|
||||
FIND="date_assign = fields.Datetime(string='Assigning Date', index=True, copy=False, readonly=True)"
|
||||
REPLACE="date_assign = fields.Datetime(string='Assigning Date', index=True, copy=False, readonly=False)"
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND/$REPLACE/g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Remove file
|
||||
rm -f $FILE
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/mnt/addons"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}/web_timeline/static/src/js/timeline_renderer.js"
|
||||
FIND='groups.push({id: -1, content: _t("<b>UNASSIGNED<\/b>")});'
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND//g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/mnt/addons"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}/web_timeline/static/src/js/timeline_view.js"
|
||||
FIND="orientation: \"both\","
|
||||
REPLACE="orientation: attrs.orientation ? JSON.parse(attrs.orientation) : {item: \"top\"},"
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND/$REPLACE/g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/usr/lib/python3/dist-packages/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}odoo/addons/delivery/__manifest__.py"
|
||||
FIND="'sale_stock', 'sale_management'"
|
||||
REPLACE="'sale_stock'"
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND/$REPLACE/g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Remove file
|
||||
rm -f $FILE
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/usr/lib/python3/dist-packages/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}odoo/addons/gio_payroll_custom/models/hr_employee.py"
|
||||
FIND="from odoo import api, fields, models, _"
|
||||
IFS='' read -r -d '' APPEND << EOM
|
||||
from odoo import api, fields, models, _
|
||||
|
||||
|
||||
class EmployeePublic(models.Model):
|
||||
_inherit = 'hr.employee.public'
|
||||
|
||||
gio_children_training = fields.Integer(string="Anzahl Kinder im Studium")
|
||||
EOM
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
LINE=$(grep -n "$FIND" $FILE | cut -f1 -d:)
|
||||
|
||||
# Find and append
|
||||
awk -v n="$LINE" -v s="$APPEND" 'NR-1 == n {print s} {print}' $FILE > $FILE.tmp && mv $FILE.tmp $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/mnt/addons/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}l10n_ch_base_bank/models/invoice.py"
|
||||
FIND="bank_acc.acc_type != \"qr-iban\""
|
||||
REPLACE="bank_acc.acc_type == \"qr-iban\""
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND/$REPLACE/g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Remove file
|
||||
rm -f $FILE
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/mnt/addons/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}l10n_ch_base_bank/models/partner_bank.py"
|
||||
FIND="ISR {}"
|
||||
REPLACE="{}"
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND/$REPLACE/g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Remove file
|
||||
rm -f $FILE
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/usr/lib/python3/dist-packages/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}odoo/addons/hr/views/res_users.xml"
|
||||
FIND='<footer position="replace"\/>'
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND//g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Remove file
|
||||
rm -f $FILE
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/usr/lib/python3/dist-packages/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}odoo/service/server.py"
|
||||
FIND="for db_name, registry in registries.d.items()"
|
||||
REPLACE="for db_name, registry in registries.d.copy().items()"
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
# Find and replace
|
||||
sed -i'' "s/$FIND/$REPLACE/g" $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Remove file
|
||||
rm -f $FILE
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get script name
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
# First param is docker container
|
||||
CONTAINER=$1
|
||||
|
||||
# Default configuration
|
||||
PACKAGE_PATH="/mnt/enterprise/"
|
||||
|
||||
# Custom configuration
|
||||
FILE_PATH="${PACKAGE_PATH}account_reports/models/account_generic_tax_report.py"
|
||||
FIND="move_vals_lines.append((0, 0, {'name': tax_name"
|
||||
IFS='' read -r -d '' REPLACE << EOM
|
||||
domain = [('src', '=', tax_name), ('lang', '=', self._context.get('lang') )]
|
||||
translation = self.env['ir.translation'].search(domain, limit=1)
|
||||
move_vals_lines.append((0, 0, {'name': translation.value if translation else tax_name, 'debit': abs(amt) if amt < 0 else 0, 'credit': amt if amt > 0 else 0, 'account_id': account_id}))
|
||||
EOM
|
||||
|
||||
# Get filename
|
||||
FILE=`basename "$FILE_PATH"`
|
||||
|
||||
# Copy from docker
|
||||
docker cp "$CONTAINER":"$FILE_PATH" .
|
||||
|
||||
LINE=$(grep -n "$FIND" $FILE | cut -f1 -d:)
|
||||
|
||||
echo $LINE
|
||||
|
||||
# Find and replace
|
||||
awk -v n="$LINE" -v r="$REPLACE" '{if(NR==n){print r}else{print}}' $FILE > $FILE.tmp && mv $FILE.tmp $FILE
|
||||
|
||||
# Copy back to docker
|
||||
docker cp $FILE "$CONTAINER":"$FILE_PATH"
|
||||
|
||||
# Register patch installation
|
||||
echo "Patch $SCRIPT applied."
|
||||
touch "/etc/odoo/${SCRIPT}_${CONTAINER}_installed"
|
||||
@@ -3,9 +3,7 @@
|
||||
|
||||
<xpath expr="//h2" position="before">
|
||||
<!-- Get all pickings without duplicates -->
|
||||
<t t-set="pickings" t-value="set([line.picking_ids[0] for line in o.invoice_line_ids if line.picking_ids])"/>
|
||||
<!-- Filter pickings that are canclled -->
|
||||
<t t-set="pickings" t-value="[picking for picking in pickings if picking.state != 'cancel']"/>
|
||||
<t t-set="pickings" t-value="list(set(o.invoice_line_ids.picking_ids.filtered(lambda p: p.state != 'cancel')))"/>
|
||||
<!-- Store if has pickings -->
|
||||
<t t-set="has_pickings" t-value="len(pickings) > 0"/>
|
||||
<!-- Store if has multiple pickings -->
|
||||
@@ -26,7 +24,7 @@
|
||||
<t t-set="null" t-value="pickings.append(False)"/>
|
||||
</t>
|
||||
|
||||
<!--<p t-esc="pickings"/> -->
|
||||
<!--<p t-esc="pickings"/> -->
|
||||
<!-- <p t-esc="has_pickings"/> -->
|
||||
<!-- <p t-esc="has_multiple_pickings"/> -->
|
||||
<!-- <p t-esc="has_lines_without_pickings"/> -->
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<data inherit_id="account.view_invoice_tree" priority="50">
|
||||
|
||||
<field name="ref" position="after">
|
||||
<field name="x_account_codes" optional="hide"/>
|
||||
</field>
|
||||
|
||||
</data>
|
||||
File renamed without changes.
@@ -3,7 +3,7 @@
|
||||
|
||||
<record id="x_state" model="ir.model.fields">
|
||||
<field name="domain">[]</field>
|
||||
<field name="field_description">Status</field>
|
||||
<field name="field_description">Status Bestellposition</field>
|
||||
<field name="model">purchase.order.line</field>
|
||||
<field name="model_id" ref="purchase.model_purchase_order_line"/>
|
||||
<field name="name">x_state</field>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<record id="x_state" model="ir.model.fields">
|
||||
<field name="domain">[]</field>
|
||||
<field name="field_description">Status</field>
|
||||
<field name="field_description">Status Auftragsposition</field>
|
||||
<field name="model">sale.order.line</field>
|
||||
<field name="model_id" ref="sale.model_sale_order_line"/>
|
||||
<field name="name">x_state</field>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0"?>
|
||||
<data inherit_id="web.external_layout_standard" priority="50">
|
||||
|
||||
<xpath expr="/t/div" position="replace">
|
||||
<div t-attf-class="header o_company_#{company.id}_layout" t-att-style="report_header_style">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 150px;" alt="Logo"/>
|
||||
</div>
|
||||
<div class="col-9" name="company_address">
|
||||
<style>
|
||||
#header-info {
|
||||
border-top: black 3px solid;
|
||||
border-bottom: black 3px solid;
|
||||
font-size: 0.9rem;
|
||||
margin-right: 15px;
|
||||
}
|
||||
</style>
|
||||
<div class="row" style="height: 50px">
|
||||
</div>
|
||||
<div id="header-info" class="row">
|
||||
<div class="col-3" style="text-transform: uppercase;">
|
||||
<span class="o_bold" t-field="company.name"/>
|
||||
</div>
|
||||
<div class="col-1"/>
|
||||
<div class="col-4">
|
||||
<span t-field="company.partner_id.street"/>
|
||||
<br/>
|
||||
<span t-field="company.partner_id.zip"/>
|
||||
<span t-field="company.partner_id.city"/>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<span t-field="company.partner_id.phone"/>
|
||||
<br/>
|
||||
<span t-field="company.partner_id.email"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
</data>
|
||||
@@ -5,7 +5,7 @@
|
||||
""",
|
||||
"author": "Mint System GmbH, Odoo Community Association (OCA)",
|
||||
"website": "https://www.mint-system.ch",
|
||||
"category": "Technical,Accounting,Invoicing,Sales,Human Resources,Manufacturing,Website,Inventory,Administration,Tools",
|
||||
"category": "Purchase,Technical,Accounting,Invoicing,Sales,Human Resources,Manufacturing,Website,Inventory,Administration,Tools",
|
||||
"version": "14.0.0.0.0",
|
||||
"license": "AGPL-3",
|
||||
"depends": ["base"],
|
||||
|
||||
Reference in new issue
Block a user